├── LXDAppFluecyMonitor.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── linxinda.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── linxinda.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── LXDAppFluecyMonitor.xcscheme │ └── xcschememanagement.plist ├── LXDAppFluecyMonitor ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── LXDAppFluecyMonitor │ ├── Backtrace │ │ ├── LXDBacktraceLogger.h │ │ └── LXDBacktraceLogger.m │ ├── LXDAppFluecyMonitor.h │ └── LXDAppFluecyMonitor.m ├── ViewController.h ├── ViewController.m └── main.m ├── LXDAppFluecyMonitorTests ├── Info.plist └── LXDAppFluecyMonitorTests.m └── LXDAppFluecyMonitorUITests ├── Info.plist └── LXDAppFluecyMonitorUITests.m /LXDAppFluecyMonitor.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | EF1F485D1E83AD15002EF135 /* LXDBacktraceLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = EF1F485C1E83AD15002EF135 /* LXDBacktraceLogger.m */; }; 11 | EF96931B1E8218B4005EC812 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = EF96931A1E8218B4005EC812 /* main.m */; }; 12 | EF96931E1E8218B4005EC812 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = EF96931D1E8218B4005EC812 /* AppDelegate.m */; }; 13 | EF9693211E8218B4005EC812 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = EF9693201E8218B4005EC812 /* ViewController.m */; }; 14 | EF9693241E8218B4005EC812 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EF9693221E8218B4005EC812 /* Main.storyboard */; }; 15 | EF9693261E8218B4005EC812 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EF9693251E8218B4005EC812 /* Assets.xcassets */; }; 16 | EF9693291E8218B4005EC812 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EF9693271E8218B4005EC812 /* LaunchScreen.storyboard */; }; 17 | EF9693341E8218B5005EC812 /* LXDAppFluecyMonitorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = EF9693331E8218B5005EC812 /* LXDAppFluecyMonitorTests.m */; }; 18 | EF96933F1E8218B5005EC812 /* LXDAppFluecyMonitorUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = EF96933E1E8218B5005EC812 /* LXDAppFluecyMonitorUITests.m */; }; 19 | EF96934F1E82197E005EC812 /* LXDAppFluecyMonitor.m in Sources */ = {isa = PBXBuildFile; fileRef = EF96934E1E82197E005EC812 /* LXDAppFluecyMonitor.m */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | EF9693301E8218B5005EC812 /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = EF96930E1E8218B4005EC812 /* Project object */; 26 | proxyType = 1; 27 | remoteGlobalIDString = EF9693151E8218B4005EC812; 28 | remoteInfo = LXDAppFluecyMonitor; 29 | }; 30 | EF96933B1E8218B5005EC812 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = EF96930E1E8218B4005EC812 /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = EF9693151E8218B4005EC812; 35 | remoteInfo = LXDAppFluecyMonitor; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | EF1F485B1E83AD15002EF135 /* LXDBacktraceLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LXDBacktraceLogger.h; sourceTree = ""; }; 41 | EF1F485C1E83AD15002EF135 /* LXDBacktraceLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LXDBacktraceLogger.m; sourceTree = ""; }; 42 | EF9693161E8218B4005EC812 /* LXDAppFluecyMonitor.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LXDAppFluecyMonitor.app; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | EF96931A1E8218B4005EC812 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 44 | EF96931C1E8218B4005EC812 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 45 | EF96931D1E8218B4005EC812 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 46 | EF96931F1E8218B4005EC812 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 47 | EF9693201E8218B4005EC812 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 48 | EF9693231E8218B4005EC812 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 49 | EF9693251E8218B4005EC812 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 50 | EF9693281E8218B4005EC812 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 51 | EF96932A1E8218B4005EC812 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 52 | EF96932F1E8218B5005EC812 /* LXDAppFluecyMonitorTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LXDAppFluecyMonitorTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | EF9693331E8218B5005EC812 /* LXDAppFluecyMonitorTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LXDAppFluecyMonitorTests.m; sourceTree = ""; }; 54 | EF9693351E8218B5005EC812 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | EF96933A1E8218B5005EC812 /* LXDAppFluecyMonitorUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LXDAppFluecyMonitorUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | EF96933E1E8218B5005EC812 /* LXDAppFluecyMonitorUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LXDAppFluecyMonitorUITests.m; sourceTree = ""; }; 57 | EF9693401E8218B5005EC812 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 58 | EF96934D1E82197E005EC812 /* LXDAppFluecyMonitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LXDAppFluecyMonitor.h; sourceTree = ""; }; 59 | EF96934E1E82197E005EC812 /* LXDAppFluecyMonitor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LXDAppFluecyMonitor.m; sourceTree = ""; }; 60 | /* End PBXFileReference section */ 61 | 62 | /* Begin PBXFrameworksBuildPhase section */ 63 | EF9693131E8218B4005EC812 /* Frameworks */ = { 64 | isa = PBXFrameworksBuildPhase; 65 | buildActionMask = 2147483647; 66 | files = ( 67 | ); 68 | runOnlyForDeploymentPostprocessing = 0; 69 | }; 70 | EF96932C1E8218B5005EC812 /* Frameworks */ = { 71 | isa = PBXFrameworksBuildPhase; 72 | buildActionMask = 2147483647; 73 | files = ( 74 | ); 75 | runOnlyForDeploymentPostprocessing = 0; 76 | }; 77 | EF9693371E8218B5005EC812 /* Frameworks */ = { 78 | isa = PBXFrameworksBuildPhase; 79 | buildActionMask = 2147483647; 80 | files = ( 81 | ); 82 | runOnlyForDeploymentPostprocessing = 0; 83 | }; 84 | /* End PBXFrameworksBuildPhase section */ 85 | 86 | /* Begin PBXGroup section */ 87 | EF1F485A1E83AD02002EF135 /* Backtrace */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | EF1F485B1E83AD15002EF135 /* LXDBacktraceLogger.h */, 91 | EF1F485C1E83AD15002EF135 /* LXDBacktraceLogger.m */, 92 | ); 93 | path = Backtrace; 94 | sourceTree = ""; 95 | }; 96 | EF96930D1E8218B4005EC812 = { 97 | isa = PBXGroup; 98 | children = ( 99 | EF9693181E8218B4005EC812 /* LXDAppFluecyMonitor */, 100 | EF9693321E8218B5005EC812 /* LXDAppFluecyMonitorTests */, 101 | EF96933D1E8218B5005EC812 /* LXDAppFluecyMonitorUITests */, 102 | EF9693171E8218B4005EC812 /* Products */, 103 | ); 104 | sourceTree = ""; 105 | }; 106 | EF9693171E8218B4005EC812 /* Products */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | EF9693161E8218B4005EC812 /* LXDAppFluecyMonitor.app */, 110 | EF96932F1E8218B5005EC812 /* LXDAppFluecyMonitorTests.xctest */, 111 | EF96933A1E8218B5005EC812 /* LXDAppFluecyMonitorUITests.xctest */, 112 | ); 113 | name = Products; 114 | sourceTree = ""; 115 | }; 116 | EF9693181E8218B4005EC812 /* LXDAppFluecyMonitor */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | EF96934C1E82196E005EC812 /* LXDAppFluecyMonitor */, 120 | EF96931C1E8218B4005EC812 /* AppDelegate.h */, 121 | EF96931D1E8218B4005EC812 /* AppDelegate.m */, 122 | EF96931F1E8218B4005EC812 /* ViewController.h */, 123 | EF9693201E8218B4005EC812 /* ViewController.m */, 124 | EF9693221E8218B4005EC812 /* Main.storyboard */, 125 | EF9693251E8218B4005EC812 /* Assets.xcassets */, 126 | EF9693271E8218B4005EC812 /* LaunchScreen.storyboard */, 127 | EF96932A1E8218B4005EC812 /* Info.plist */, 128 | EF9693191E8218B4005EC812 /* Supporting Files */, 129 | ); 130 | path = LXDAppFluecyMonitor; 131 | sourceTree = ""; 132 | }; 133 | EF9693191E8218B4005EC812 /* Supporting Files */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | EF96931A1E8218B4005EC812 /* main.m */, 137 | ); 138 | name = "Supporting Files"; 139 | sourceTree = ""; 140 | }; 141 | EF9693321E8218B5005EC812 /* LXDAppFluecyMonitorTests */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | EF9693331E8218B5005EC812 /* LXDAppFluecyMonitorTests.m */, 145 | EF9693351E8218B5005EC812 /* Info.plist */, 146 | ); 147 | path = LXDAppFluecyMonitorTests; 148 | sourceTree = ""; 149 | }; 150 | EF96933D1E8218B5005EC812 /* LXDAppFluecyMonitorUITests */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | EF96933E1E8218B5005EC812 /* LXDAppFluecyMonitorUITests.m */, 154 | EF9693401E8218B5005EC812 /* Info.plist */, 155 | ); 156 | path = LXDAppFluecyMonitorUITests; 157 | sourceTree = ""; 158 | }; 159 | EF96934C1E82196E005EC812 /* LXDAppFluecyMonitor */ = { 160 | isa = PBXGroup; 161 | children = ( 162 | EF1F485A1E83AD02002EF135 /* Backtrace */, 163 | EF96934D1E82197E005EC812 /* LXDAppFluecyMonitor.h */, 164 | EF96934E1E82197E005EC812 /* LXDAppFluecyMonitor.m */, 165 | ); 166 | path = LXDAppFluecyMonitor; 167 | sourceTree = ""; 168 | }; 169 | /* End PBXGroup section */ 170 | 171 | /* Begin PBXNativeTarget section */ 172 | EF9693151E8218B4005EC812 /* LXDAppFluecyMonitor */ = { 173 | isa = PBXNativeTarget; 174 | buildConfigurationList = EF9693431E8218B5005EC812 /* Build configuration list for PBXNativeTarget "LXDAppFluecyMonitor" */; 175 | buildPhases = ( 176 | EF9693121E8218B4005EC812 /* Sources */, 177 | EF9693131E8218B4005EC812 /* Frameworks */, 178 | EF9693141E8218B4005EC812 /* Resources */, 179 | ); 180 | buildRules = ( 181 | ); 182 | dependencies = ( 183 | ); 184 | name = LXDAppFluecyMonitor; 185 | productName = LXDAppFluecyMonitor; 186 | productReference = EF9693161E8218B4005EC812 /* LXDAppFluecyMonitor.app */; 187 | productType = "com.apple.product-type.application"; 188 | }; 189 | EF96932E1E8218B5005EC812 /* LXDAppFluecyMonitorTests */ = { 190 | isa = PBXNativeTarget; 191 | buildConfigurationList = EF9693461E8218B5005EC812 /* Build configuration list for PBXNativeTarget "LXDAppFluecyMonitorTests" */; 192 | buildPhases = ( 193 | EF96932B1E8218B5005EC812 /* Sources */, 194 | EF96932C1E8218B5005EC812 /* Frameworks */, 195 | EF96932D1E8218B5005EC812 /* Resources */, 196 | ); 197 | buildRules = ( 198 | ); 199 | dependencies = ( 200 | EF9693311E8218B5005EC812 /* PBXTargetDependency */, 201 | ); 202 | name = LXDAppFluecyMonitorTests; 203 | productName = LXDAppFluecyMonitorTests; 204 | productReference = EF96932F1E8218B5005EC812 /* LXDAppFluecyMonitorTests.xctest */; 205 | productType = "com.apple.product-type.bundle.unit-test"; 206 | }; 207 | EF9693391E8218B5005EC812 /* LXDAppFluecyMonitorUITests */ = { 208 | isa = PBXNativeTarget; 209 | buildConfigurationList = EF9693491E8218B5005EC812 /* Build configuration list for PBXNativeTarget "LXDAppFluecyMonitorUITests" */; 210 | buildPhases = ( 211 | EF9693361E8218B5005EC812 /* Sources */, 212 | EF9693371E8218B5005EC812 /* Frameworks */, 213 | EF9693381E8218B5005EC812 /* Resources */, 214 | ); 215 | buildRules = ( 216 | ); 217 | dependencies = ( 218 | EF96933C1E8218B5005EC812 /* PBXTargetDependency */, 219 | ); 220 | name = LXDAppFluecyMonitorUITests; 221 | productName = LXDAppFluecyMonitorUITests; 222 | productReference = EF96933A1E8218B5005EC812 /* LXDAppFluecyMonitorUITests.xctest */; 223 | productType = "com.apple.product-type.bundle.ui-testing"; 224 | }; 225 | /* End PBXNativeTarget section */ 226 | 227 | /* Begin PBXProject section */ 228 | EF96930E1E8218B4005EC812 /* Project object */ = { 229 | isa = PBXProject; 230 | attributes = { 231 | LastUpgradeCheck = 0820; 232 | ORGANIZATIONNAME = Jolimark; 233 | TargetAttributes = { 234 | EF9693151E8218B4005EC812 = { 235 | CreatedOnToolsVersion = 8.2; 236 | DevelopmentTeam = 7J57ACJ383; 237 | ProvisioningStyle = Automatic; 238 | }; 239 | EF96932E1E8218B5005EC812 = { 240 | CreatedOnToolsVersion = 8.2; 241 | DevelopmentTeam = 7J57ACJ383; 242 | ProvisioningStyle = Automatic; 243 | TestTargetID = EF9693151E8218B4005EC812; 244 | }; 245 | EF9693391E8218B5005EC812 = { 246 | CreatedOnToolsVersion = 8.2; 247 | DevelopmentTeam = 7J57ACJ383; 248 | ProvisioningStyle = Automatic; 249 | TestTargetID = EF9693151E8218B4005EC812; 250 | }; 251 | }; 252 | }; 253 | buildConfigurationList = EF9693111E8218B4005EC812 /* Build configuration list for PBXProject "LXDAppFluecyMonitor" */; 254 | compatibilityVersion = "Xcode 3.2"; 255 | developmentRegion = English; 256 | hasScannedForEncodings = 0; 257 | knownRegions = ( 258 | en, 259 | Base, 260 | ); 261 | mainGroup = EF96930D1E8218B4005EC812; 262 | productRefGroup = EF9693171E8218B4005EC812 /* Products */; 263 | projectDirPath = ""; 264 | projectRoot = ""; 265 | targets = ( 266 | EF9693151E8218B4005EC812 /* LXDAppFluecyMonitor */, 267 | EF96932E1E8218B5005EC812 /* LXDAppFluecyMonitorTests */, 268 | EF9693391E8218B5005EC812 /* LXDAppFluecyMonitorUITests */, 269 | ); 270 | }; 271 | /* End PBXProject section */ 272 | 273 | /* Begin PBXResourcesBuildPhase section */ 274 | EF9693141E8218B4005EC812 /* Resources */ = { 275 | isa = PBXResourcesBuildPhase; 276 | buildActionMask = 2147483647; 277 | files = ( 278 | EF9693291E8218B4005EC812 /* LaunchScreen.storyboard in Resources */, 279 | EF9693261E8218B4005EC812 /* Assets.xcassets in Resources */, 280 | EF9693241E8218B4005EC812 /* Main.storyboard in Resources */, 281 | ); 282 | runOnlyForDeploymentPostprocessing = 0; 283 | }; 284 | EF96932D1E8218B5005EC812 /* Resources */ = { 285 | isa = PBXResourcesBuildPhase; 286 | buildActionMask = 2147483647; 287 | files = ( 288 | ); 289 | runOnlyForDeploymentPostprocessing = 0; 290 | }; 291 | EF9693381E8218B5005EC812 /* Resources */ = { 292 | isa = PBXResourcesBuildPhase; 293 | buildActionMask = 2147483647; 294 | files = ( 295 | ); 296 | runOnlyForDeploymentPostprocessing = 0; 297 | }; 298 | /* End PBXResourcesBuildPhase section */ 299 | 300 | /* Begin PBXSourcesBuildPhase section */ 301 | EF9693121E8218B4005EC812 /* Sources */ = { 302 | isa = PBXSourcesBuildPhase; 303 | buildActionMask = 2147483647; 304 | files = ( 305 | EF1F485D1E83AD15002EF135 /* LXDBacktraceLogger.m in Sources */, 306 | EF9693211E8218B4005EC812 /* ViewController.m in Sources */, 307 | EF96934F1E82197E005EC812 /* LXDAppFluecyMonitor.m in Sources */, 308 | EF96931E1E8218B4005EC812 /* AppDelegate.m in Sources */, 309 | EF96931B1E8218B4005EC812 /* main.m in Sources */, 310 | ); 311 | runOnlyForDeploymentPostprocessing = 0; 312 | }; 313 | EF96932B1E8218B5005EC812 /* Sources */ = { 314 | isa = PBXSourcesBuildPhase; 315 | buildActionMask = 2147483647; 316 | files = ( 317 | EF9693341E8218B5005EC812 /* LXDAppFluecyMonitorTests.m in Sources */, 318 | ); 319 | runOnlyForDeploymentPostprocessing = 0; 320 | }; 321 | EF9693361E8218B5005EC812 /* Sources */ = { 322 | isa = PBXSourcesBuildPhase; 323 | buildActionMask = 2147483647; 324 | files = ( 325 | EF96933F1E8218B5005EC812 /* LXDAppFluecyMonitorUITests.m in Sources */, 326 | ); 327 | runOnlyForDeploymentPostprocessing = 0; 328 | }; 329 | /* End PBXSourcesBuildPhase section */ 330 | 331 | /* Begin PBXTargetDependency section */ 332 | EF9693311E8218B5005EC812 /* PBXTargetDependency */ = { 333 | isa = PBXTargetDependency; 334 | target = EF9693151E8218B4005EC812 /* LXDAppFluecyMonitor */; 335 | targetProxy = EF9693301E8218B5005EC812 /* PBXContainerItemProxy */; 336 | }; 337 | EF96933C1E8218B5005EC812 /* PBXTargetDependency */ = { 338 | isa = PBXTargetDependency; 339 | target = EF9693151E8218B4005EC812 /* LXDAppFluecyMonitor */; 340 | targetProxy = EF96933B1E8218B5005EC812 /* PBXContainerItemProxy */; 341 | }; 342 | /* End PBXTargetDependency section */ 343 | 344 | /* Begin PBXVariantGroup section */ 345 | EF9693221E8218B4005EC812 /* Main.storyboard */ = { 346 | isa = PBXVariantGroup; 347 | children = ( 348 | EF9693231E8218B4005EC812 /* Base */, 349 | ); 350 | name = Main.storyboard; 351 | sourceTree = ""; 352 | }; 353 | EF9693271E8218B4005EC812 /* LaunchScreen.storyboard */ = { 354 | isa = PBXVariantGroup; 355 | children = ( 356 | EF9693281E8218B4005EC812 /* Base */, 357 | ); 358 | name = LaunchScreen.storyboard; 359 | sourceTree = ""; 360 | }; 361 | /* End PBXVariantGroup section */ 362 | 363 | /* Begin XCBuildConfiguration section */ 364 | EF9693411E8218B5005EC812 /* Debug */ = { 365 | isa = XCBuildConfiguration; 366 | buildSettings = { 367 | ALWAYS_SEARCH_USER_PATHS = NO; 368 | CLANG_ANALYZER_NONNULL = YES; 369 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 370 | CLANG_CXX_LIBRARY = "libc++"; 371 | CLANG_ENABLE_MODULES = YES; 372 | CLANG_ENABLE_OBJC_ARC = YES; 373 | CLANG_WARN_BOOL_CONVERSION = YES; 374 | CLANG_WARN_CONSTANT_CONVERSION = YES; 375 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 376 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 377 | CLANG_WARN_EMPTY_BODY = YES; 378 | CLANG_WARN_ENUM_CONVERSION = YES; 379 | CLANG_WARN_INFINITE_RECURSION = YES; 380 | CLANG_WARN_INT_CONVERSION = YES; 381 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 382 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 383 | CLANG_WARN_UNREACHABLE_CODE = YES; 384 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 385 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 386 | COPY_PHASE_STRIP = NO; 387 | DEBUG_INFORMATION_FORMAT = dwarf; 388 | ENABLE_STRICT_OBJC_MSGSEND = YES; 389 | ENABLE_TESTABILITY = YES; 390 | GCC_C_LANGUAGE_STANDARD = gnu99; 391 | GCC_DYNAMIC_NO_PIC = NO; 392 | GCC_NO_COMMON_BLOCKS = YES; 393 | GCC_OPTIMIZATION_LEVEL = 0; 394 | GCC_PREPROCESSOR_DEFINITIONS = ( 395 | "DEBUG=1", 396 | "$(inherited)", 397 | ); 398 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 399 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 400 | GCC_WARN_UNDECLARED_SELECTOR = YES; 401 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 402 | GCC_WARN_UNUSED_FUNCTION = YES; 403 | GCC_WARN_UNUSED_VARIABLE = YES; 404 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 405 | MTL_ENABLE_DEBUG_INFO = YES; 406 | ONLY_ACTIVE_ARCH = YES; 407 | SDKROOT = iphoneos; 408 | }; 409 | name = Debug; 410 | }; 411 | EF9693421E8218B5005EC812 /* Release */ = { 412 | isa = XCBuildConfiguration; 413 | buildSettings = { 414 | ALWAYS_SEARCH_USER_PATHS = NO; 415 | CLANG_ANALYZER_NONNULL = YES; 416 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 417 | CLANG_CXX_LIBRARY = "libc++"; 418 | CLANG_ENABLE_MODULES = YES; 419 | CLANG_ENABLE_OBJC_ARC = YES; 420 | CLANG_WARN_BOOL_CONVERSION = YES; 421 | CLANG_WARN_CONSTANT_CONVERSION = YES; 422 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 423 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 424 | CLANG_WARN_EMPTY_BODY = YES; 425 | CLANG_WARN_ENUM_CONVERSION = YES; 426 | CLANG_WARN_INFINITE_RECURSION = YES; 427 | CLANG_WARN_INT_CONVERSION = YES; 428 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 429 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 430 | CLANG_WARN_UNREACHABLE_CODE = YES; 431 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 432 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 433 | COPY_PHASE_STRIP = NO; 434 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 435 | ENABLE_NS_ASSERTIONS = NO; 436 | ENABLE_STRICT_OBJC_MSGSEND = YES; 437 | GCC_C_LANGUAGE_STANDARD = gnu99; 438 | GCC_NO_COMMON_BLOCKS = YES; 439 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 440 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 441 | GCC_WARN_UNDECLARED_SELECTOR = YES; 442 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 443 | GCC_WARN_UNUSED_FUNCTION = YES; 444 | GCC_WARN_UNUSED_VARIABLE = YES; 445 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 446 | MTL_ENABLE_DEBUG_INFO = NO; 447 | SDKROOT = iphoneos; 448 | VALIDATE_PRODUCT = YES; 449 | }; 450 | name = Release; 451 | }; 452 | EF9693441E8218B5005EC812 /* Debug */ = { 453 | isa = XCBuildConfiguration; 454 | buildSettings = { 455 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 456 | DEVELOPMENT_TEAM = 7J57ACJ383; 457 | INFOPLIST_FILE = LXDAppFluecyMonitor/Info.plist; 458 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 459 | PRODUCT_BUNDLE_IDENTIFIER = jolimark.com.LXDAppFluecyMonitor; 460 | PRODUCT_NAME = "$(TARGET_NAME)"; 461 | }; 462 | name = Debug; 463 | }; 464 | EF9693451E8218B5005EC812 /* Release */ = { 465 | isa = XCBuildConfiguration; 466 | buildSettings = { 467 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 468 | DEVELOPMENT_TEAM = 7J57ACJ383; 469 | INFOPLIST_FILE = LXDAppFluecyMonitor/Info.plist; 470 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 471 | PRODUCT_BUNDLE_IDENTIFIER = jolimark.com.LXDAppFluecyMonitor; 472 | PRODUCT_NAME = "$(TARGET_NAME)"; 473 | }; 474 | name = Release; 475 | }; 476 | EF9693471E8218B5005EC812 /* Debug */ = { 477 | isa = XCBuildConfiguration; 478 | buildSettings = { 479 | BUNDLE_LOADER = "$(TEST_HOST)"; 480 | DEVELOPMENT_TEAM = 7J57ACJ383; 481 | INFOPLIST_FILE = LXDAppFluecyMonitorTests/Info.plist; 482 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 483 | PRODUCT_BUNDLE_IDENTIFIER = jolimark.com.LXDAppFluecyMonitorTests; 484 | PRODUCT_NAME = "$(TARGET_NAME)"; 485 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LXDAppFluecyMonitor.app/LXDAppFluecyMonitor"; 486 | }; 487 | name = Debug; 488 | }; 489 | EF9693481E8218B5005EC812 /* Release */ = { 490 | isa = XCBuildConfiguration; 491 | buildSettings = { 492 | BUNDLE_LOADER = "$(TEST_HOST)"; 493 | DEVELOPMENT_TEAM = 7J57ACJ383; 494 | INFOPLIST_FILE = LXDAppFluecyMonitorTests/Info.plist; 495 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 496 | PRODUCT_BUNDLE_IDENTIFIER = jolimark.com.LXDAppFluecyMonitorTests; 497 | PRODUCT_NAME = "$(TARGET_NAME)"; 498 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LXDAppFluecyMonitor.app/LXDAppFluecyMonitor"; 499 | }; 500 | name = Release; 501 | }; 502 | EF96934A1E8218B5005EC812 /* Debug */ = { 503 | isa = XCBuildConfiguration; 504 | buildSettings = { 505 | DEVELOPMENT_TEAM = 7J57ACJ383; 506 | INFOPLIST_FILE = LXDAppFluecyMonitorUITests/Info.plist; 507 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 508 | PRODUCT_BUNDLE_IDENTIFIER = jolimark.com.LXDAppFluecyMonitorUITests; 509 | PRODUCT_NAME = "$(TARGET_NAME)"; 510 | TEST_TARGET_NAME = LXDAppFluecyMonitor; 511 | }; 512 | name = Debug; 513 | }; 514 | EF96934B1E8218B5005EC812 /* Release */ = { 515 | isa = XCBuildConfiguration; 516 | buildSettings = { 517 | DEVELOPMENT_TEAM = 7J57ACJ383; 518 | INFOPLIST_FILE = LXDAppFluecyMonitorUITests/Info.plist; 519 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 520 | PRODUCT_BUNDLE_IDENTIFIER = jolimark.com.LXDAppFluecyMonitorUITests; 521 | PRODUCT_NAME = "$(TARGET_NAME)"; 522 | TEST_TARGET_NAME = LXDAppFluecyMonitor; 523 | }; 524 | name = Release; 525 | }; 526 | /* End XCBuildConfiguration section */ 527 | 528 | /* Begin XCConfigurationList section */ 529 | EF9693111E8218B4005EC812 /* Build configuration list for PBXProject "LXDAppFluecyMonitor" */ = { 530 | isa = XCConfigurationList; 531 | buildConfigurations = ( 532 | EF9693411E8218B5005EC812 /* Debug */, 533 | EF9693421E8218B5005EC812 /* Release */, 534 | ); 535 | defaultConfigurationIsVisible = 0; 536 | defaultConfigurationName = Release; 537 | }; 538 | EF9693431E8218B5005EC812 /* Build configuration list for PBXNativeTarget "LXDAppFluecyMonitor" */ = { 539 | isa = XCConfigurationList; 540 | buildConfigurations = ( 541 | EF9693441E8218B5005EC812 /* Debug */, 542 | EF9693451E8218B5005EC812 /* Release */, 543 | ); 544 | defaultConfigurationIsVisible = 0; 545 | defaultConfigurationName = Release; 546 | }; 547 | EF9693461E8218B5005EC812 /* Build configuration list for PBXNativeTarget "LXDAppFluecyMonitorTests" */ = { 548 | isa = XCConfigurationList; 549 | buildConfigurations = ( 550 | EF9693471E8218B5005EC812 /* Debug */, 551 | EF9693481E8218B5005EC812 /* Release */, 552 | ); 553 | defaultConfigurationIsVisible = 0; 554 | defaultConfigurationName = Release; 555 | }; 556 | EF9693491E8218B5005EC812 /* Build configuration list for PBXNativeTarget "LXDAppFluecyMonitorUITests" */ = { 557 | isa = XCConfigurationList; 558 | buildConfigurations = ( 559 | EF96934A1E8218B5005EC812 /* Debug */, 560 | EF96934B1E8218B5005EC812 /* Release */, 561 | ); 562 | defaultConfigurationIsVisible = 0; 563 | defaultConfigurationName = Release; 564 | }; 565 | /* End XCConfigurationList section */ 566 | }; 567 | rootObject = EF96930E1E8218B4005EC812 /* Project object */; 568 | } 569 | -------------------------------------------------------------------------------- /LXDAppFluecyMonitor.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /LXDAppFluecyMonitor.xcodeproj/project.xcworkspace/xcuserdata/linxinda.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UIControl/LXDAppFluecyMonitor/ebf99f66657f33252610ea8e0dc620ea30cff9c2/LXDAppFluecyMonitor.xcodeproj/project.xcworkspace/xcuserdata/linxinda.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /LXDAppFluecyMonitor.xcodeproj/xcuserdata/linxinda.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /LXDAppFluecyMonitor.xcodeproj/xcuserdata/linxinda.xcuserdatad/xcschemes/LXDAppFluecyMonitor.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /LXDAppFluecyMonitor.xcodeproj/xcuserdata/linxinda.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | LXDAppFluecyMonitor.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | EF9693151E8218B4005EC812 16 | 17 | primary 18 | 19 | 20 | EF96932E1E8218B5005EC812 21 | 22 | primary 23 | 24 | 25 | EF9693391E8218B5005EC812 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /LXDAppFluecyMonitor/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // LXDAppFluecyMonitor 4 | // 5 | // Created by linxinda on 2017/3/22. 6 | // Copyright © 2017年 Jolimark. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /LXDAppFluecyMonitor/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // LXDAppFluecyMonitor 4 | // 5 | // Created by linxinda on 2017/3/22. 6 | // Copyright © 2017年 Jolimark. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /LXDAppFluecyMonitor/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /LXDAppFluecyMonitor/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /LXDAppFluecyMonitor/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /LXDAppFluecyMonitor/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /LXDAppFluecyMonitor/LXDAppFluecyMonitor/Backtrace/LXDBacktraceLogger.h: -------------------------------------------------------------------------------- 1 | // 2 | // LXDBacktraceLogger.h 3 | // LXDAppFluecyMonitor 4 | // 5 | // Created by linxinda on 2017/3/23. 6 | // Copyright © 2017年 Jolimark. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /*! 12 | * @brief 线程堆栈上下文输出 13 | */ 14 | @interface LXDBacktraceLogger : NSObject 15 | 16 | + (NSString *)lxd_backtraceOfAllThread; 17 | + (NSString *)lxd_backtraceOfMainThread; 18 | + (NSString *)lxd_backtraceOfCurrentThread; 19 | + (NSString *)lxd_backtraceOfNSThread:(NSThread *)thread; 20 | 21 | + (void)lxd_logMain; 22 | + (void)lxd_logCurrent; 23 | + (void)lxd_logAllThread; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /LXDAppFluecyMonitor/LXDAppFluecyMonitor/Backtrace/LXDBacktraceLogger.m: -------------------------------------------------------------------------------- 1 | // 2 | // LXDBacktraceLogger.m 3 | // LXDAppFluecyMonitor 4 | // 5 | // Created by linxinda on 2017/3/23. 6 | // Copyright © 2017年 Jolimark. All rights reserved. 7 | // 8 | 9 | #import "LXDBacktraceLogger.h" 10 | #import 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | 20 | 21 | 22 | 23 | /*! 24 | * @brief 适配不同CPU的宏定义 25 | * 26 | * @thx 代码出自https://github.com/bestswifter/BSBacktraceLogger 加工修改 27 | */ 28 | #if defined(__arm64__) 29 | #define DETAG_INSTRUCTION_ADDRESS(A) ((A) & ~(3UL)) 30 | #define LXD_THREAD_STATE_COUNT ARM_THREAD_STATE64_COUNT 31 | #define LXD_THREAD_STATE ARM_THREAD_STATE64 32 | #define LXD_FRAME_POINTER __fp 33 | #define LXD_STACK_POINTER __sp 34 | #define LXD_INSTRUCTION_ADDRESS __pc 35 | 36 | #elif defined(__arm__) 37 | #define DETAG_INSTRUCTION_ADDRESS(A) ((A) & ~(1UL)) 38 | #define LXD_THREAD_STATE_COUNT ARM_THREAD_STATE_COUNT 39 | #define LXD_THREAD_STATE ARM_THREAD_STATE 40 | #define LXD_FRAME_POINTER __r[7] 41 | #define LXD_STACK_POINTER __sp 42 | #define LXD_INSTRUCTION_ADDRESS __pc 43 | 44 | #elif defined(__x86_64__) 45 | #define DETAG_INSTRUCTION_ADDRESS(A) (A) 46 | #define LXD_THREAD_STATE_COUNT x86_THREAD_STATE64_COUNT 47 | #define LXD_THREAD_STATE x86_THREAD_STATE64 48 | #define LXD_FRAME_POINTER __rbp 49 | #define LXD_STACK_POINTER __rsp 50 | #define LXD_INSTRUCTION_ADDRESS __rip 51 | 52 | #elif defined(__i386__) 53 | #define DETAG_INSTRUCTION_ADDRESS(A) (A) 54 | #define LXD_THREAD_STATE_COUNT x86_THREAD_STATE32_COUNT 55 | #define LXD_THREAD_STATE x86_THREAD_STATE32 56 | #define LXD_FRAME_POINTER __ebp 57 | #define LXD_STACK_POINTER __esp 58 | #define LXD_INSTRUCTION_ADDRESS __eip 59 | 60 | #endif 61 | 62 | #if defined(__LP64__) 63 | #define TRACE_FMT "%-4d%-31s 0x%016lx %s + %lu" 64 | #define POINTER_FMT "0x%016lx" 65 | #define POINTER_SHORT_FMT "0x%lx" 66 | #define LXD_NLIST struct nlist_64 67 | #else 68 | #define TRACE_FMT "%-4d%-31s 0x%08lx %s + %lu" 69 | #define POINTER_FMT "0x%08lx" 70 | #define POINTER_SHORT_FMT "0x%lx" 71 | #define LXD_NLIST struct nlist 72 | 73 | #endif 74 | 75 | #define MAX_FRAME_NUMBER 30 76 | #define LOG_SEPERATE printf("\n"); 77 | #define FAILED_UINT_PTR_ADDRESS 0 78 | #define CALL_INSTRUCTION_FROM_RETURN_ADDRESS(A) (DETAG_INSTRUCTION_ADDRESS((A)) - 1) 79 | 80 | 81 | typedef struct LXDStackFrameEntry{ 82 | const struct LXDStackFrameEntry * const previous; 83 | const uintptr_t return_address; 84 | } LXDStackFrameEntry; 85 | 86 | static mach_port_t main_thread_id; 87 | 88 | 89 | 90 | @implementation LXDBacktraceLogger 91 | 92 | + (void)load { 93 | main_thread_id = mach_thread_self(); 94 | } 95 | 96 | 97 | #pragma mark - Public 98 | + (NSString *)lxd_backtraceOfAllThread { 99 | thread_act_array_t threads; 100 | mach_msg_type_number_t thread_count = 0; 101 | const task_t this_task = mach_task_self(); 102 | 103 | kern_return_t kr = task_threads(this_task, &threads, &thread_count); 104 | if (kr != KERN_SUCCESS) { 105 | return @"Failed to get information of all threads"; 106 | } 107 | NSMutableString * result = @"".mutableCopy; 108 | for (int idx = 0; idx < thread_count; idx++) { 109 | [result appendString: _lxd_backtraceOfThread(threads[idx])]; 110 | } 111 | return result.copy; 112 | } 113 | 114 | + (NSString *)lxd_backtraceOfMainThread { 115 | return [self lxd_backtraceOfNSThread: [NSThread mainThread]]; 116 | } 117 | 118 | + (NSString *)lxd_backtraceOfCurrentThread { 119 | return [self lxd_backtraceOfNSThread: [NSThread currentThread]]; 120 | } 121 | 122 | + (NSString *)lxd_backtraceOfNSThread:(NSThread *)thread { 123 | return _lxd_backtraceOfThread(lxd_machThreadFromNSThread(thread)); 124 | } 125 | 126 | + (void)lxd_logMain { 127 | LOG_SEPERATE 128 | NSLog(@"%@", [self lxd_backtraceOfMainThread]); 129 | LOG_SEPERATE 130 | } 131 | 132 | + (void)lxd_logCurrent { 133 | LOG_SEPERATE 134 | NSLog(@"%@", [self lxd_backtraceOfCurrentThread]); 135 | LOG_SEPERATE 136 | } 137 | 138 | + (void)lxd_logAllThread { 139 | LOG_SEPERATE 140 | NSLog(@"%@", [self lxd_backtraceOfAllThread]); 141 | LOG_SEPERATE 142 | } 143 | 144 | 145 | #pragma mark - Generate 146 | thread_t lxd_machThreadFromNSThread(NSThread * nsthread) { 147 | char name[256]; 148 | thread_act_array_t list; 149 | mach_msg_type_number_t count; 150 | task_threads(mach_task_self(), &list, &count); 151 | 152 | NSTimeInterval timeStamp = [[NSDate date] timeIntervalSince1970]; 153 | NSString * originName = nsthread.name; 154 | [nsthread setName: [NSString stringWithFormat: @"%f", timeStamp]]; 155 | 156 | if ([nsthread isMainThread]) { return (thread_t)main_thread_id; } 157 | 158 | for (int idx = 0; idx < count; idx++) { 159 | pthread_t pt = pthread_from_mach_thread_np(list[idx]); 160 | if ([nsthread isMainThread] && list[idx] == main_thread_id) { return list[idx]; } 161 | if (pt) { 162 | name[0] = '\0'; 163 | pthread_getname_np(pt, name, sizeof(name)); 164 | if (!strcmp(name, [nsthread name].UTF8String)) { 165 | [nsthread setName: originName]; 166 | return list[idx]; 167 | } 168 | } 169 | } 170 | [nsthread setName: originName]; 171 | return mach_thread_self(); 172 | } 173 | 174 | NSString * _lxd_backtraceOfThread(thread_t thread) { 175 | uintptr_t backtraceBuffer[MAX_FRAME_NUMBER]; 176 | int idx = 0; 177 | NSMutableString * result = [NSString stringWithFormat: @"Backtrace of Thread %u:\n======================================================================================\n", thread].mutableCopy; 178 | 179 | _STRUCT_MCONTEXT machineContext; 180 | if (!lxd_fillThreadStateIntoMachineContext(thread, &machineContext)) { 181 | return [NSString stringWithFormat: @"Failed to get information abount thread: %u", thread]; 182 | } 183 | const uintptr_t instructionAddress = lxd_mach_instructionAddress(&machineContext); 184 | backtraceBuffer[idx++] = instructionAddress; 185 | 186 | uintptr_t linkRegister = lxd_mach_linkRegister(&machineContext); 187 | if (linkRegister) { 188 | backtraceBuffer[idx++] = linkRegister; 189 | } 190 | if (instructionAddress == FAILED_UINT_PTR_ADDRESS) { return @"Failed to get instruction address"; } 191 | 192 | LXDStackFrameEntry frame = { 0 }; 193 | const uintptr_t framePtr = lxd_mach_framePointer(&machineContext); 194 | if (framePtr == FAILED_UINT_PTR_ADDRESS || 195 | lxd_mach_copyMem((void *)framePtr, &frame, sizeof(frame)) != KERN_SUCCESS) { 196 | return @"failed to get frame pointer"; 197 | } 198 | 199 | for (; idx < MAX_FRAME_NUMBER; idx++) { 200 | backtraceBuffer[idx] = frame.return_address; 201 | if (backtraceBuffer[idx] == FAILED_UINT_PTR_ADDRESS || 202 | frame.previous == NULL || 203 | lxd_mach_copyMem(frame.previous, &frame, sizeof(frame)) != KERN_SUCCESS) { 204 | break; 205 | } 206 | } 207 | 208 | int backtraceLength = idx; 209 | Dl_info symbolicated[backtraceLength]; 210 | lxd_symbolicate(backtraceBuffer, symbolicated, backtraceLength, 0); 211 | for (int idx = 0; idx < backtraceLength; idx++) { 212 | [result appendFormat: @"%@", lxd_logBacktraceEntry(idx, backtraceBuffer[idx], &symbolicated[idx])]; 213 | } 214 | [result appendString: @"\n"]; 215 | [result appendString: @"======================================================================================"]; 216 | return result.copy; 217 | } 218 | 219 | 220 | #pragma mark - operate machine context 221 | bool lxd_fillThreadStateIntoMachineContext(thread_t thread, _STRUCT_MCONTEXT * machineContext) { 222 | mach_msg_type_number_t state_count = LXD_THREAD_STATE_COUNT; 223 | kern_return_t kr = thread_get_state(thread, LXD_THREAD_STATE, (thread_state_t)&machineContext->__ss, &state_count); 224 | return (kr == KERN_SUCCESS); 225 | } 226 | 227 | uintptr_t lxd_mach_linkRegister(_STRUCT_MCONTEXT * const machineContext){ 228 | #if defined(__i386__) || defined(__x86_64__) 229 | return FAILED_UINT_PTR_ADDRESS; 230 | #else 231 | return machineContext->__ss.__lr; 232 | #endif 233 | } 234 | 235 | uintptr_t lxd_mach_framePointer(_STRUCT_MCONTEXT * const machineContext) { 236 | return machineContext->__ss.LXD_FRAME_POINTER; 237 | } 238 | 239 | uintptr_t lxd_mach_instructionAddress(_STRUCT_MCONTEXT * const machineContext) { 240 | return machineContext->__ss.LXD_INSTRUCTION_ADDRESS; 241 | } 242 | 243 | kern_return_t lxd_mach_copyMem(const void * src, const void * dst, const size_t numBytes) { 244 | vm_size_t bytesCopied = 0; 245 | return vm_read_overwrite(mach_task_self(), (vm_address_t)src, (vm_size_t)numBytes, (vm_address_t)dst, &bytesCopied); 246 | } 247 | 248 | 249 | #pragma mark - handle symbolicate 250 | void lxd_symbolicate(const uintptr_t * const backtraceBuffer, Dl_info * const symbolsBuffer, const int numEntries, const int skippedEntries) { 251 | int idx = 0; 252 | if (!skippedEntries && idx < numEntries) { 253 | lxd_dladdr(backtraceBuffer[idx], &symbolsBuffer[idx]); 254 | idx++; 255 | } 256 | 257 | for (; idx < numEntries; idx++) { 258 | lxd_dladdr(CALL_INSTRUCTION_FROM_RETURN_ADDRESS(backtraceBuffer[idx]), &symbolsBuffer[idx]); 259 | } 260 | } 261 | 262 | bool lxd_dladdr(const uintptr_t address, Dl_info * const info) { 263 | info->dli_fname = NULL; 264 | info->dli_fbase = NULL; 265 | info->dli_sname = NULL; 266 | info->dli_saddr = NULL; 267 | 268 | const uint32_t idx = lxd_imageIndexContainingAddress(address); 269 | if (idx == UINT_MAX) { return false; } 270 | 271 | const struct mach_header * header = _dyld_get_image_header(idx); 272 | const uintptr_t imageVMAddressSlide = (uintptr_t)_dyld_get_image_vmaddr_slide(idx); 273 | const uintptr_t addressWithSlide = address - imageVMAddressSlide; 274 | const uintptr_t segmentBase = lxd_segmentBaseOfImageIndex(idx) + imageVMAddressSlide; 275 | if (segmentBase == FAILED_UINT_PTR_ADDRESS) { return false; } 276 | 277 | info->dli_fbase = (void *)header; 278 | info->dli_fname = _dyld_get_image_name(idx); 279 | 280 | const LXD_NLIST * bestMatch = NULL; 281 | uintptr_t bestDistance = ULONG_MAX; 282 | uintptr_t cmdPtr = lxd_firstCmdAfterHeader(header); 283 | if (cmdPtr == FAILED_UINT_PTR_ADDRESS) { return false; } 284 | 285 | for (uint32_t iCmd = 0; iCmd < header->ncmds; iCmd++) { 286 | const struct load_command * loadCmd = (struct load_command *)cmdPtr; 287 | if (loadCmd->cmd == LC_SYMTAB) { 288 | const struct symtab_command * symtabCmd = (struct symtab_command *)cmdPtr; 289 | const LXD_NLIST * symbolTable = (LXD_NLIST *)(segmentBase + symtabCmd->symoff); 290 | const uintptr_t stringTable = segmentBase + symtabCmd->stroff; 291 | 292 | for (uint32_t iSym = 0; iSym < symtabCmd->nsyms; iSym++) { 293 | if (symbolTable[iSym].n_value == FAILED_UINT_PTR_ADDRESS) { continue; } 294 | uintptr_t symbolBase = symbolTable[iSym].n_value; 295 | uintptr_t currentDistance = addressWithSlide - symbolBase; 296 | if ( (addressWithSlide >= symbolBase && currentDistance <= bestDistance) ) { 297 | bestMatch = symbolTable + iSym; 298 | bestDistance = currentDistance; 299 | } 300 | } 301 | if (bestMatch != NULL) { 302 | info->dli_saddr = (void *)(bestMatch->n_value + imageVMAddressSlide); 303 | info->dli_sname = (char *)((intptr_t)stringTable + (intptr_t)bestMatch->n_un.n_strx); 304 | if (*info->dli_sname == '_') { 305 | info->dli_sname++; 306 | } 307 | if (info->dli_saddr == info->dli_fbase && bestMatch->n_type == 3) { 308 | info->dli_sname = NULL; 309 | } 310 | break; 311 | } 312 | } 313 | cmdPtr += loadCmd->cmdsize; 314 | } 315 | return true; 316 | } 317 | 318 | uintptr_t lxd_firstCmdAfterHeader(const struct mach_header * const header) { 319 | switch (header->magic) { 320 | case MH_MAGIC: 321 | case MH_CIGAM: 322 | return (uintptr_t)(header + 1); 323 | case MH_MAGIC_64: 324 | case MH_CIGAM_64: 325 | return (uintptr_t)(((struct mach_header_64*)header) + 1); 326 | default: 327 | return 0; 328 | } 329 | } 330 | 331 | uintptr_t lxd_segmentBaseOfImageIndex(const uint32_t idx) { 332 | const struct mach_header * header = _dyld_get_image_header(idx); 333 | 334 | uintptr_t cmdPtr = lxd_firstCmdAfterHeader(header); 335 | if (cmdPtr == FAILED_UINT_PTR_ADDRESS) { return FAILED_UINT_PTR_ADDRESS; } 336 | for (uint32_t idx = 0; idx < header->ncmds; idx++) { 337 | const struct load_command * loadCmd = (struct load_command *)cmdPtr; 338 | if (loadCmd->cmd == LC_SEGMENT) { 339 | const struct segment_command * segCmd = (struct segment_command *)cmdPtr; 340 | if (strcmp(segCmd->segname, SEG_LINKEDIT) == 0) { 341 | return segCmd->vmaddr - segCmd->fileoff; 342 | } 343 | } else if (loadCmd->cmd == LC_SEGMENT_64) { 344 | const struct segment_command_64 * segCmd = (struct segment_command_64 *)cmdPtr; 345 | if (strcmp(segCmd->segname, SEG_LINKEDIT) == 0) { 346 | return segCmd->vmaddr - segCmd->fileoff; 347 | } 348 | } 349 | cmdPtr += loadCmd->cmdsize; 350 | } 351 | return FAILED_UINT_PTR_ADDRESS; 352 | } 353 | 354 | uint32_t lxd_imageIndexContainingAddress(const uintptr_t address) { 355 | const uint32_t imageCount = _dyld_image_count(); 356 | const struct mach_header * header = FAILED_UINT_PTR_ADDRESS; 357 | 358 | for (uint32_t iImg = 0; iImg < imageCount; iImg++) { 359 | header = _dyld_get_image_header(iImg); 360 | if (header != NULL) { 361 | uintptr_t addressWSlide = address - (uintptr_t)_dyld_get_image_vmaddr_slide(iImg); 362 | uintptr_t cmdPtr = lxd_firstCmdAfterHeader(header); 363 | if (cmdPtr == FAILED_UINT_PTR_ADDRESS) { continue; } 364 | 365 | for (uint32_t iCmd = 0; iCmd < header->ncmds; iCmd++) { 366 | const struct load_command * loadCmd = (struct load_command *)cmdPtr; 367 | if (loadCmd->cmd == LC_SEGMENT) { 368 | const struct segment_command * segCmd = (struct segment_command *)cmdPtr; 369 | if (addressWSlide >= segCmd->vmaddr && 370 | addressWSlide < segCmd->vmaddr + segCmd->vmsize) { 371 | return iImg; 372 | } 373 | } else if (loadCmd->cmd == LC_SEGMENT_64) { 374 | const struct segment_command_64 * segCmd = (struct segment_command_64 *)cmdPtr; 375 | if (addressWSlide >= segCmd->vmaddr && 376 | addressWSlide < segCmd->vmaddr + segCmd->vmsize) { 377 | return iImg; 378 | } 379 | } 380 | cmdPtr += loadCmd->cmdsize; 381 | } 382 | } 383 | } 384 | return UINT_MAX; 385 | } 386 | 387 | 388 | #pragma mark - generate backtrace entry 389 | const char * lxd_lastPathEntry(const char * const path) { 390 | if (path == NULL) { return NULL; } 391 | char * lastFile = strrchr(path, '/'); 392 | return lastFile == NULL ? path: lastFile + 1; 393 | } 394 | 395 | NSString * lxd_logBacktraceEntry(const int entryNum, const uintptr_t address, const Dl_info * const dlInfo) { 396 | char faddrBuffer[20]; 397 | char saddrBuffer[20]; 398 | 399 | const char * fname = lxd_lastPathEntry(dlInfo->dli_fname); 400 | if (fname == NULL) { 401 | sprintf(faddrBuffer, POINTER_FMT, (uintptr_t)dlInfo->dli_fbase); 402 | fname = faddrBuffer; 403 | } 404 | 405 | uintptr_t offset = address - (uintptr_t)dlInfo->dli_saddr; 406 | const char * sname = dlInfo->dli_sname; 407 | if (sname == NULL) { 408 | sprintf(saddrBuffer, POINTER_SHORT_FMT, (uintptr_t)dlInfo->dli_fbase); 409 | sname = saddrBuffer; 410 | offset = address - (uintptr_t)dlInfo->dli_fbase; 411 | } 412 | return [NSString stringWithFormat: @"%-30s 0x%08" PRIxPTR " %s + %lu\n", fname, (uintptr_t)address, sname, offset]; 413 | } 414 | 415 | 416 | @end 417 | -------------------------------------------------------------------------------- /LXDAppFluecyMonitor/LXDAppFluecyMonitor/LXDAppFluecyMonitor.h: -------------------------------------------------------------------------------- 1 | // 2 | // LXDAppFluecyMonitor.h 3 | // LXDAppFluecyMonitor 4 | // 5 | // Created by linxinda on 2017/3/22. 6 | // Copyright © 2017年 Jolimark. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | #define SHAREDMONITOR [LXDAppFluecyMonitor sharedMonitor] 13 | 14 | 15 | /*! 16 | * @brief 监听UI线程卡顿 17 | */ 18 | @interface LXDAppFluecyMonitor : NSObject 19 | 20 | + (instancetype)sharedMonitor; 21 | 22 | - (void)startMonitoring; 23 | - (void)stopMonitoring; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /LXDAppFluecyMonitor/LXDAppFluecyMonitor/LXDAppFluecyMonitor.m: -------------------------------------------------------------------------------- 1 | // 2 | // LXDAppFluecyMonitor.m 3 | // LXDAppFluecyMonitor 4 | // 5 | // Created by linxinda on 2017/3/22. 6 | // Copyright © 2017年 Jolimark. All rights reserved. 7 | // 8 | 9 | #import "LXDAppFluecyMonitor.h" 10 | #import "LXDBacktraceLogger.h" 11 | 12 | 13 | #define LXD_DEPRECATED_POLLUTE_MAIN_QUEUE 14 | 15 | 16 | @interface LXDAppFluecyMonitor () 17 | 18 | @property (nonatomic, assign) int timeOut; 19 | @property (nonatomic, assign) BOOL isMonitoring; 20 | 21 | @property (nonatomic, assign) CFRunLoopObserverRef observer; 22 | @property (nonatomic, assign) CFRunLoopActivity currentActivity; 23 | 24 | @property (nonatomic, strong) dispatch_semaphore_t semphore; 25 | @property (nonatomic, strong) dispatch_semaphore_t eventSemphore; 26 | 27 | @end 28 | 29 | 30 | #define LXD_SEMPHORE_SUCCESS 0 31 | static NSTimeInterval lxd_restore_interval = 5; 32 | static NSTimeInterval lxd_time_out_interval = 1; 33 | static int64_t lxd_wait_interval = 200 * NSEC_PER_MSEC; 34 | 35 | 36 | /*! 37 | * @brief 监听runloop状态为before waiting状态下是否卡顿 38 | */ 39 | static inline dispatch_queue_t lxd_event_monitor_queue() { 40 | static dispatch_queue_t lxd_event_monitor_queue; 41 | static dispatch_once_t once; 42 | dispatch_once(&once, ^{ 43 | lxd_event_monitor_queue = dispatch_queue_create("com.sindrilin.lxd_event_monitor_queue", NULL); 44 | }); 45 | return lxd_event_monitor_queue; 46 | } 47 | 48 | /*! 49 | * @brief 监听runloop状态在after waiting和before sources之间 50 | */ 51 | static inline dispatch_queue_t lxd_fluecy_monitor_queue() { 52 | static dispatch_queue_t lxd_fluecy_monitor_queue; 53 | static dispatch_once_t once; 54 | dispatch_once(&once, ^{ 55 | lxd_fluecy_monitor_queue = dispatch_queue_create("com.sindrilin.lxd_monitor_queue", NULL); 56 | }); 57 | return lxd_fluecy_monitor_queue; 58 | } 59 | 60 | #define LOG_RUNLOOP_ACTIVITY 0 61 | static void lxdRunLoopObserverCallback(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void * info) { 62 | SHAREDMONITOR.currentActivity = activity; 63 | dispatch_semaphore_signal(SHAREDMONITOR.semphore); 64 | #if LOG_RUNLOOP_ACTIVITY 65 | switch (activity) { 66 | case kCFRunLoopEntry: 67 | NSLog(@"runloop entry"); 68 | break; 69 | 70 | case kCFRunLoopExit: 71 | NSLog(@"runloop exit"); 72 | break; 73 | 74 | case kCFRunLoopAfterWaiting: 75 | NSLog(@"runloop after waiting"); 76 | break; 77 | 78 | case kCFRunLoopBeforeTimers: 79 | NSLog(@"runloop before timers"); 80 | break; 81 | 82 | case kCFRunLoopBeforeSources: 83 | NSLog(@"runloop before sources"); 84 | break; 85 | 86 | case kCFRunLoopBeforeWaiting: 87 | NSLog(@"runloop before waiting"); 88 | break; 89 | 90 | default: 91 | break; 92 | } 93 | #endif 94 | }; 95 | 96 | 97 | 98 | 99 | @implementation LXDAppFluecyMonitor 100 | 101 | 102 | #pragma mark - Singleton override 103 | + (instancetype)sharedMonitor { 104 | static LXDAppFluecyMonitor * sharedMonitor; 105 | static dispatch_once_t once; 106 | dispatch_once(&once, ^{ 107 | sharedMonitor = [[super allocWithZone: NSDefaultMallocZone()] init]; 108 | [sharedMonitor commonInit]; 109 | }); 110 | return sharedMonitor; 111 | } 112 | 113 | + (instancetype)allocWithZone: (struct _NSZone *)zone { 114 | return [self sharedMonitor]; 115 | } 116 | 117 | - (void)dealloc { 118 | [self stopMonitoring]; 119 | } 120 | 121 | - (void)commonInit { 122 | self.semphore = dispatch_semaphore_create(0); 123 | self.eventSemphore = dispatch_semaphore_create(0); 124 | } 125 | 126 | 127 | #pragma mark - Public 128 | - (void)startMonitoring { 129 | if (_isMonitoring) { return; } 130 | _isMonitoring = YES; 131 | CFRunLoopObserverContext context = { 132 | 0, 133 | (__bridge void *)self, 134 | NULL, 135 | NULL 136 | }; 137 | _observer = CFRunLoopObserverCreate(kCFAllocatorDefault, kCFRunLoopAllActivities, YES, 0, &lxdRunLoopObserverCallback, &context); 138 | CFRunLoopAddObserver(CFRunLoopGetMain(), _observer, kCFRunLoopCommonModes); 139 | 140 | dispatch_async(lxd_event_monitor_queue(), ^{ 141 | while (SHAREDMONITOR.isMonitoring) { 142 | if (SHAREDMONITOR.currentActivity == kCFRunLoopBeforeWaiting) { 143 | __block BOOL timeOut = YES; 144 | dispatch_async(dispatch_get_main_queue(), ^{ 145 | timeOut = NO; 146 | dispatch_semaphore_signal(SHAREDMONITOR.eventSemphore); 147 | }); 148 | [NSThread sleepForTimeInterval: lxd_time_out_interval]; 149 | if (timeOut) { 150 | [LXDBacktraceLogger lxd_logMain]; 151 | } 152 | dispatch_wait(SHAREDMONITOR.eventSemphore, DISPATCH_TIME_FOREVER); 153 | } 154 | } 155 | }); 156 | 157 | dispatch_async(lxd_fluecy_monitor_queue(), ^{ 158 | while (SHAREDMONITOR.isMonitoring) { 159 | long waitTime = dispatch_semaphore_wait(self.semphore, dispatch_time(DISPATCH_TIME_NOW, lxd_wait_interval)); 160 | if (waitTime != LXD_SEMPHORE_SUCCESS) { 161 | if (!SHAREDMONITOR.observer) { 162 | SHAREDMONITOR.timeOut = 0; 163 | [SHAREDMONITOR stopMonitoring]; 164 | continue; 165 | } 166 | if (SHAREDMONITOR.currentActivity == kCFRunLoopBeforeSources || SHAREDMONITOR.currentActivity == kCFRunLoopAfterWaiting) { 167 | if (++SHAREDMONITOR.timeOut < 5) { 168 | continue; 169 | } 170 | [LXDBacktraceLogger lxd_logMain]; 171 | [NSThread sleepForTimeInterval: lxd_restore_interval]; 172 | } 173 | } 174 | SHAREDMONITOR.timeOut = 0; 175 | } 176 | }); 177 | } 178 | 179 | - (void)stopMonitoring { 180 | if (!_isMonitoring) { return; } 181 | _isMonitoring = NO; 182 | 183 | CFRunLoopRemoveObserver(CFRunLoopGetMain(), _observer, kCFRunLoopCommonModes); 184 | CFRelease(_observer); 185 | _observer = nil; 186 | } 187 | 188 | 189 | @end 190 | -------------------------------------------------------------------------------- /LXDAppFluecyMonitor/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // LXDAppFluecyMonitor 4 | // 5 | // Created by linxinda on 2017/3/22. 6 | // Copyright © 2017年 Jolimark. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /LXDAppFluecyMonitor/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // LXDAppFluecyMonitor 4 | // 5 | // Created by linxinda on 2017/3/22. 6 | // Copyright © 2017年 Jolimark. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "LXDBacktraceLogger.h" 11 | #import "LXDAppFluecyMonitor.h" 12 | 13 | 14 | @interface ViewController () 15 | 16 | @property (weak, nonatomic) IBOutlet UITableView *tableView; 17 | 18 | @end 19 | 20 | @implementation ViewController 21 | 22 | 23 | - (void)viewDidLoad { 24 | [super viewDidLoad]; 25 | [[LXDAppFluecyMonitor sharedMonitor] startMonitoring]; 26 | [self.tableView registerClass: [UITableViewCell class] forCellReuseIdentifier: @"cell"]; 27 | } 28 | 29 | - (void)viewDidAppear: (BOOL)animated { 30 | [super viewDidAppear: animated]; 31 | } 32 | 33 | 34 | #pragma mark - UITableViewDataSource 35 | - (NSInteger)tableView: (UITableView *)tableView numberOfRowsInSection: (NSInteger)section { 36 | return 1000; 37 | } 38 | 39 | - (UITableViewCell *)tableView: (UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath { 40 | UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier: @"cell"]; 41 | cell.textLabel.text = [NSString stringWithFormat: @"%lu", indexPath.row]; 42 | if (indexPath.row > 0 && indexPath.row % 30 == 0) { 43 | usleep(2000000); 44 | } 45 | return cell; 46 | } 47 | 48 | 49 | #pragma mark - UITableViewDelegate 50 | - (void)tableView: (UITableView *)tableView didSelectRowAtIndexPath: (NSIndexPath *)indexPath { 51 | for (int idx = 0; idx < 100; idx++) { 52 | // usleep(10000); 53 | } 54 | } 55 | 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /LXDAppFluecyMonitor/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // LXDAppFluecyMonitor 4 | // 5 | // Created by linxinda on 2017/3/22. 6 | // Copyright © 2017年 Jolimark. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /LXDAppFluecyMonitorTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /LXDAppFluecyMonitorTests/LXDAppFluecyMonitorTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // LXDAppFluecyMonitorTests.m 3 | // LXDAppFluecyMonitorTests 4 | // 5 | // Created by linxinda on 2017/3/22. 6 | // Copyright © 2017年 Jolimark. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LXDAppFluecyMonitorTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation LXDAppFluecyMonitorTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /LXDAppFluecyMonitorUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /LXDAppFluecyMonitorUITests/LXDAppFluecyMonitorUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // LXDAppFluecyMonitorUITests.m 3 | // LXDAppFluecyMonitorUITests 4 | // 5 | // Created by linxinda on 2017/3/22. 6 | // Copyright © 2017年 Jolimark. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LXDAppFluecyMonitorUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation LXDAppFluecyMonitorUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | --------------------------------------------------------------------------------