├── PerformanceMonitor ├── PerformanceMonitor.xcodeproj │ └── project.pbxproj └── PerformanceMonitor │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── CrashReporter.framework │ ├── .svn │ │ ├── entries │ │ ├── format │ │ ├── pristine │ │ │ ├── 13 │ │ │ │ └── 130b8faaf3e1acc1b95f77ac835e9c8b6eee5c96.svn-base │ │ │ ├── 30 │ │ │ │ └── 30f3042d70d9e1f161da0fa1f644960f695cedd0.svn-base │ │ │ ├── 38 │ │ │ │ └── 3888ecd6e323e49e9ec773c53338a20202d1df12.svn-base │ │ │ ├── 58 │ │ │ │ └── 584911b4ebb5d9cd16878581c908fb961ebceada.svn-base │ │ │ ├── 64 │ │ │ │ └── 64ba239b16dd66f2b80c325458adbdab9e24f3bf.svn-base │ │ │ ├── 70 │ │ │ │ └── 70e61adc399b89426dce57acee999d492c428aa2.svn-base │ │ │ ├── 71 │ │ │ │ └── 710191442cab38770c12afc78079514ce2995fd5.svn-base │ │ │ ├── 79 │ │ │ │ ├── 7936fdf63d39af33a60fd4d3dc56b9988493b1f5.svn-base │ │ │ │ └── 7990b3a661e710ded6e807d797438fd2afb1e6e5.svn-base │ │ │ ├── 83 │ │ │ │ └── 83f1ef71e4b51512313446364e2db78911330a7c.svn-base │ │ │ ├── 2c │ │ │ │ └── 2c31afc6c7a1f2d4b9f1d0974832ecf6c975c6c8.svn-base │ │ │ ├── 2d │ │ │ │ └── 2d94990d347f675868fad07016fe62f890b594a4.svn-base │ │ │ ├── 3f │ │ │ │ └── 3fd56abbf289ddc99caacd1f55cc508e71649f30.svn-base │ │ │ ├── 5c │ │ │ │ └── 5c063000cebed60ea3fadd0527a1cf130c1d9f4f.svn-base │ │ │ ├── 7e │ │ │ │ └── 7efdf8ddc11e92802ff54a3fd0ce448c0440f583.svn-base │ │ │ ├── 7f │ │ │ │ └── 7fabe16d3b1be90b8b52d56b7104d21e7fab0a1d.svn-base │ │ │ ├── 8d │ │ │ │ └── 8d448e33c67a62f13eea2c97c7b911371eaa988d.svn-base │ │ │ ├── 8e │ │ │ │ └── 8e5ee09ed62de2426359c337bb64575bb4005907.svn-base │ │ │ ├── a1 │ │ │ │ └── a1290f8354de21ee76c0fa940c895ac046bff886.svn-base │ │ │ ├── b1 │ │ │ │ └── b11d8240b08319779228758644b7d3fb84d58c4b.svn-base │ │ │ ├── b4 │ │ │ │ └── b4beb99c252244c0b9c365ad0c81674f2cf8f90f.svn-base │ │ │ ├── c1 │ │ │ │ └── c14937ab645201e1df23aa0bc20b04e53ac9b041.svn-base │ │ │ ├── c3 │ │ │ │ └── c3d76c81284e10ccb1ecb091ef0311f2af5acccb.svn-base │ │ │ ├── cb │ │ │ │ └── cbd2bd911f2c9f28f0408b5e5b2d68f3acf91e42.svn-base │ │ │ ├── ce │ │ │ │ └── ce71abb0d508b36f9ed0b197fc19ec2f3df3bd8f.svn-base │ │ │ ├── cf │ │ │ │ └── cfce5d4fbb9855b5ff4574f0dd08c8a9155d51d2.svn-base │ │ │ ├── d5 │ │ │ │ └── d5a2941b8f66c2be5ef4a037d76fa936c22306c0.svn-base │ │ │ ├── e3 │ │ │ │ └── e36a353a48fcf6bf90beb5c372dd2f2e6e16388c.svn-base │ │ │ └── f3 │ │ │ │ └── f3bd95bae40f8d8cd6e816dd6ff6fc524e8166f5.svn-base │ │ └── wc.db │ ├── CrashReporter │ ├── Headers │ ├── Resources │ └── Versions │ │ ├── A │ │ ├── CrashReporter │ │ ├── Headers │ │ │ ├── CrashReporter.h │ │ │ ├── PLCrashAsyncSignalInfo.h │ │ │ ├── PLCrashFeatureConfig.h │ │ │ ├── PLCrashMacros.h │ │ │ ├── PLCrashNamespace.h │ │ │ ├── PLCrashReport.h │ │ │ ├── PLCrashReportApplicationInfo.h │ │ │ ├── PLCrashReportBinaryImageInfo.h │ │ │ ├── PLCrashReportExceptionInfo.h │ │ │ ├── PLCrashReportFormatter.h │ │ │ ├── PLCrashReportMachExceptionInfo.h │ │ │ ├── PLCrashReportMachineInfo.h │ │ │ ├── PLCrashReportProcessInfo.h │ │ │ ├── PLCrashReportProcessorInfo.h │ │ │ ├── PLCrashReportRegisterInfo.h │ │ │ ├── PLCrashReportSignalInfo.h │ │ │ ├── PLCrashReportStackFrameInfo.h │ │ │ ├── PLCrashReportSymbolInfo.h │ │ │ ├── PLCrashReportSystemInfo.h │ │ │ ├── PLCrashReportTextFormatter.h │ │ │ ├── PLCrashReportThreadInfo.h │ │ │ ├── PLCrashReporter.h │ │ │ └── PLCrashReporterConfig.h │ │ └── Resources │ │ │ └── Info.plist │ │ └── Current │ ├── Info.plist │ ├── PerformanceMonitor.h │ ├── PerformanceMonitor.m │ ├── ViewController.h │ ├── ViewController.m │ └── main.m └── README.md /PerformanceMonitor/PerformanceMonitor.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | B8B10FA21BF5E02300447088 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B8B10FA11BF5E02300447088 /* main.m */; }; 11 | B8B10FA51BF5E02300447088 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B8B10FA41BF5E02300447088 /* AppDelegate.m */; }; 12 | B8B10FA81BF5E02300447088 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B8B10FA71BF5E02300447088 /* ViewController.m */; }; 13 | B8B10FAB1BF5E02400447088 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B8B10FA91BF5E02400447088 /* Main.storyboard */; }; 14 | B8B10FAD1BF5E02400447088 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B8B10FAC1BF5E02400447088 /* Assets.xcassets */; }; 15 | B8B10FB01BF5E02400447088 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B8B10FAE1BF5E02400447088 /* LaunchScreen.storyboard */; }; 16 | B8B10FB81BF5E05200447088 /* CrashReporter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B8B10FB71BF5E05200447088 /* CrashReporter.framework */; }; 17 | B8B10FBB1BF5E0BE00447088 /* PerformanceMonitor.m in Sources */ = {isa = PBXBuildFile; fileRef = B8B10FBA1BF5E0BE00447088 /* PerformanceMonitor.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | B8B10F9D1BF5E02300447088 /* PerformanceMonitor.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PerformanceMonitor.app; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | B8B10FA11BF5E02300447088 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 23 | B8B10FA31BF5E02300447088 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 24 | B8B10FA41BF5E02300447088 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 25 | B8B10FA61BF5E02300447088 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 26 | B8B10FA71BF5E02300447088 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 27 | B8B10FAA1BF5E02400447088 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 28 | B8B10FAC1BF5E02400447088 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 29 | B8B10FAF1BF5E02400447088 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 30 | B8B10FB11BF5E02400447088 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | B8B10FB71BF5E05200447088 /* CrashReporter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CrashReporter.framework; sourceTree = ""; }; 32 | B8B10FB91BF5E0BE00447088 /* PerformanceMonitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceMonitor.h; sourceTree = ""; }; 33 | B8B10FBA1BF5E0BE00447088 /* PerformanceMonitor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PerformanceMonitor.m; sourceTree = ""; }; 34 | /* End PBXFileReference section */ 35 | 36 | /* Begin PBXFrameworksBuildPhase section */ 37 | B8B10F9A1BF5E02300447088 /* Frameworks */ = { 38 | isa = PBXFrameworksBuildPhase; 39 | buildActionMask = 2147483647; 40 | files = ( 41 | B8B10FB81BF5E05200447088 /* CrashReporter.framework in Frameworks */, 42 | ); 43 | runOnlyForDeploymentPostprocessing = 0; 44 | }; 45 | /* End PBXFrameworksBuildPhase section */ 46 | 47 | /* Begin PBXGroup section */ 48 | B8B10F941BF5E02300447088 = { 49 | isa = PBXGroup; 50 | children = ( 51 | B8B10F9F1BF5E02300447088 /* PerformanceMonitor */, 52 | B8B10F9E1BF5E02300447088 /* Products */, 53 | ); 54 | sourceTree = ""; 55 | }; 56 | B8B10F9E1BF5E02300447088 /* Products */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | B8B10F9D1BF5E02300447088 /* PerformanceMonitor.app */, 60 | ); 61 | name = Products; 62 | sourceTree = ""; 63 | }; 64 | B8B10F9F1BF5E02300447088 /* PerformanceMonitor */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | B8B10FB71BF5E05200447088 /* CrashReporter.framework */, 68 | B8B10FA31BF5E02300447088 /* AppDelegate.h */, 69 | B8B10FA41BF5E02300447088 /* AppDelegate.m */, 70 | B8B10FA61BF5E02300447088 /* ViewController.h */, 71 | B8B10FA71BF5E02300447088 /* ViewController.m */, 72 | B8B10FB91BF5E0BE00447088 /* PerformanceMonitor.h */, 73 | B8B10FBA1BF5E0BE00447088 /* PerformanceMonitor.m */, 74 | B8B10FA91BF5E02400447088 /* Main.storyboard */, 75 | B8B10FAC1BF5E02400447088 /* Assets.xcassets */, 76 | B8B10FAE1BF5E02400447088 /* LaunchScreen.storyboard */, 77 | B8B10FB11BF5E02400447088 /* Info.plist */, 78 | B8B10FA01BF5E02300447088 /* Supporting Files */, 79 | ); 80 | path = PerformanceMonitor; 81 | sourceTree = ""; 82 | }; 83 | B8B10FA01BF5E02300447088 /* Supporting Files */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | B8B10FA11BF5E02300447088 /* main.m */, 87 | ); 88 | name = "Supporting Files"; 89 | sourceTree = ""; 90 | }; 91 | /* End PBXGroup section */ 92 | 93 | /* Begin PBXNativeTarget section */ 94 | B8B10F9C1BF5E02300447088 /* PerformanceMonitor */ = { 95 | isa = PBXNativeTarget; 96 | buildConfigurationList = B8B10FB41BF5E02400447088 /* Build configuration list for PBXNativeTarget "PerformanceMonitor" */; 97 | buildPhases = ( 98 | B8B10F991BF5E02300447088 /* Sources */, 99 | B8B10F9A1BF5E02300447088 /* Frameworks */, 100 | B8B10F9B1BF5E02300447088 /* Resources */, 101 | ); 102 | buildRules = ( 103 | ); 104 | dependencies = ( 105 | ); 106 | name = PerformanceMonitor; 107 | productName = PerformanceMonitor; 108 | productReference = B8B10F9D1BF5E02300447088 /* PerformanceMonitor.app */; 109 | productType = "com.apple.product-type.application"; 110 | }; 111 | /* End PBXNativeTarget section */ 112 | 113 | /* Begin PBXProject section */ 114 | B8B10F951BF5E02300447088 /* Project object */ = { 115 | isa = PBXProject; 116 | attributes = { 117 | LastUpgradeCheck = 0710; 118 | ORGANIZATIONNAME = Tencent; 119 | TargetAttributes = { 120 | B8B10F9C1BF5E02300447088 = { 121 | CreatedOnToolsVersion = 7.1; 122 | }; 123 | }; 124 | }; 125 | buildConfigurationList = B8B10F981BF5E02300447088 /* Build configuration list for PBXProject "PerformanceMonitor" */; 126 | compatibilityVersion = "Xcode 3.2"; 127 | developmentRegion = English; 128 | hasScannedForEncodings = 0; 129 | knownRegions = ( 130 | en, 131 | Base, 132 | ); 133 | mainGroup = B8B10F941BF5E02300447088; 134 | productRefGroup = B8B10F9E1BF5E02300447088 /* Products */; 135 | projectDirPath = ""; 136 | projectRoot = ""; 137 | targets = ( 138 | B8B10F9C1BF5E02300447088 /* PerformanceMonitor */, 139 | ); 140 | }; 141 | /* End PBXProject section */ 142 | 143 | /* Begin PBXResourcesBuildPhase section */ 144 | B8B10F9B1BF5E02300447088 /* Resources */ = { 145 | isa = PBXResourcesBuildPhase; 146 | buildActionMask = 2147483647; 147 | files = ( 148 | B8B10FB01BF5E02400447088 /* LaunchScreen.storyboard in Resources */, 149 | B8B10FAD1BF5E02400447088 /* Assets.xcassets in Resources */, 150 | B8B10FAB1BF5E02400447088 /* Main.storyboard in Resources */, 151 | ); 152 | runOnlyForDeploymentPostprocessing = 0; 153 | }; 154 | /* End PBXResourcesBuildPhase section */ 155 | 156 | /* Begin PBXSourcesBuildPhase section */ 157 | B8B10F991BF5E02300447088 /* Sources */ = { 158 | isa = PBXSourcesBuildPhase; 159 | buildActionMask = 2147483647; 160 | files = ( 161 | B8B10FA81BF5E02300447088 /* ViewController.m in Sources */, 162 | B8B10FBB1BF5E0BE00447088 /* PerformanceMonitor.m in Sources */, 163 | B8B10FA51BF5E02300447088 /* AppDelegate.m in Sources */, 164 | B8B10FA21BF5E02300447088 /* main.m in Sources */, 165 | ); 166 | runOnlyForDeploymentPostprocessing = 0; 167 | }; 168 | /* End PBXSourcesBuildPhase section */ 169 | 170 | /* Begin PBXVariantGroup section */ 171 | B8B10FA91BF5E02400447088 /* Main.storyboard */ = { 172 | isa = PBXVariantGroup; 173 | children = ( 174 | B8B10FAA1BF5E02400447088 /* Base */, 175 | ); 176 | name = Main.storyboard; 177 | sourceTree = ""; 178 | }; 179 | B8B10FAE1BF5E02400447088 /* LaunchScreen.storyboard */ = { 180 | isa = PBXVariantGroup; 181 | children = ( 182 | B8B10FAF1BF5E02400447088 /* Base */, 183 | ); 184 | name = LaunchScreen.storyboard; 185 | sourceTree = ""; 186 | }; 187 | /* End PBXVariantGroup section */ 188 | 189 | /* Begin XCBuildConfiguration section */ 190 | B8B10FB21BF5E02400447088 /* Debug */ = { 191 | isa = XCBuildConfiguration; 192 | buildSettings = { 193 | ALWAYS_SEARCH_USER_PATHS = NO; 194 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 195 | CLANG_CXX_LIBRARY = "libc++"; 196 | CLANG_ENABLE_MODULES = YES; 197 | CLANG_ENABLE_OBJC_ARC = YES; 198 | CLANG_WARN_BOOL_CONVERSION = YES; 199 | CLANG_WARN_CONSTANT_CONVERSION = YES; 200 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 201 | CLANG_WARN_EMPTY_BODY = YES; 202 | CLANG_WARN_ENUM_CONVERSION = YES; 203 | CLANG_WARN_INT_CONVERSION = YES; 204 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 205 | CLANG_WARN_UNREACHABLE_CODE = YES; 206 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 207 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 208 | COPY_PHASE_STRIP = NO; 209 | DEBUG_INFORMATION_FORMAT = dwarf; 210 | ENABLE_STRICT_OBJC_MSGSEND = YES; 211 | ENABLE_TESTABILITY = YES; 212 | GCC_C_LANGUAGE_STANDARD = gnu99; 213 | GCC_DYNAMIC_NO_PIC = NO; 214 | GCC_NO_COMMON_BLOCKS = YES; 215 | GCC_OPTIMIZATION_LEVEL = 0; 216 | GCC_PREPROCESSOR_DEFINITIONS = ( 217 | "DEBUG=1", 218 | "$(inherited)", 219 | ); 220 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 221 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 222 | GCC_WARN_UNDECLARED_SELECTOR = YES; 223 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 224 | GCC_WARN_UNUSED_FUNCTION = YES; 225 | GCC_WARN_UNUSED_VARIABLE = YES; 226 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 227 | MTL_ENABLE_DEBUG_INFO = YES; 228 | ONLY_ACTIVE_ARCH = YES; 229 | SDKROOT = iphoneos; 230 | }; 231 | name = Debug; 232 | }; 233 | B8B10FB31BF5E02400447088 /* Release */ = { 234 | isa = XCBuildConfiguration; 235 | buildSettings = { 236 | ALWAYS_SEARCH_USER_PATHS = NO; 237 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 238 | CLANG_CXX_LIBRARY = "libc++"; 239 | CLANG_ENABLE_MODULES = YES; 240 | CLANG_ENABLE_OBJC_ARC = YES; 241 | CLANG_WARN_BOOL_CONVERSION = YES; 242 | CLANG_WARN_CONSTANT_CONVERSION = YES; 243 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 244 | CLANG_WARN_EMPTY_BODY = YES; 245 | CLANG_WARN_ENUM_CONVERSION = YES; 246 | CLANG_WARN_INT_CONVERSION = YES; 247 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 248 | CLANG_WARN_UNREACHABLE_CODE = YES; 249 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 250 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 251 | COPY_PHASE_STRIP = NO; 252 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 253 | ENABLE_NS_ASSERTIONS = NO; 254 | ENABLE_STRICT_OBJC_MSGSEND = YES; 255 | GCC_C_LANGUAGE_STANDARD = gnu99; 256 | GCC_NO_COMMON_BLOCKS = YES; 257 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 258 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 259 | GCC_WARN_UNDECLARED_SELECTOR = YES; 260 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 261 | GCC_WARN_UNUSED_FUNCTION = YES; 262 | GCC_WARN_UNUSED_VARIABLE = YES; 263 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 264 | MTL_ENABLE_DEBUG_INFO = NO; 265 | SDKROOT = iphoneos; 266 | VALIDATE_PRODUCT = YES; 267 | }; 268 | name = Release; 269 | }; 270 | B8B10FB51BF5E02400447088 /* Debug */ = { 271 | isa = XCBuildConfiguration; 272 | buildSettings = { 273 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 274 | CODE_SIGN_IDENTITY = "iPhone Developer"; 275 | FRAMEWORK_SEARCH_PATHS = ( 276 | "$(inherited)", 277 | "$(PROJECT_DIR)/PerformanceMonitor", 278 | ); 279 | INFOPLIST_FILE = PerformanceMonitor/Info.plist; 280 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 281 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 282 | PRODUCT_BUNDLE_IDENTIFIER = com.tencent.PerformanceMonitor; 283 | PRODUCT_NAME = "$(TARGET_NAME)"; 284 | }; 285 | name = Debug; 286 | }; 287 | B8B10FB61BF5E02400447088 /* Release */ = { 288 | isa = XCBuildConfiguration; 289 | buildSettings = { 290 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 291 | CODE_SIGN_IDENTITY = "iPhone Developer"; 292 | FRAMEWORK_SEARCH_PATHS = ( 293 | "$(inherited)", 294 | "$(PROJECT_DIR)/PerformanceMonitor", 295 | ); 296 | INFOPLIST_FILE = PerformanceMonitor/Info.plist; 297 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 298 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 299 | PRODUCT_BUNDLE_IDENTIFIER = com.tencent.PerformanceMonitor; 300 | PRODUCT_NAME = "$(TARGET_NAME)"; 301 | }; 302 | name = Release; 303 | }; 304 | /* End XCBuildConfiguration section */ 305 | 306 | /* Begin XCConfigurationList section */ 307 | B8B10F981BF5E02300447088 /* Build configuration list for PBXProject "PerformanceMonitor" */ = { 308 | isa = XCConfigurationList; 309 | buildConfigurations = ( 310 | B8B10FB21BF5E02400447088 /* Debug */, 311 | B8B10FB31BF5E02400447088 /* Release */, 312 | ); 313 | defaultConfigurationIsVisible = 0; 314 | defaultConfigurationName = Release; 315 | }; 316 | B8B10FB41BF5E02400447088 /* Build configuration list for PBXNativeTarget "PerformanceMonitor" */ = { 317 | isa = XCConfigurationList; 318 | buildConfigurations = ( 319 | B8B10FB51BF5E02400447088 /* Debug */, 320 | B8B10FB61BF5E02400447088 /* Release */, 321 | ); 322 | defaultConfigurationIsVisible = 0; 323 | defaultConfigurationName = Release; 324 | }; 325 | /* End XCConfigurationList section */ 326 | }; 327 | rootObject = B8B10F951BF5E02300447088 /* Project object */; 328 | } 329 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // PerformanceMonitor 4 | // 5 | // Created by tanhao on 15/11/13. 6 | // Copyright © 2015年 Tencent. 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 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // PerformanceMonitor 4 | // 5 | // Created by tanhao on 15/11/13. 6 | // Copyright © 2015年 Tencent. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "PerformanceMonitor.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | 20 | [[PerformanceMonitor sharedInstance] start]; 21 | 22 | return YES; 23 | } 24 | 25 | - (void)applicationWillResignActive:(UIApplication *)application { 26 | // 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. 27 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 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 | - (void)applicationWillEnterForeground:(UIApplication *)application { 36 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 37 | } 38 | 39 | - (void)applicationDidBecomeActive:(UIApplication *)application { 40 | // 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. 41 | } 42 | 43 | - (void)applicationWillTerminate:(UIApplication *)application { 44 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/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 | } -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/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 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/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 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/entries: -------------------------------------------------------------------------------- 1 | 12 2 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/format: -------------------------------------------------------------------------------- 1 | 12 2 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/13/130b8faaf3e1acc1b95f77ac835e9c8b6eee5c96.svn-base: -------------------------------------------------------------------------------- 1 | link A -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/2c/2c31afc6c7a1f2d4b9f1d0974832ecf6c975c6c8.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #ifndef PLCRASH_FEATURE_CONFIG_H 30 | #define PLCRASH_FEATURE_CONFIG_H 31 | 32 | #include 33 | 34 | /** 35 | * @internal 36 | * 37 | * Build-time configuration for PLCrashReporter. 38 | * 39 | * This is used to automatically enable/disable features on a per-platform and per-configuration 40 | * basis; it may also be used by third-party vendors to configure a custom build of PLCrashReporter. 41 | * 42 | * @defgroup build_config Build Configuration 43 | * @ingroup constants 44 | * @{ 45 | */ 46 | 47 | /* 48 | * Defaults 49 | */ 50 | 51 | /* 52 | * For release builds, disable unused unwind implementations on targets that do not use them. For non-release 53 | * builds, we include the unwind implementations to allow testing on a broader range of targets. 54 | */ 55 | #ifdef PLCF_RELEASE_BUILD 56 | # if defined(__arm__) 57 | # ifndef PLCRASH_FEATURE_UNWIND_DWARF 58 | # define PLCRASH_FEATURE_UNWIND_DWARF 0 59 | # endif 60 | # ifndef PLCRASH_FEATURE_UNWIND_COMPACT 61 | # define PLCRASH_FEATURE_UNWIND_COMPACT 0 62 | # endif 63 | # endif 64 | #endif 65 | 66 | /* 67 | * Configuration Flags 68 | */ 69 | 70 | 71 | #ifndef PLCRASH_FEATURE_MACH_EXCEPTIONS 72 | /** 73 | * If true, enable Mach exception support. On Mac OS X, the Mach exception implementation is fully supported, 74 | * using publicly available API. On iOS, the APIs required for a complete implementation are not public. However, a 75 | * popular commercial crash reporter is now shipping with support for Mach exceptions, which implies that either 76 | * they've received special dispensation to use private APIs / private structures, they've found another way to do 77 | * it, or they're just using undocumented functionality and hoping for the best. 78 | * 79 | * The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to 80 | * implement Mach exception handling regardless of concerns over API visiblity. Given this, we've enabled 81 | * Mach exception handling by default, and provided both build-time and runtime configuration 82 | * to disable its use. 83 | * 84 | * For more information on the potential issues with enabling mach exception support, @sa @ref mach_exceptions. 85 | */ 86 | # define PLCRASH_FEATURE_MACH_EXCEPTIONS 1 87 | #endif 88 | 89 | #ifndef PLCRASH_FEATURE_UNWIND_DWARF 90 | /** If true, enable DWARF unwinding support. */ 91 | # define PLCRASH_FEATURE_UNWIND_DWARF 1 92 | #endif 93 | 94 | 95 | #ifndef PLCRASH_FEATURE_UNWIND_COMPACT 96 | /** If true, enable compact unwinding support. */ 97 | # define PLCRASH_FEATURE_UNWIND_COMPACT 1 98 | #endif 99 | 100 | /** 101 | * @} 102 | */ 103 | 104 | #endif /* PLCRASH_FEATURE_CONFIG_H */ 105 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/2d/2d94990d347f675868fad07016fe62f890b594a4.svn-base: -------------------------------------------------------------------------------- 1 | link Versions/Current/CrashReporter -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/30/30f3042d70d9e1f161da0fa1f644960f695cedd0.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | #import "PLCrashReportThreadInfo.h" 31 | 32 | 33 | @interface PLCrashReportExceptionInfo : NSObject { 34 | @private 35 | /** Name */ 36 | NSString *_name; 37 | 38 | /** Reason */ 39 | NSString *_reason; 40 | 41 | /** Ordered list of PLCrashReportStackFrame instances, or nil if unavailable. */ 42 | NSArray *_stackFrames; 43 | } 44 | 45 | - (id) initWithExceptionName: (NSString *) name reason: (NSString *) reason; 46 | 47 | - (id) initWithExceptionName: (NSString *) name 48 | reason: (NSString *) reason 49 | stackFrames: (NSArray *) stackFrames; 50 | 51 | /** 52 | * The exception name. 53 | */ 54 | @property(nonatomic, readonly) NSString *exceptionName; 55 | 56 | /** 57 | * The exception reason. 58 | */ 59 | @property(nonatomic, readonly) NSString *exceptionReason; 60 | 61 | /* The exception's original call stack, as an array of PLCrashReportStackFrameInfo instances, or nil if unavailable. 62 | * This may be preserved across rethrow of an exception, and can be used to determine the original call stack. */ 63 | @property(nonatomic, readonly) NSArray *stackFrames; 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/38/3888ecd6e323e49e9ec773c53338a20202d1df12.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | 31 | @interface PLCrashReportApplicationInfo : NSObject { 32 | @private 33 | /** Application identifier */ 34 | NSString *_applicationIdentifier; 35 | 36 | /** Application version */ 37 | NSString *_applicationVersion; 38 | 39 | /** Application marketing version */ 40 | NSString *_applicationMarketingVersion; 41 | } 42 | 43 | - (id) initWithApplicationIdentifier: (NSString *) applicationIdentifier 44 | applicationVersion: (NSString *) applicationVersion 45 | applicationMarketingVersion: (NSString *) applicationMarketingVersion; 46 | 47 | /** 48 | * The application identifier. This is usually the application's CFBundleIdentifier value. 49 | */ 50 | @property(nonatomic, readonly) NSString *applicationIdentifier; 51 | 52 | /** 53 | * The application version. This is usually the application's CFBundleVersion value. 54 | */ 55 | @property(nonatomic, readonly) NSString *applicationVersion; 56 | 57 | /** 58 | * The application marketing version. This is usually the application's CFBundleShortVersionString value if available. May be nil. 59 | */ 60 | @property(nonatomic, readonly) NSString *applicationMarketingVersion; 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/58/584911b4ebb5d9cd16878581c908fb961ebceada.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | #import 31 | 32 | /** 33 | * @ingroup constants 34 | * 35 | * The type encodings supported for CPU types and subtypes. Currently only Apple 36 | * Mach-O defined encodings are supported. 37 | * 38 | * @internal 39 | * These enum values match the protobuf values. Keep them synchronized. 40 | */ 41 | typedef enum { 42 | /** Unknown cpu type encoding. */ 43 | PLCrashReportProcessorTypeEncodingUnknown = 0, 44 | 45 | /** Apple Mach-defined processor types. */ 46 | PLCrashReportProcessorTypeEncodingMach = 1 47 | } PLCrashReportProcessorTypeEncoding; 48 | 49 | @interface PLCrashReportProcessorInfo : NSObject { 50 | @private 51 | /** Type encoding */ 52 | PLCrashReportProcessorTypeEncoding _typeEncoding; 53 | 54 | /** CPU type */ 55 | uint64_t _type; 56 | 57 | /** CPU subtype */ 58 | uint64_t _subtype; 59 | } 60 | 61 | - (id) initWithTypeEncoding: (PLCrashReportProcessorTypeEncoding) typeEncoding 62 | type: (uint64_t) type 63 | subtype: (uint64_t) subtype; 64 | 65 | /** The CPU type encoding. */ 66 | @property(nonatomic, readonly) PLCrashReportProcessorTypeEncoding typeEncoding; 67 | 68 | /** The CPU type. */ 69 | @property(nonatomic, readonly) uint64_t type; 70 | 71 | /** The CPU subtype. */ 72 | @property(nonatomic, readonly) uint64_t subtype; 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/5c/5c063000cebed60ea3fadd0527a1cf130c1d9f4f.svn-base: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 14F1021 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | CrashReporter 11 | CFBundleIdentifier 12 | coop.plausible.CrashReporter 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | CrashReporter 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleSignature 20 | ???? 21 | CFBundleSupportedPlatforms 22 | 23 | MacOSX 24 | 25 | CFBundleVersion 26 | 1.0 27 | DTCompiler 28 | com.apple.compilers.llvm.clang.1_0 29 | DTPlatformBuild 30 | 7B91b 31 | DTPlatformVersion 32 | GM 33 | DTSDKBuild 34 | 15A278 35 | DTSDKName 36 | macosx10.11 37 | DTXcode 38 | 0710 39 | DTXcodeBuild 40 | 7B91b 41 | 42 | 43 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/64/64ba239b16dd66f2b80c325458adbdab9e24f3bf.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | #import 31 | 32 | #import "PLCrashReporterConfig.h" 33 | #import "PLCrashMacros.h" 34 | 35 | @class PLCrashMachExceptionServer; 36 | @class PLCrashMachExceptionPortSet; 37 | 38 | /** 39 | * @ingroup functions 40 | * 41 | * Prototype of a callback function used to execute additional user code with signal information as provided 42 | * by PLCrashReporter. Called upon completion of crash handling, after the crash report has been written to disk. 43 | * 44 | * @param info The signal info. 45 | * @param uap The crash's threads context. 46 | * @param context The API client's supplied context value. 47 | * 48 | * @sa The @ref async_safety documentation. 49 | * @sa PLCrashReporter::setPostCrashCallbacks: 50 | */ 51 | typedef void (*PLCrashReporterPostCrashSignalCallback)(siginfo_t *info, ucontext_t *uap, void *context); 52 | 53 | /** 54 | * @ingroup types 55 | * 56 | * This structure contains callbacks supported by PLCrashReporter to allow the host application to perform 57 | * additional tasks prior to program termination after a crash has occured. 58 | * 59 | * @sa The @ref async_safety documentation. 60 | */ 61 | typedef struct PLCrashReporterCallbacks { 62 | /** The version number of this structure. If not one of the defined version numbers for this type, the behavior 63 | * is undefined. The current version of this structure is 0. */ 64 | uint16_t version; 65 | 66 | /** An arbitrary user-supplied context value. This value may be NULL. */ 67 | void *context; 68 | 69 | /** 70 | * The callback used to report caught signal information. In version 0 of this structure, all crashes will be 71 | * reported via this function. 72 | * 73 | * @warning When using PLCrashReporterSignalHandlerTypeMach, the siginfo_t argument to this function will be derived 74 | * from the Mach exception data, and may be incorrect, or may otherwise not match the expected data as provided via 75 | * PLCrashReporterSignalHandlerTypeBSD. In addition, the provided ucontext_t value will be zero-initialized, and will 76 | * not provide valid thread state. 77 | * 78 | * This callback will be deprecated in favor of a Mach-compatible replacement in a future release; support is maintained 79 | * here to allow clients that rely on post-crash callbacks without thread state to make use of Mach exceptions. 80 | */ 81 | PLCrashReporterPostCrashSignalCallback handleSignal; 82 | } PLCrashReporterCallbacks; 83 | 84 | @interface PLCrashReporter : NSObject { 85 | @private 86 | /** Reporter configuration */ 87 | PLCrashReporterConfig *_config; 88 | 89 | /** YES if the crash reporter has been enabled */ 90 | BOOL _enabled; 91 | 92 | #if PLCRASH_FEATURE_MACH_EXCEPTIONS 93 | /** The backing Mach exception server, if any. Nil if the reporter has not been enabled, or if 94 | * the configured signal handler type is not PLCrashReporterSignalHandlerTypeMach. */ 95 | PLCrashMachExceptionServer *_machServer; 96 | 97 | /** Previously registered Mach exception ports, if any. */ 98 | PLCrashMachExceptionPortSet *_previousMachPorts; 99 | #endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */ 100 | 101 | /** Application identifier */ 102 | NSString *_applicationIdentifier; 103 | 104 | /** Application version */ 105 | NSString *_applicationVersion; 106 | 107 | /** Application marketing version */ 108 | NSString *_applicationMarketingVersion; 109 | 110 | /** Path to the crash reporter internal data directory */ 111 | NSString *_crashReportDirectory; 112 | } 113 | 114 | + (PLCrashReporter *) sharedReporter PLCR_DEPRECATED; 115 | 116 | - (instancetype) initWithConfiguration: (PLCrashReporterConfig *) config; 117 | 118 | - (BOOL) hasPendingCrashReport; 119 | 120 | - (NSData *) loadPendingCrashReportData; 121 | - (NSData *) loadPendingCrashReportDataAndReturnError: (NSError **) outError; 122 | 123 | - (NSData *) generateLiveReportWithThread: (thread_t) thread; 124 | - (NSData *) generateLiveReportWithThread: (thread_t) thread error: (NSError **) outError; 125 | 126 | - (NSData *) generateLiveReport; 127 | - (NSData *) generateLiveReportAndReturnError: (NSError **) outError; 128 | 129 | - (BOOL) purgePendingCrashReport; 130 | - (BOOL) purgePendingCrashReportAndReturnError: (NSError **) outError; 131 | 132 | - (BOOL) enableCrashReporter; 133 | - (BOOL) enableCrashReporterAndReturnError: (NSError **) outError; 134 | 135 | - (void) setCrashCallbacks: (PLCrashReporterCallbacks *) callbacks; 136 | 137 | @end 138 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/70/70e61adc399b89426dce57acee999d492c428aa2.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2013 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | #import "PLCrashFeatureConfig.h" 31 | 32 | /** 33 | * @ingroup enums 34 | * Supported mechanisms for trapping and handling crashes. 35 | */ 36 | typedef NS_ENUM(NSUInteger, PLCrashReporterSignalHandlerType) { 37 | /** 38 | * Trap fatal signals via a sigaction(2)-registered BSD signal handler. 39 | * 40 | * PLCrashReporter's signal handler will supersede previously registered handlers; existing 41 | * handlers will not be called. This behavior may be modified in a future release, and should 42 | * not be relied upon as a mechanism to prevent existing signal handlers from being called. 43 | * 44 | * There are some limitations to signal-based crash handling on Mac OS X and iOS; specifically: 45 | * 46 | * - On Mac OS X, stack overflows will only be handled on the thread on which 47 | * the crash reporter was initialized. This should generally be the main thread. 48 | * - On iOS 6.0 and later, any stack overflows will not be handled due to sigaltstack() being 49 | * non-functional on the device. (see rdar://13002712 - SA_ONSTACK/sigaltstack() ignored on iOS). 50 | * - Some exit paths in Apple's Libc will deregister a signal handler before firing SIGABRT, resulting 51 | * in the signal handler never being called (see rdar://14313497 - ___abort() disables SIGABRT signal 52 | * handlers prior to raising SIGABRT). These __abort()-based checks are: 53 | * - Implemented for unsafe memcpy/strcpy/snprintf C functions. 54 | * - Only enabled when operating on a fixed-width target buffer (in which case the 55 | * compiler rewrites the function calls to the built-in variants, and provides the fixed-width length as an argument). 56 | * - Only trigger in the case that the source data exceeds the size of the fixed width target 57 | * buffer, and the maximum length argument either isn't supplied by the caller (eg, when using strcpy), 58 | * or a too-long argument is supplied (eg, strncpy with a length argument longer than the target buffer), 59 | * AND that argument can't be checked at compile-time. 60 | */ 61 | PLCrashReporterSignalHandlerTypeBSD = 0, 62 | 63 | #if PLCRASH_FEATURE_MACH_EXCEPTIONS 64 | /** 65 | * Trap fatal signals via a Mach exception server. 66 | * 67 | * If any existing Mach exception server has been registered for the task, exceptions will be forwarded to that 68 | * exception handler. Should the exceptions be handled by an existing handler, no report will be generated 69 | * by PLCrashReporter. 70 | * 71 | * @par Mac OS X 72 | * 73 | * On Mac OS X, the Mach exception implementation is fully supported, using publicly available API -- note, 74 | * however, that some kernel-internal constants, as well as architecture-specific trap information, 75 | * may be required to fully interpret a Mach exception's root cause. 76 | * 77 | * @par iOS 78 | * 79 | * On iOS, the APIs required for a complete implementation are not fully public. 80 | * 81 | * The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to 82 | * implement Mach exception handling regardless of concerns over API visiblity. Given this, we've included 83 | * Mach exception handling as an optional feature, with both build-time and runtime configuration 84 | * to disable its inclusion or use, respectively. 85 | * 86 | * @par Debugger Incompatibility 87 | * 88 | * The Mach exception handler executes in-process, and will interfere with debuggers when they attempt to 89 | * suspend all active threads (which will include the Mach exception handler). Mach-based handling 90 | * should not be used when a debugger is attached. 91 | * 92 | * @par More Details 93 | * 94 | * For more information, refer to @ref mach_exceptions. 95 | */ 96 | PLCrashReporterSignalHandlerTypeMach = 1 97 | #endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */ 98 | }; 99 | 100 | /** 101 | * @ingroup enums 102 | * Supported mechanisms for performing local symbolication. 103 | * 104 | * Local symbolication is performed using inexact heuristics and symbol data available at runtime; it may 105 | * return information that is incorrect. This may still be useful in the case where DWARF data is unavailable 106 | * for a given build; in that case, it can provide function and method names (though not line numbers) for a 107 | * crash report that may otherwise be unusable. 108 | * 109 | * Note, however, this comes at the cost of a significant increase in code that must run within the critical 110 | * crash reporting section, where failures may result in crash reports being corrupted or left unwritten. In 111 | * addition, some of the provided symbolication strategies rely on knowledge of runtime internals that may 112 | * change in future iOS releases. Given that DWARF symbolication data will always be more accurate, and 113 | * the risks inherent in executing considerably more code at crash time, it is strongly recommended that local 114 | * symbolication only be enabled for non-release builds. 115 | * 116 | * Multiple symbolication strategies may be enabled, in which case a best-match heuristic will be applied to the 117 | * results. 118 | */ 119 | typedef NS_OPTIONS(NSUInteger, PLCrashReporterSymbolicationStrategy) { 120 | /** No symbolication. */ 121 | PLCrashReporterSymbolicationStrategyNone = 0, 122 | 123 | /** 124 | * Use the standard binary symbol table. On iOS, this alone will return 125 | * incomplete results, as most symbols are rewritten to the common '\' string. 126 | */ 127 | PLCrashReporterSymbolicationStrategySymbolTable = 1 << 0, 128 | 129 | /** 130 | * Use Objective-C metadata to find method and class names. This relies on detailed parsing 131 | * of the Objective-C runtime data, including undefined flags and other runtime internals. As such, 132 | * it may return incorrect data should the runtime be changed incompatibly. 133 | */ 134 | PLCrashReporterSymbolicationStrategyObjC = 1 << 1, 135 | 136 | /** 137 | * Enable all available symbolication strategies. 138 | */ 139 | PLCrashReporterSymbolicationStrategyAll = (PLCrashReporterSymbolicationStrategySymbolTable|PLCrashReporterSymbolicationStrategyObjC) 140 | }; 141 | 142 | @interface PLCrashReporterConfig : NSObject { 143 | @private 144 | /** The configured signal handler type. */ 145 | PLCrashReporterSignalHandlerType _signalHandlerType; 146 | 147 | /** The configured symbolication strategy. */ 148 | PLCrashReporterSymbolicationStrategy _symbolicationStrategy; 149 | } 150 | 151 | + (instancetype) defaultConfiguration; 152 | 153 | - (instancetype) init; 154 | - (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType 155 | symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy; 156 | 157 | /** The configured signal handler type. */ 158 | @property(nonatomic, readonly) PLCrashReporterSignalHandlerType signalHandlerType; 159 | 160 | /** The configured symbolication strategy. */ 161 | @property(nonatomic, readonly) PLCrashReporterSymbolicationStrategy symbolicationStrategy; 162 | 163 | 164 | @end 165 | 166 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/71/710191442cab38770c12afc78079514ce2995fd5.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2013 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #ifndef PLCRASH_CONSTANTS_H 30 | #define PLCRASH_CONSTANTS_H 31 | 32 | #include 33 | 34 | #if defined(__cplusplus) 35 | # define PLCR_EXPORT extern "C" 36 | # define PLCR_C_BEGIN_DECLS extern "C" { 37 | # define PLCR_C_END_DECLS } 38 | #else 39 | # define PLCR_EXPORT extern 40 | # define PLCR_C_BEGIN_DECLS 41 | # define PLCR_C_END_DECLS 42 | #endif 43 | 44 | #if defined(__cplusplus) 45 | # if defined(PLCRASHREPORTER_PREFIX) 46 | /** @internal Define the plcrash namespace, automatically inserting an inline namespace containing the configured PLCRASHREPORTER_PREFIX, if any. */ 47 | # define PLCR_CPP_BEGIN_NS namespace plcrash { inline namespace PLCRASHREPORTER_PREFIX { 48 | 49 | /** @internal Close the definition of the `plcrash` namespace (and the PLCRASHREPORTER_PREFIX inline namespace, if any). */ 50 | # define PLCR_CPP_END_NS }} 51 | # else 52 | # define PLCR_CPP_BEGIN_NS namespace plcrash { 53 | # define PLCR_CPP_END_NS } 54 | # endif 55 | # 56 | /** @internal Define the plcrash::async namespace, automatically inserting an inline namespace containing the configured PLCRASHREPORTER_PREFIX, if any. */ 57 | # define PLCR_CPP_BEGIN_ASYNC_NS PLCR_CPP_BEGIN_NS namespace async { 58 | 59 | /** @internal Close the definition of the `plcrash::async` namespace (and the PLCRASHREPORTER_PREFIX inline namespace, if any). */ 60 | # define PLCR_CPP_END_ASYNC_NS PLCR_CPP_END_NS } 61 | #endif 62 | 63 | #ifdef __clang__ 64 | # define PLCR_PRAGMA_CLANG(_p) _Pragma(_p) 65 | #else 66 | # define PLCR_PRAGMA_CLANG(_p) 67 | #endif 68 | 69 | #ifdef __clang__ 70 | # define PLCR_DEPRECATED __attribute__((deprecated)) 71 | #else 72 | # define PLCR_DEPRECATED 73 | #endif 74 | 75 | #if defined(__clang__) || defined(__GNUC__) 76 | # define PLCR_UNUSED __attribute__((unused)) 77 | #else 78 | # define PLCR_UNUSED 79 | #endif 80 | 81 | #ifdef PLCR_PRIVATE 82 | /** 83 | * Marks a definition as deprecated only for for external clients, allowing 84 | * uses of it internal fo the framework. 85 | */ 86 | # define PLCR_EXTERNAL_DEPRECATED 87 | 88 | /** 89 | * @internal 90 | * A macro to put above a definition marked PLCR_EXTERNAL_DEPRECATED that will 91 | * silence warnings about there being a deprecation documentation marker but the 92 | * definition not being marked deprecated. 93 | */ 94 | # define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() \ 95 | PLCR_PRAGMA_CLANG("clang diagnostic push"); \ 96 | PLCR_PRAGMA_CLANG("clang diagnostic ignored \"-Wdocumentation-deprecated-sync\"") 97 | 98 | /** 99 | * @internal 100 | * A macro to put below a definition marked PLCR_EXTERNAL_DEPRECATED that will 101 | * silence warnings about there being a deprecation documentation marker but the 102 | * definition not being marked deprecated. 103 | */ 104 | # define PLCR_EXTERNAL_DEPRECATED_NOWARN_POP() PLCR_PRAGMA_CLANG("clang diagnostic pop") 105 | 106 | #else 107 | 108 | # define PLCR_EXTERNAL_DEPRECATED PLCR_DEPRECATED 109 | # define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() 110 | # define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() 111 | 112 | #endif /* PLCR_PRIVATE */ 113 | 114 | #ifdef PLCR_PRIVATE 115 | # if defined(__clang__) && __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough") 116 | # define PLCR_FALLTHROUGH [[clang::fallthrough]] 117 | # else 118 | # define PLCR_FALLTHROUGH do {} while (0) 119 | # endif 120 | #endif 121 | 122 | #ifdef PLCR_PRIVATE 123 | /** 124 | * @internal 125 | * Static compile-time assertion. 126 | * 127 | * @param name The assertion name; must be valid for use within a C identifier. 128 | * @param cond Assertion condition 129 | */ 130 | # define PLCR_ASSERT_STATIC(name, cond) PLCR_ASSERT_STATIC_(name, cond, __LINE__) 131 | /* 132 | * C++11 and C11 both provide a static_assert(). 133 | * 134 | * Otherwise, we have to use typedef-based static assertions. 135 | */ 136 | # if (defined(__cplusplus) && __cplusplus >= 201103L) || (!defined(__cplusplus) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) 137 | # define PLCR_ASSERT_STATIC_(name, cond, line) PLCR_ASSERT_STATIC__(#name, cond) 138 | # define PLCR_ASSERT_STATIC__(name, cond) static_assert(cond, #name) 139 | # else 140 | # define PLCR_ASSERT_STATIC_(name, cond, line) PLCR_ASSERT_STATIC__(name, cond, line) 141 | # define PLCR_ASSERT_STATIC__(name, cond, line) typedef int plcf_static_assert_##name##_##line [(cond) ? 1 : -1] PLCR_UNUSED 142 | # endif 143 | #endif /* PLCR_PRIVATE */ 144 | 145 | #endif /* PLCRASH_CONSTANTS_H */ 146 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/79/7936fdf63d39af33a60fd4d3dc56b9988493b1f5.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | #include "PLCrashMacros.h" 31 | @class PLCrashReportProcessorInfo; 32 | 33 | /** 34 | * @ingroup constants 35 | * 36 | * Indicates the Operating System under which a Crash Log was generated. 37 | * 38 | * @internal 39 | * These enum values match the protobuf values. Keep them synchronized. 40 | */ 41 | typedef enum { 42 | /** Mac OS X. */ 43 | PLCrashReportOperatingSystemMacOSX = 0, 44 | 45 | /** iPhone OS */ 46 | PLCrashReportOperatingSystemiPhoneOS = 1, 47 | 48 | /** iPhone Simulator (Mac OS X with additional simulator-specific runtime libraries) */ 49 | PLCrashReportOperatingSystemiPhoneSimulator = 2, 50 | 51 | /** Unknown operating system */ 52 | PLCrashReportOperatingSystemUnknown = 3, 53 | } PLCrashReportOperatingSystem; 54 | 55 | /** 56 | * @ingroup constants 57 | * 58 | * Indicates the architecture under which a Crash Log was generated. 59 | * 60 | * @note The architecture value has been deprecated in v1.1 and later crash reports. All new reports 61 | * will make use of the new PLCrashReportProcessorInfo CPU type encodings. 62 | * 63 | * @internal 64 | * These enum values match the protobuf values. Keep them synchronized. 65 | */ 66 | typedef enum { 67 | /** x86-32. */ 68 | PLCrashReportArchitectureX86_32 = 0, 69 | 70 | /** x86-64 */ 71 | PLCrashReportArchitectureX86_64 = 1, 72 | 73 | /** ARMv6 */ 74 | PLCrashReportArchitectureARMv6 = 2, 75 | 76 | /** 77 | * ARMv6 78 | * @deprecated This value has been deprecated in favor of ARM subtype-specific 79 | * values. 80 | * @sa PLCrashReportArchitectureARMv6 81 | */ 82 | PLCrashReportArchitectureARM PLCR_DEPRECATED = PLCrashReportArchitectureARMv6, 83 | 84 | /** PPC */ 85 | PLCrashReportArchitecturePPC = 3, 86 | 87 | /** PPC64 */ 88 | PLCrashReportArchitecturePPC64 = 4, 89 | 90 | /** ARMv7 */ 91 | PLCrashReportArchitectureARMv7 = 5, 92 | 93 | /** Unknown */ 94 | PLCrashReportArchitectureUnknown = 6 95 | } PLCrashReportArchitecture; 96 | 97 | 98 | extern PLCrashReportOperatingSystem PLCrashReportHostOperatingSystem; 99 | PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH(); 100 | extern PLCrashReportArchitecture PLCrashReportHostArchitecture PLCR_EXTERNAL_DEPRECATED; 101 | PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH(); 102 | 103 | @interface PLCrashReportSystemInfo : NSObject { 104 | @private 105 | /** Operating system */ 106 | PLCrashReportOperatingSystem _operatingSystem; 107 | 108 | /** Operating system version */ 109 | NSString *_osVersion; 110 | 111 | /** OS build. May be nil. */ 112 | NSString *_osBuild; 113 | 114 | /** Architecture */ 115 | PLCrashReportArchitecture _architecture; 116 | 117 | /** Date crash report was generated. May be nil if the date is unknown. */ 118 | NSDate *_timestamp; 119 | 120 | /** Processor information. */ 121 | PLCrashReportProcessorInfo *_processorInfo; 122 | } 123 | 124 | - (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem 125 | operatingSystemVersion: (NSString *) operatingSystemVersion 126 | architecture: (PLCrashReportArchitecture) architecture 127 | timestamp: (NSDate *) timestamp PLCR_DEPRECATED; 128 | 129 | - (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem 130 | operatingSystemVersion: (NSString *) operatingSystemVersion 131 | operatingSystemBuild: (NSString *) operatingSystemBuild 132 | architecture: (PLCrashReportArchitecture) architecture 133 | timestamp: (NSDate *) timestamp PLCR_DEPRECATED; 134 | 135 | - (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem 136 | operatingSystemVersion: (NSString *) operatingSystemVersion 137 | operatingSystemBuild: (NSString *) operatingSystemBuild 138 | architecture: (PLCrashReportArchitecture) architecture 139 | processorInfo: (PLCrashReportProcessorInfo *) processorInfo 140 | timestamp: (NSDate *) timestamp; 141 | 142 | /** The operating system. */ 143 | @property(nonatomic, readonly) PLCrashReportOperatingSystem operatingSystem; 144 | 145 | /** The operating system's release version. */ 146 | @property(nonatomic, readonly) NSString *operatingSystemVersion; 147 | 148 | /** The operating system's build identifier (eg, 10J869). This may be unavailable, and this property will be nil. */ 149 | @property(nonatomic, readonly) NSString *operatingSystemBuild; 150 | 151 | /** Architecture. @deprecated The architecture value has been deprecated in v1.1 and later crash reports. All new reports 152 | * include the CPU type as part of the crash report's machine info structure, using the PLCrashReportProcessorInfo 153 | * extensible encoding. */ 154 | @property(nonatomic, readonly) PLCrashReportArchitecture architecture PLCR_DEPRECATED; 155 | 156 | /** Date and time that the crash report was generated. This may be unavailable, and this property will be nil. */ 157 | @property(nonatomic, readonly) NSDate *timestamp; 158 | 159 | /** The processor type. For v1.2 reports and later, this is an alias to the machine info's processorInfo. 160 | * For earlier reports, this will be synthesized from the deprecated architecture property. */ 161 | @property(nonatomic, readonly) PLCrashReportProcessorInfo *processorInfo; 162 | 163 | @end 164 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/79/7990b3a661e710ded6e807d797438fd2afb1e6e5.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | 31 | @interface PLCrashReportSignalInfo : NSObject { 32 | @private 33 | /** Signal name */ 34 | NSString *_name; 35 | 36 | /** Signal code */ 37 | NSString *_code; 38 | 39 | /** Fauling instruction or address */ 40 | uint64_t _address; 41 | } 42 | 43 | - (id) initWithSignalName: (NSString *) name code: (NSString *) code address: (uint64_t) address; 44 | 45 | /** 46 | * The signal name. 47 | */ 48 | @property(nonatomic, readonly) NSString *name; 49 | 50 | /** 51 | * The signal code. 52 | */ 53 | @property(nonatomic, readonly) NSString *code; 54 | 55 | /** 56 | * The faulting instruction or address. 57 | */ 58 | @property(nonatomic, readonly) uint64_t address; 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/7e/7efdf8ddc11e92802ff54a3fd0ce448c0440f583.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | #import "PLCrashReportSymbolInfo.h" 31 | 32 | @interface PLCrashReportStackFrameInfo : NSObject { 33 | @private 34 | /** Frame instruction pointer. */ 35 | uint64_t _instructionPointer; 36 | 37 | /** Symbol information, if available. Otherwise, will be nil. */ 38 | PLCrashReportSymbolInfo *_symbolInfo; 39 | } 40 | 41 | - (id) initWithInstructionPointer: (uint64_t) instructionPointer symbolInfo: (PLCrashReportSymbolInfo *) symbolInfo; 42 | 43 | /** 44 | * Frame's instruction pointer. 45 | */ 46 | @property(nonatomic, readonly) uint64_t instructionPointer; 47 | 48 | /** Symbol information for this frame. 49 | * This may be unavailable, and this property will be nil. */ 50 | @property(nonatomic, readonly) PLCrashReportSymbolInfo *symbolInfo; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/7f/7fabe16d3b1be90b8b52d56b7104d21e7fab0a1d.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | 31 | #import "PLCrashReportApplicationInfo.h" 32 | #import "PLCrashReportBinaryImageInfo.h" 33 | #import "PLCrashReportExceptionInfo.h" 34 | #import "PLCrashReportMachineInfo.h" 35 | #import "PLCrashReportMachExceptionInfo.h" 36 | #import "PLCrashReportProcessInfo.h" 37 | #import "PLCrashReportProcessorInfo.h" 38 | #import "PLCrashReportRegisterInfo.h" 39 | #import "PLCrashReportSignalInfo.h" 40 | #import "PLCrashReportStackFrameInfo.h" 41 | #import "PLCrashReportSymbolInfo.h" 42 | #import "PLCrashReportSystemInfo.h" 43 | #import "PLCrashReportThreadInfo.h" 44 | 45 | /** 46 | * @ingroup constants 47 | * Crash file magic identifier */ 48 | #define PLCRASH_REPORT_FILE_MAGIC "plcrash" 49 | 50 | /** 51 | * @ingroup constants 52 | * Crash format version byte identifier. Will not change outside of the introduction of 53 | * an entirely new crash log format. */ 54 | #define PLCRASH_REPORT_FILE_VERSION 1 55 | 56 | /** 57 | * @ingroup types 58 | * Crash log file header format. 59 | * 60 | * Crash log files start with 7 byte magic identifier (#PLCRASH_REPORT_FILE_MAGIC), 61 | * followed by a single unsigned byte version number (#PLCRASH_REPORT_FILE_VERSION). 62 | * The crash log message format itself is extensible, so this version number will only 63 | * be incremented in the event of an incompatible encoding or format change. 64 | */ 65 | struct PLCrashReportFileHeader { 66 | /** Crash log magic identifier, not NULL terminated */ 67 | const char magic[7]; 68 | 69 | /** Crash log encoding/format version */ 70 | const uint8_t version; 71 | 72 | /** File data */ 73 | const uint8_t data[]; 74 | } __attribute__((packed)); 75 | 76 | 77 | /** 78 | * @internal 79 | * Private decoder instance variables (used to hide the underlying protobuf parser). 80 | */ 81 | typedef struct _PLCrashReportDecoder _PLCrashReportDecoder; 82 | 83 | @interface PLCrashReport : NSObject { 84 | @private 85 | /** Private implementation variables (used to hide the underlying protobuf parser) */ 86 | _PLCrashReportDecoder *_decoder; 87 | 88 | /** System info */ 89 | PLCrashReportSystemInfo *_systemInfo; 90 | 91 | /** Machine info */ 92 | PLCrashReportMachineInfo *_machineInfo; 93 | 94 | /** Application info */ 95 | PLCrashReportApplicationInfo *_applicationInfo; 96 | 97 | /** Process info */ 98 | PLCrashReportProcessInfo *_processInfo; 99 | 100 | /** Signal info */ 101 | PLCrashReportSignalInfo *_signalInfo; 102 | 103 | /** Mach exception info */ 104 | PLCrashReportMachExceptionInfo *_machExceptionInfo; 105 | 106 | /** Thread info (PLCrashReportThreadInfo instances) */ 107 | NSArray *_threads; 108 | 109 | /** Binary images (PLCrashReportBinaryImageInfo instances */ 110 | NSArray *_images; 111 | 112 | /** Exception information (may be nil) */ 113 | PLCrashReportExceptionInfo *_exceptionInfo; 114 | 115 | /** Report UUID */ 116 | CFUUIDRef _uuid; 117 | } 118 | 119 | - (id) initWithData: (NSData *) encodedData error: (NSError **) outError; 120 | 121 | - (PLCrashReportBinaryImageInfo *) imageForAddress: (uint64_t) address; 122 | 123 | /** 124 | * System information. 125 | */ 126 | @property(nonatomic, readonly) PLCrashReportSystemInfo *systemInfo; 127 | 128 | /** 129 | * YES if machine information is available. 130 | */ 131 | @property(nonatomic, readonly) BOOL hasMachineInfo; 132 | 133 | /** 134 | * Machine information. Only available in later (v1.1+) crash report format versions. If not available, 135 | * will be nil. 136 | */ 137 | @property(nonatomic, readonly) PLCrashReportMachineInfo *machineInfo; 138 | 139 | /** 140 | * Application information. 141 | */ 142 | @property(nonatomic, readonly) PLCrashReportApplicationInfo *applicationInfo; 143 | 144 | /** 145 | * YES if process information is available. 146 | */ 147 | @property(nonatomic, readonly) BOOL hasProcessInfo; 148 | 149 | /** 150 | * Process information. Only available in later (v1.1+) crash report format versions. If not available, 151 | * will be nil. 152 | */ 153 | @property(nonatomic, readonly) PLCrashReportProcessInfo *processInfo; 154 | 155 | /** 156 | * Signal information. This provides the signal and signal code of the fatal signal. 157 | */ 158 | @property(nonatomic, readonly) PLCrashReportSignalInfo *signalInfo; 159 | 160 | /** 161 | * Mach exception information, if available. This will only be included in the 162 | * case that encoding crash reporter's exception-based reporting was enabled, and a Mach 163 | * exception was caught. 164 | * 165 | * @warning If Mach exception information is available, the legacy signalInfo property will also be provided; this 166 | * s required to maintain backwards compatibility with the established API. Note, however, that the signal info may be derived from the 167 | * Mach exception info by the encoding crash reporter, and thus may not exactly match the kernel exception-to-signal 168 | * mappings implemented in xnu. As such, when Mach exception info is available, its use should be preferred. 169 | */ 170 | @property(nonatomic, readonly) PLCrashReportMachExceptionInfo *machExceptionInfo; 171 | 172 | /** 173 | * Thread information. Returns a list of PLCrashReportThreadInfo instances. 174 | */ 175 | @property(nonatomic, readonly) NSArray *threads; 176 | 177 | /** 178 | * Binary image information. Returns a list of PLCrashReportBinaryImageInfo instances. 179 | */ 180 | @property(nonatomic, readonly) NSArray *images; 181 | 182 | /** 183 | * YES if exception information is available. 184 | */ 185 | @property(nonatomic, readonly) BOOL hasExceptionInfo; 186 | 187 | /** 188 | * Exception information. Only available if a crash was caused by an uncaught exception, 189 | * otherwise nil. 190 | */ 191 | @property(nonatomic, readonly) PLCrashReportExceptionInfo *exceptionInfo; 192 | 193 | /** 194 | * A client-generated 16-byte UUID. May be used to filter duplicate reports submitted or generated 195 | * by a single client. Only available in later (v1.2+) crash report format versions. If not available, 196 | * will be NULL. 197 | */ 198 | @property(nonatomic, readonly) CFUUIDRef uuidRef; 199 | 200 | @end 201 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/83/83f1ef71e4b51512313446364e2db78911330a7c.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2013 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | 31 | @interface PLCrashReportMachExceptionInfo : NSObject { 32 | @private 33 | /** The Mach exception type. */ 34 | uint64_t _type; 35 | 36 | /** The Mach exception codes, represented as an ordered array of NSNumber instances. */ 37 | NSArray *_codes; 38 | } 39 | 40 | - (id) initWithType: (uint64_t) type codes: (NSArray *) codes; 41 | 42 | /** The Mach exception type. */ 43 | @property(nonatomic, readonly) uint64_t type; 44 | 45 | /** The Mach exception codes, represented as an ordered array of 64-bit unsigned NSNumber instances. */ 46 | @property(nonatomic, readonly) NSArray *codes; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/8d/8d448e33c67a62f13eea2c97c7b911371eaa988d.svn-base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lishichao/PerformanceMonitor/aae6e8517d3b5079096b1120e6d0592332046783/PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/8d/8d448e33c67a62f13eea2c97c7b911371eaa988d.svn-base -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/8e/8e5ee09ed62de2426359c337bb64575bb4005907.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * Authors: 3 | * Landon Fuller 4 | * Damian Morris 5 | * 6 | * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. 7 | * Copyright (c) 2010 MOSO Corporation, Pty Ltd. 8 | * All rights reserved. 9 | * 10 | * Permission is hereby granted, free of charge, to any person 11 | * obtaining a copy of this software and associated documentation 12 | * files (the "Software"), to deal in the Software without 13 | * restriction, including without limitation the rights to use, 14 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | * copies of the Software, and to permit persons to whom the 16 | * Software is furnished to do so, subject to the following 17 | * conditions: 18 | * 19 | * The above copyright notice and this permission notice shall be 20 | * included in all copies or substantial portions of the Software. 21 | * 22 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 23 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 24 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 25 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 26 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 27 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 28 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 29 | * OTHER DEALINGS IN THE SOFTWARE. 30 | */ 31 | 32 | 33 | #import 34 | 35 | #import "PLCrashReportFormatter.h" 36 | 37 | /** 38 | * Supported text output formats. 39 | * 40 | * @ingroup enums 41 | */ 42 | typedef enum { 43 | /** An iOS-compatible crash log text format. Compatible with the crash logs generated by the device and available 44 | * through iTunes Connect. */ 45 | PLCrashReportTextFormatiOS = 0 46 | } PLCrashReportTextFormat; 47 | 48 | 49 | @interface PLCrashReportTextFormatter : NSObject { 50 | @private 51 | /** Text output format. */ 52 | PLCrashReportTextFormat _textFormat; 53 | 54 | /** Encoding to use for string output. */ 55 | NSStringEncoding _stringEncoding; 56 | } 57 | 58 | + (NSString *) stringValueForCrashReport: (PLCrashReport *) report withTextFormat: (PLCrashReportTextFormat) textFormat; 59 | 60 | - (id) initWithTextFormat: (PLCrashReportTextFormat) textFormat stringEncoding: (NSStringEncoding) stringEncoding; 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/a1/a1290f8354de21ee76c0fa940c895ac046bff886.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | 31 | @interface PLCrashReportSymbolInfo : NSObject { 32 | @private 33 | /** The symbol name. */ 34 | NSString *_symbolName; 35 | 36 | /** The symbol start address. */ 37 | uint64_t _startAddress; 38 | 39 | /** The symbol end address, if explicitly defined. Will be 0 if unknown. */ 40 | uint64_t _endAddress; 41 | } 42 | 43 | - (id) initWithSymbolName: (NSString *) symbolName 44 | startAddress: (uint64_t) startAddress 45 | endAddress: (uint64_t) endAddress; 46 | 47 | /** The symbol name. */ 48 | @property(nonatomic, readonly) NSString *symbolName; 49 | 50 | /** The symbol start address. */ 51 | @property(nonatomic, readonly) uint64_t startAddress; 52 | 53 | /* The symbol end address, if explicitly defined. This will only be included if the end address is 54 | * explicitly defined (eg, by DWARF debugging information), will not be derived by best-guess 55 | * heuristics. 56 | * 57 | * If unknown, the address will be 0. 58 | */ 59 | @property(nonatomic, readonly) uint64_t endAddress; 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/b1/b11d8240b08319779228758644b7d3fb84d58c4b.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #ifndef PLCRASH_ASYNC_SIGNAL_INFO_H 30 | #define PLCRASH_ASYNC_SIGNAL_INFO_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /** 37 | * @internal 38 | * 39 | * @defgroup plcrash_async_signal_info Signal Information 40 | * @ingroup plcrash_async 41 | * 42 | * Provides mapping of signal number and code to strings. 43 | * 44 | * @{ 45 | */ 46 | 47 | const char *plcrash_async_signal_signame (int signal); 48 | const char *plcrash_async_signal_sigcode (int signal, int si_code); 49 | 50 | /** 51 | * @} plcrash_async_signal_info 52 | */ 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif /* PLCRASH_ASYNC_SIGNAL_INFO_H */ 59 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/b4/b4beb99c252244c0b9c365ad0c81674f2cf8f90f.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | 31 | #import "PLCrashReportProcessorInfo.h" 32 | 33 | @interface PLCrashReportMachineInfo : NSObject { 34 | @private 35 | /** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */ 36 | NSString *_modelName; 37 | 38 | /** The processor type. */ 39 | PLCrashReportProcessorInfo *_processorInfo; 40 | 41 | /* The number of actual physical processor cores. */ 42 | NSUInteger _processorCount; 43 | 44 | /* The number of logical processors. */ 45 | NSUInteger _logicalProcessorCount; 46 | } 47 | 48 | - (id) initWithModelName: (NSString *) modelName 49 | processorInfo: (PLCrashReportProcessorInfo *) processorInfo 50 | processorCount: (NSUInteger) processorCount 51 | logicalProcessorCount: (NSUInteger) logicalProcessorCount; 52 | 53 | /** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */ 54 | @property(nonatomic, readonly) NSString *modelName; 55 | 56 | /** The processor type. This will be unavailable in reports generated prior to PLCrashReporter 1.2, in which case this property will be nil. */ 57 | @property(nonatomic, readonly) PLCrashReportProcessorInfo *processorInfo; 58 | 59 | /* 60 | * The number of actual physical processor cores. Note that the number of active processors may be managed by the 61 | * operating system's power management system, and this value may not reflect the number of active 62 | * processors at the time of the crash. 63 | */ 64 | @property(nonatomic, readonly) NSUInteger processorCount; 65 | 66 | /* 67 | * The number of logical processors. Note that the number of active processors may be managed by the 68 | * operating system's power management system, and this value may not reflect the number of active 69 | * processors at the time of the crash. 70 | */ 71 | @property(nonatomic, readonly) NSUInteger logicalProcessorCount; 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/c1/c14937ab645201e1df23aa0bc20b04e53ac9b041.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | #import "PLCrashReportProcessorInfo.h" 31 | 32 | @interface PLCrashReportBinaryImageInfo : NSObject { 33 | @private 34 | /** Code type */ 35 | PLCrashReportProcessorInfo *_processorInfo; 36 | 37 | /** Base image address */ 38 | uint64_t _baseAddress; 39 | 40 | /** Image segment size */ 41 | uint64_t _imageSize; 42 | 43 | /** Name of binary image */ 44 | NSString *_imageName; 45 | 46 | /** If the UUID is available */ 47 | BOOL _hasImageUUID; 48 | 49 | /** 128-bit object UUID. May be nil. */ 50 | NSString *_imageUUID; 51 | } 52 | 53 | - (id) initWithCodeType: (PLCrashReportProcessorInfo *) processorInfo 54 | baseAddress: (uint64_t) baseAddress 55 | size: (uint64_t) imageSize 56 | name: (NSString *) imageName 57 | uuid: (NSData *) uuid; 58 | 59 | /** 60 | * Image code type, or nil if unavailable. 61 | */ 62 | @property(nonatomic, readonly) PLCrashReportProcessorInfo *codeType; 63 | 64 | /** 65 | * Image base address. 66 | */ 67 | @property(nonatomic, readonly) uint64_t imageBaseAddress; 68 | 69 | /** 70 | * Segment size. 71 | */ 72 | @property(nonatomic, readonly) uint64_t imageSize; 73 | 74 | /** 75 | * Image name (absolute path) 76 | */ 77 | @property(nonatomic, readonly) NSString *imageName; 78 | 79 | 80 | /** 81 | * YES if this image has an associated UUID. 82 | */ 83 | @property(nonatomic, readonly) BOOL hasImageUUID; 84 | 85 | /** 86 | * 128-bit object UUID (matches Mach-O DWARF dSYM files). May be nil if unavailable. 87 | */ 88 | @property(nonatomic, readonly) NSString *imageUUID; 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/c3/c3d76c81284e10ccb1ecb091ef0311f2af5acccb.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | 31 | #import "PLCrashReportStackFrameInfo.h" 32 | #import "PLCrashReportRegisterInfo.h" 33 | 34 | @interface PLCrashReportThreadInfo : NSObject { 35 | @private 36 | /** The thread number. Should be unique within a given crash log. */ 37 | NSInteger _threadNumber; 38 | 39 | /** Ordered list of PLCrashReportStackFrame instances */ 40 | NSArray *_stackFrames; 41 | 42 | /** YES if this thread crashed. */ 43 | BOOL _crashed; 44 | 45 | /** List of PLCrashReportRegister instances. Will be empty if _crashed is NO. */ 46 | NSArray *_registers; 47 | } 48 | 49 | - (id) initWithThreadNumber: (NSInteger) threadNumber 50 | stackFrames: (NSArray *) stackFrames 51 | crashed: (BOOL) crashed 52 | registers: (NSArray *) registers; 53 | 54 | /** 55 | * Application thread number. 56 | */ 57 | @property(nonatomic, readonly) NSInteger threadNumber; 58 | 59 | /** 60 | * Thread backtrace. Provides an array of PLCrashReportStackFrameInfo instances. 61 | * The array is ordered, last callee to first. 62 | */ 63 | @property(nonatomic, readonly) NSArray *stackFrames; 64 | 65 | /** 66 | * If this thread crashed, set to YES. 67 | */ 68 | @property(nonatomic, readonly) BOOL crashed; 69 | 70 | /** 71 | * State of the general purpose and related registers, as a list of 72 | * PLCrashReportRegister instances. If this thead did not crash (crashed returns NO), 73 | * this list will be empty. 74 | */ 75 | @property(nonatomic, readonly) NSArray *registers; 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/cb/cbd2bd911f2c9f28f0408b5e5b2d68f3acf91e42.svn-base: -------------------------------------------------------------------------------- 1 | link Versions/Current/Headers -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/ce/ce71abb0d508b36f9ed0b197fc19ec2f3df3bd8f.svn-base: -------------------------------------------------------------------------------- 1 | link Versions/Current/Resources -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/cf/cfce5d4fbb9855b5ff4574f0dd08c8a9155d51d2.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | 31 | #import "PLCrashReport.h" 32 | 33 | /** 34 | * A crash report formatter accepts a PLCrashReport instance, formats it according to implementation-specified rules, 35 | * (such as implementing text output support), and returns the result. 36 | */ 37 | @protocol PLCrashReportFormatter 38 | 39 | /** 40 | * Format the provided @a report. 41 | * 42 | * @param report Report to be formatted. 43 | * @param outError A pointer to an NSError object variable. If an error occurs, this pointer will contain an error 44 | * object indicating why the pending crash report could not be formatted. If no error occurs, this parameter will 45 | * be left unmodified. You may specify nil for this parameter, and no error information will be provided. 46 | * 47 | * @return Returns the formatted report data on success, or nil on failure. 48 | */ 49 | - (NSData *) formatReport: (PLCrashReport *) report error: (NSError **) outError; 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/e3/e36a353a48fcf6bf90beb5c372dd2f2e6e16388c.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Damian Morris 3 | * 4 | * Copyright (c) 2010 MOSO Corporation, Pty Ltd. 5 | * Copyright (c) 2010-2013 Plausible Labs Cooperative, Inc. 6 | * 7 | * All rights reserved. 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without 12 | * restriction, including without limitation the rights to use, 13 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | * copies of the Software, and to permit persons to whom the 15 | * Software is furnished to do so, subject to the following 16 | * conditions: 17 | * 18 | * The above copyright notice and this permission notice shall be 19 | * included in all copies or substantial portions of the Software. 20 | * 21 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 22 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 23 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 24 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 25 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 26 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 27 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 28 | * OTHER DEALINGS IN THE SOFTWARE. 29 | */ 30 | 31 | #import 32 | 33 | @interface PLCrashReportProcessInfo : NSObject { 34 | @private 35 | /** Process name, or nil if unavailable. */ 36 | NSString *_processName; 37 | 38 | /** Process ID */ 39 | NSUInteger _processID; 40 | 41 | /** Process path */ 42 | NSString* _processPath; 43 | 44 | /** Date and time that the crashing process was started. This may be unavailable, and this property 45 | * will be nil. */ 46 | NSDate *_processStartTime; 47 | 48 | /** Parent process name, or nil if unavailable. */ 49 | NSString *_parentProcessName; 50 | 51 | /** Parent process ID */ 52 | NSUInteger _parentProcessID; 53 | 54 | /** If false, the process is being run via process-level CPU emulation (such as Rosetta). */ 55 | BOOL _native; 56 | } 57 | 58 | - (id) initWithProcessName: (NSString *) processName 59 | processID: (NSUInteger) processID 60 | processPath: (NSString *) processPath 61 | processStartTime: (NSDate *) processStartTime 62 | parentProcessName: (NSString *) parentProcessName 63 | parentProcessID: (NSUInteger) parentProcessID 64 | native: (BOOL) native; 65 | 66 | /** 67 | * The process name. This value may not be included in the crash report, in which case this property 68 | * will be nil. 69 | */ 70 | @property(nonatomic, readonly) NSString *processName; 71 | 72 | /** 73 | * The process ID. 74 | */ 75 | @property(nonatomic, readonly) NSUInteger processID; 76 | 77 | /** 78 | * The path to the process executable. This value may not be included in the crash report, in which case this property 79 | * will be nil. 80 | */ 81 | @property(nonatomic, readonly) NSString *processPath; 82 | 83 | /** 84 | * Date and time that the crashing process was started. This value may not be included in the crash report, in which case this property 85 | * will be nil. 86 | */ 87 | @property(nonatomic, readonly) NSDate *processStartTime; 88 | 89 | /** 90 | * The parent process name. This value may not be included in the crash report, in which case this property 91 | * will be nil. 92 | */ 93 | @property(nonatomic, readonly) NSString *parentProcessName; 94 | 95 | /** 96 | * The parent process ID. 97 | */ 98 | @property(nonatomic, readonly) NSUInteger parentProcessID; 99 | 100 | /** The process' native execution status. If false, the process is being run via process-level CPU emulation (such as Rosetta). */ 101 | @property(nonatomic, readonly) BOOL native; 102 | 103 | @end 104 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/pristine/f3/f3bd95bae40f8d8cd6e816dd6ff6fc524e8166f5.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | 31 | @interface PLCrashReportRegisterInfo : NSObject { 32 | @private 33 | /** Register name */ 34 | NSString *_registerName; 35 | 36 | /** Register value */ 37 | uint64_t _registerValue; 38 | } 39 | 40 | - (id) initWithRegisterName: (NSString *) registerName registerValue: (uint64_t) registerValue; 41 | 42 | /** 43 | * Register name. 44 | */ 45 | @property(nonatomic, readonly) NSString *registerName; 46 | 47 | /** 48 | * Register value. 49 | */ 50 | @property(nonatomic, readonly) uint64_t registerValue; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/wc.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lishichao/PerformanceMonitor/aae6e8517d3b5079096b1120e6d0592332046783/PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/.svn/wc.db -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/CrashReporter: -------------------------------------------------------------------------------- 1 | Versions/Current/CrashReporter -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/A/CrashReporter: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lishichao/PerformanceMonitor/aae6e8517d3b5079096b1120e6d0592332046783/PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/A/CrashReporter -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/A/Headers/CrashReporter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | 31 | #ifdef __APPLE__ 32 | #import 33 | #endif 34 | 35 | // This must be included before any other PLCrashReporter includes, as 36 | // it redefines symbol names 37 | #import "PLCrashNamespace.h" 38 | 39 | #import "PLCrashReporter.h" 40 | #import "PLCrashReport.h" 41 | #import "PLCrashReportTextFormatter.h" 42 | 43 | /** 44 | * @defgroup functions Crash Reporter Functions Reference 45 | */ 46 | 47 | /** 48 | * @defgroup types Crash Reporter Data Types Reference 49 | */ 50 | 51 | /** 52 | * @defgroup constants Crash Reporter Constants Reference 53 | */ 54 | 55 | /** 56 | * @internal 57 | * @defgroup plcrash_internal Crash Reporter Internal Documentation 58 | */ 59 | 60 | /** 61 | * @defgroup enums Enumerations 62 | * @ingroup constants 63 | */ 64 | 65 | /** 66 | * @defgroup globals Global Variables 67 | * @ingroup constants 68 | */ 69 | 70 | /** 71 | * @defgroup exceptions Exceptions 72 | * @ingroup constants 73 | */ 74 | 75 | /* Exceptions */ 76 | extern NSString *PLCrashReporterException; 77 | 78 | /* Error Domain and Codes */ 79 | extern NSString *PLCrashReporterErrorDomain; 80 | 81 | /** 82 | * NSError codes in the Plausible Crash Reporter error domain. 83 | * @ingroup enums 84 | */ 85 | typedef enum { 86 | /** An unknown error has occured. If this 87 | * code is received, it is a bug, and should be reported. */ 88 | PLCrashReporterErrorUnknown = 0, 89 | 90 | /** An Mach or POSIX operating system error has occured. The underlying NSError cause may be fetched from the userInfo 91 | * dictionary using the NSUnderlyingErrorKey key. */ 92 | PLCrashReporterErrorOperatingSystem = 1, 93 | 94 | /** The crash report log file is corrupt or invalid */ 95 | PLCrashReporterErrorCrashReportInvalid = 2, 96 | 97 | /** An attempt to use a resource which was in use at the time in a manner which would have conflicted with the request. */ 98 | PLCrashReporterErrorResourceBusy = 3, 99 | 100 | /** The requested resource could not be found. */ 101 | PLCRashReporterErrorNotFound = 4, 102 | 103 | /** Allocation failed. */ 104 | PLCRashReporterErrorInsufficientMemory = 4 105 | } PLCrashReporterError; 106 | 107 | 108 | /* Library Imports */ 109 | #import "PLCrashReporter.h" 110 | #import "PLCrashReport.h" 111 | #import "PLCrashReportTextFormatter.h" 112 | 113 | /** 114 | * @mainpage Plausible Crash Reporter 115 | * 116 | * @section intro_sec Introduction 117 | * 118 | * Plausile CrashReporter implements in-process crash reporting on the iPhone and Mac OS X. 119 | * 120 | * The following features are supported: 121 | * 122 | * - Implemented as an in-process signal handler. 123 | * - Does not interfer with debugging in gdb.. 124 | * - Handles both uncaught Objective-C exceptions and fatal signals (SIGSEGV, SIGBUS, etc). 125 | * - Full thread state for all active threads (backtraces, register dumps) is provided. 126 | * 127 | * If your application crashes, a crash report will be written. When the application is next run, you may check for a 128 | * pending crash report, and submit the report to your own HTTP server, send an e-mail, or even introspect the 129 | * report locally. 130 | * 131 | * @section intro_encoding Crash Report Format 132 | * 133 | * Crash logs are encoded using google protobuf, and may be decoded 134 | * using the provided PLCrashReport API. Additionally, the include plcrashutil handles conversion of binary crash reports to the 135 | * symbolicate-compatible iPhone text format. 136 | * 137 | * @section doc_sections Documentation Sections 138 | * - @subpage example_usage_iphone 139 | * - @subpage error_handling 140 | * - @subpage async_safety 141 | */ 142 | 143 | /** 144 | * @page example_usage_iphone Example iPhone Usage 145 | * 146 | * @code 147 | * // 148 | * // Called to handle a pending crash report. 149 | * // 150 | * - (void) handleCrashReport { 151 | * PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; 152 | * NSData *crashData; 153 | * NSError *error; 154 | * 155 | * // Try loading the crash report 156 | * crashData = [crashReporter loadPendingCrashReportDataAndReturnError: &error]; 157 | * if (crashData == nil) { 158 | * NSLog(@"Could not load crash report: %@", error); 159 | * goto finish; 160 | * } 161 | * 162 | * // We could send the report from here, but we'll just print out 163 | * // some debugging info instead 164 | * PLCrashReport *report = [[[PLCrashReport alloc] initWithData: crashData error: &error] autorelease]; 165 | * if (report == nil) { 166 | * NSLog(@"Could not parse crash report"); 167 | * goto finish; 168 | * } 169 | * 170 | * NSLog(@"Crashed on %@", report.systemInfo.timestamp); 171 | * NSLog(@"Crashed with signal %@ (code %@, address=0x%" PRIx64 ")", report.signalInfo.name, 172 | * report.signalInfo.code, report.signalInfo.address); 173 | * 174 | * // Purge the report 175 | * finish: 176 | * [crashReporter purgePendingCrashReport]; 177 | * return; 178 | * } 179 | * 180 | * // from UIApplicationDelegate protocol 181 | * - (void) applicationDidFinishLaunching: (UIApplication *) application { 182 | * PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; 183 | * NSError *error; 184 | * 185 | * // Check if we previously crashed 186 | * if ([crashReporter hasPendingCrashReport]) 187 | * [self handleCrashReport]; 188 | 189 | * // Enable the Crash Reporter 190 | * if (![crashReporter enableCrashReporterAndReturnError: &error]) 191 | * NSLog(@"Warning: Could not enable crash reporter: %@", error); 192 | * 193 | * } 194 | * @endcode 195 | * 196 | */ 197 | 198 | /** 199 | * @page error_handling Error Handling Programming Guide 200 | * 201 | * Where a method may return an error, Plausible Crash Reporter provides access to the underlying 202 | * cause via an optional NSError argument. 203 | * 204 | * All returned errors will be a member of one of the below defined domains, however, new domains and 205 | * error codes may be added at any time. If you do not wish to report on the error cause, many methods 206 | * support a simple form that requires no NSError argument. 207 | * 208 | * @section error_domains Error Domains, Codes, and User Info 209 | * 210 | * @subsection crashreporter_errors Crash Reporter Errors 211 | * 212 | * Any errors in Plausible Crash Reporter use the #PLCrashReporterErrorDomain error domain, and and one 213 | * of the error codes defined in #PLCrashReporterError. 214 | */ 215 | 216 | /** 217 | * @page async_safety Async-Safe Programming Guide 218 | * 219 | * Plausible CrashReporter provides support for executing an application specified function in the context of the 220 | * crash reporter's signal handler, after the crash report has been written to disk. This was a regularly requested 221 | * feature, and provides the ability to implement application finalization in the event of a crash. However, writing 222 | * code intended for execution inside of a signal handler is exceptionally difficult, and is not recommended. 223 | * 224 | * @section program_flow Program Flow and Signal Handlers 225 | * 226 | * When the signal handler is called the normal flow of the program is interrupted, and your program is an unknown 227 | * state. Locks may be held, the heap may be corrupt (or in the process of being updated), and your signal 228 | * handler may invoke a function that was being executed at the time of the signal. This may result in deadlocks, 229 | * data corruption, and program termination. 230 | * 231 | * @section functions Async-Safe Functions 232 | * 233 | * A subset of functions are defined to be async-safe by the OS, and are safely callable from within a signal handler. If 234 | * you do implement a custom post-crash handler, it must be async-safe. A table of POSIX-defined async-safe functions 235 | * and additional information is available from the 236 | * CERT programming guide - SIG30-C 237 | * 238 | * Most notably, the Objective-C runtime itself is not async-safe, and Objective-C may not be used within a signal 239 | * handler. 240 | * 241 | * @sa PLCrashReporter::setCrashCallbacks: 242 | */ 243 | 244 | /** 245 | * @page mach_exceptions Mach Exceptions on Mac OS X and iOS 246 | * 247 | * PLCrashReporter includes support for monitoring crashes via an in-process Mach exception handler. There are a small 248 | * number of crash cases that will not be caught with via a POSIX signal handler, but can be caught via a Mach 249 | * exception handler: 250 | * 251 | * - Stack overflow. sigaltstack() is broken in later iOS releases, and even if functional, must be configured 252 | * on a per-thread basis. 253 | * - Internal Apple assertions that call libSystem's __assert. These include compiler-checked constraints 254 | * for built-in functions, such as strcpy_chk(). The __abort() implementation actually disables the SIGABRT 255 | * signal handler (resetting it to SIG_DFL) prior to to issueing a SIGABRT, bypassing signal-based crash 256 | * reporters entirely. 257 | * 258 | * Unfortunately, the latter issue (__assert) can not be handled on iOS; trapping abort requires that 259 | * a Mach exception handler operate out-of-process, which is impossible on iOS. On Mac OS X, this will 260 | * only be handled once we've implemented fully out-of-process crash excution. 261 | * 262 | * On Mac OS X, the Mach exception implementation is fully supported using entirely public API. On iOS, 263 | * the APIs required are not fully public -- more details on the implications of this for exception handling on 264 | * iOS may be found in @ref mach_exceptions_ios below. It is worth noting that even where the Mach exception APIs 265 | * are fully supported, kernel-internal constants, as well 266 | * as architecture-specific trap information, may be required to fully interpret a Mach exception's root cause. 267 | * 268 | * For example, the EXC_SOFTWARE exception is dispatched for four different failure types, using the exception 269 | * code to differentiate failure types: 270 | * - Non-existent system call invoked (SIGSYS) 271 | * - Write on a pipe with no reader (SIGPIPE) 272 | * - Abort program (SIGABRT -- unused) 273 | * - Kill program (SIGKILL) 274 | * 275 | * Of those four types, only the constant required to interpret the SIGKILL behavior (EXC_SOFT_SIGNAL) is publicly defined. 276 | * Of the remaining three failure types, the constant values are kernel implementation-private, defined only in the available 277 | * kernel sources. On iOS, these sources are unavailable, and while they generally do match the Mac OS X implementation, there 278 | * are no gaurantees that this is -- or will remain -- the case in the future. 279 | * 280 | * Likewise, interpretation of particular fault types requires information regarding the underlying machine traps 281 | * that triggered the Mach exceptions. For example, a floating point trap on x86/x86-64 will trigger an EXC_ARITHMETIC, 282 | * with a subcode value containing the value of the FPU status register. Determining the exact FPU cause requires 283 | * extracting the actual exception flags from status register as per the x86 architecture documentation. The exact format 284 | * of this subcode value is not actually documented outside the kernel, and may change in future releases. 285 | * 286 | * While we have the advantage of access to the x86 kernel sources, the situation on ARM is even less clear. The actual 287 | * use of the Mach exception codes and subcodes is largely undefined by both headers and publicly available documentation, 288 | * and the available x86 kernel sources are of little use in interpreting this data. 289 | * 290 | * As such, while Mach exceptions may catch some cases that BSD signals can not, they are not a perfect solution, 291 | * and may also provide less insight into the actual failures that occur. By comparison, the BSD signal interface 292 | * is both fully defined and architecture independent, with any necessary interpretation of the Mach exception 293 | * codes handled in-kernel at the time of exception dispatch. It is generally recommended by Apple as the preferred 294 | * interface, and should generally be preferred by PLCrashReporter API clients. 295 | * 296 | * @section mach_exceptions_compatibility Compatibility Issues 297 | * 298 | * @subsection Debuggers 299 | * 300 | * Enabling in-process Mach exception handlers will conflict with any attached debuggers; the debugger 301 | * may suspend the processes Mach exception handling thread, which will result in any exception messages 302 | * sent via the debugger being lost, as the in-process handler will be unable to receive and forward 303 | * the messages. 304 | * 305 | * @subsection Managed Runtimes (Xamarin, Unity) 306 | * 307 | * A Mach exception handler may conflict with any managed runtime that registers a BSD signal handler that 308 | * can safely handle otherwise fatal signals, allowing execution to proceed. This includes products 309 | * such as Xamarin for iOS. 310 | * 311 | * In such a case, PLCrashReporter will write a crash report for non-fatal signals, as there is no 312 | * immediate mechanism for determining whether a signal handler exists and that it can safely 313 | * handle the failure. This can result in unexpected delays in application execution, increased I/O to 314 | * disk, and other undesirable operations. 315 | * 316 | * @section mach_exceptions_ios Mach Exceptions on iOS 317 | * 318 | * The APIs required for Mach exception handling are not fully public on iOS. After filing a request with 319 | * Apple DTS to clarify the status of the Mach exception APIs on iOS, and implementing a Mach Exception 320 | * handler using only supported API, they provided the following guidance: 321 | * 322 | * Our engineers have reviewed your request and have determined that this would be best handled as a bug report, 323 | * which you have already filed. There is no documented way of accomplishing this, nor is there a workaround 324 | * possible. 325 | * 326 | * Due to user request, PLCrashReporter provides an optional implementation of Mach exception handling for both 327 | * iOS and Mac OS X. 328 | * 329 | * This implementation uses only supported API on Mac OS X, and depends on limited undefined API on iOS. The reporter 330 | * may be excluded entirely at build time by modifying the PLCRASH_FEATURE_MACH_EXCEPTIONS build configuration; it 331 | * may also be disabled at runtime by configuring the PLCrashReporter instance appropriately via PLCrashReporterConfig. 332 | * 333 | * The iOS implementation is implemented almost entirely using public API, and links against no actual private symbols; 334 | * the use of undocumented functionality is limited to assuming the use of specific msgh_id values (see below 335 | * for details). As a result, it may be considered perfectly safe to include the Mach Exception code in the 336 | * standard build, and enable/disable it at runtime. 337 | * 338 | * The following issues exist in the iOS implementation: 339 | * - The msgh_id values required for an exception reply message are not available from the available 340 | * headers and must be hard-coded. This prevents one from safely replying to exception messages, which 341 | * means that it is impossible to (correctly) inform the server that an exception has *not* been 342 | * handled. 343 | * 344 | * Impact: 345 | * This can lead to the process locking up and not dispatching to the host exception handler (eg, Apple's 346 | * crash reporter), depending on the behavior of the kernel exception code. 347 | * 348 | * - The mach_* structure/type variants required by MACH_EXCEPTION_CODES are not publicly defined (on Mac OS X, 349 | * these are provided by mach_exc.defs). This prevents one from forwarding exception messages to an existing 350 | * handler that was registered with a MACH_EXCEPTION_CODES behavior (eg, forwarding is entirely non-functional 351 | * on ARM64 devices). 352 | * 353 | * Impact: 354 | * This can break forwarding to any task exception handler that registers itself with MACH_EXCEPTION_CODES, 355 | * including other handlers registered within the current process, eg, by a managed runtime. This could 356 | * also result in misinterpretation of a Mach exception message, in the case where the message format is 357 | * modified by Apple to be incompatible with the existing 32-bit format. 358 | * 359 | * This is the case with LLDB; it will register a task exception handler with MACH_EXCEPTION_CODES set. Failure 360 | * to correctly forward these exceptions will result in the debugger breaking in interesting ways; for example, 361 | * changes to the set of dyld-loaded images are detected by setting a breakpoint on the dyld image registration 362 | * funtions, and this functionality will break if the exception is not correctly forwarded. 363 | * 364 | * Since Mach exception handling is important for a fully functional crash reporter, we have also filed a radar 365 | * to request that the API be made public: 366 | * Radar: rdar://12939497 RFE: Provide mach_exc.defs for iOS 367 | * 368 | * At the time of this writing, the radar remains open/unresolved. 369 | */ 370 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/A/Headers/PLCrashAsyncSignalInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #ifndef PLCRASH_ASYNC_SIGNAL_INFO_H 30 | #define PLCRASH_ASYNC_SIGNAL_INFO_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /** 37 | * @internal 38 | * 39 | * @defgroup plcrash_async_signal_info Signal Information 40 | * @ingroup plcrash_async 41 | * 42 | * Provides mapping of signal number and code to strings. 43 | * 44 | * @{ 45 | */ 46 | 47 | const char *plcrash_async_signal_signame (int signal); 48 | const char *plcrash_async_signal_sigcode (int signal, int si_code); 49 | 50 | /** 51 | * @} plcrash_async_signal_info 52 | */ 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif /* PLCRASH_ASYNC_SIGNAL_INFO_H */ 59 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/A/Headers/PLCrashFeatureConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #ifndef PLCRASH_FEATURE_CONFIG_H 30 | #define PLCRASH_FEATURE_CONFIG_H 31 | 32 | #include 33 | 34 | /** 35 | * @internal 36 | * 37 | * Build-time configuration for PLCrashReporter. 38 | * 39 | * This is used to automatically enable/disable features on a per-platform and per-configuration 40 | * basis; it may also be used by third-party vendors to configure a custom build of PLCrashReporter. 41 | * 42 | * @defgroup build_config Build Configuration 43 | * @ingroup constants 44 | * @{ 45 | */ 46 | 47 | /* 48 | * Defaults 49 | */ 50 | 51 | /* 52 | * For release builds, disable unused unwind implementations on targets that do not use them. For non-release 53 | * builds, we include the unwind implementations to allow testing on a broader range of targets. 54 | */ 55 | #ifdef PLCF_RELEASE_BUILD 56 | # if defined(__arm__) 57 | # ifndef PLCRASH_FEATURE_UNWIND_DWARF 58 | # define PLCRASH_FEATURE_UNWIND_DWARF 0 59 | # endif 60 | # ifndef PLCRASH_FEATURE_UNWIND_COMPACT 61 | # define PLCRASH_FEATURE_UNWIND_COMPACT 0 62 | # endif 63 | # endif 64 | #endif 65 | 66 | /* 67 | * Configuration Flags 68 | */ 69 | 70 | 71 | #ifndef PLCRASH_FEATURE_MACH_EXCEPTIONS 72 | /** 73 | * If true, enable Mach exception support. On Mac OS X, the Mach exception implementation is fully supported, 74 | * using publicly available API. On iOS, the APIs required for a complete implementation are not public. However, a 75 | * popular commercial crash reporter is now shipping with support for Mach exceptions, which implies that either 76 | * they've received special dispensation to use private APIs / private structures, they've found another way to do 77 | * it, or they're just using undocumented functionality and hoping for the best. 78 | * 79 | * The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to 80 | * implement Mach exception handling regardless of concerns over API visiblity. Given this, we've enabled 81 | * Mach exception handling by default, and provided both build-time and runtime configuration 82 | * to disable its use. 83 | * 84 | * For more information on the potential issues with enabling mach exception support, @sa @ref mach_exceptions. 85 | */ 86 | # define PLCRASH_FEATURE_MACH_EXCEPTIONS 1 87 | #endif 88 | 89 | #ifndef PLCRASH_FEATURE_UNWIND_DWARF 90 | /** If true, enable DWARF unwinding support. */ 91 | # define PLCRASH_FEATURE_UNWIND_DWARF 1 92 | #endif 93 | 94 | 95 | #ifndef PLCRASH_FEATURE_UNWIND_COMPACT 96 | /** If true, enable compact unwinding support. */ 97 | # define PLCRASH_FEATURE_UNWIND_COMPACT 1 98 | #endif 99 | 100 | /** 101 | * @} 102 | */ 103 | 104 | #endif /* PLCRASH_FEATURE_CONFIG_H */ 105 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/A/Headers/PLCrashMacros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2013 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #ifndef PLCRASH_CONSTANTS_H 30 | #define PLCRASH_CONSTANTS_H 31 | 32 | #include 33 | 34 | #if defined(__cplusplus) 35 | # define PLCR_EXPORT extern "C" 36 | # define PLCR_C_BEGIN_DECLS extern "C" { 37 | # define PLCR_C_END_DECLS } 38 | #else 39 | # define PLCR_EXPORT extern 40 | # define PLCR_C_BEGIN_DECLS 41 | # define PLCR_C_END_DECLS 42 | #endif 43 | 44 | #if defined(__cplusplus) 45 | # if defined(PLCRASHREPORTER_PREFIX) 46 | /** @internal Define the plcrash namespace, automatically inserting an inline namespace containing the configured PLCRASHREPORTER_PREFIX, if any. */ 47 | # define PLCR_CPP_BEGIN_NS namespace plcrash { inline namespace PLCRASHREPORTER_PREFIX { 48 | 49 | /** @internal Close the definition of the `plcrash` namespace (and the PLCRASHREPORTER_PREFIX inline namespace, if any). */ 50 | # define PLCR_CPP_END_NS }} 51 | # else 52 | # define PLCR_CPP_BEGIN_NS namespace plcrash { 53 | # define PLCR_CPP_END_NS } 54 | # endif 55 | # 56 | /** @internal Define the plcrash::async namespace, automatically inserting an inline namespace containing the configured PLCRASHREPORTER_PREFIX, if any. */ 57 | # define PLCR_CPP_BEGIN_ASYNC_NS PLCR_CPP_BEGIN_NS namespace async { 58 | 59 | /** @internal Close the definition of the `plcrash::async` namespace (and the PLCRASHREPORTER_PREFIX inline namespace, if any). */ 60 | # define PLCR_CPP_END_ASYNC_NS PLCR_CPP_END_NS } 61 | #endif 62 | 63 | #ifdef __clang__ 64 | # define PLCR_PRAGMA_CLANG(_p) _Pragma(_p) 65 | #else 66 | # define PLCR_PRAGMA_CLANG(_p) 67 | #endif 68 | 69 | #ifdef __clang__ 70 | # define PLCR_DEPRECATED __attribute__((deprecated)) 71 | #else 72 | # define PLCR_DEPRECATED 73 | #endif 74 | 75 | #if defined(__clang__) || defined(__GNUC__) 76 | # define PLCR_UNUSED __attribute__((unused)) 77 | #else 78 | # define PLCR_UNUSED 79 | #endif 80 | 81 | #ifdef PLCR_PRIVATE 82 | /** 83 | * Marks a definition as deprecated only for for external clients, allowing 84 | * uses of it internal fo the framework. 85 | */ 86 | # define PLCR_EXTERNAL_DEPRECATED 87 | 88 | /** 89 | * @internal 90 | * A macro to put above a definition marked PLCR_EXTERNAL_DEPRECATED that will 91 | * silence warnings about there being a deprecation documentation marker but the 92 | * definition not being marked deprecated. 93 | */ 94 | # define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() \ 95 | PLCR_PRAGMA_CLANG("clang diagnostic push"); \ 96 | PLCR_PRAGMA_CLANG("clang diagnostic ignored \"-Wdocumentation-deprecated-sync\"") 97 | 98 | /** 99 | * @internal 100 | * A macro to put below a definition marked PLCR_EXTERNAL_DEPRECATED that will 101 | * silence warnings about there being a deprecation documentation marker but the 102 | * definition not being marked deprecated. 103 | */ 104 | # define PLCR_EXTERNAL_DEPRECATED_NOWARN_POP() PLCR_PRAGMA_CLANG("clang diagnostic pop") 105 | 106 | #else 107 | 108 | # define PLCR_EXTERNAL_DEPRECATED PLCR_DEPRECATED 109 | # define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() 110 | # define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() 111 | 112 | #endif /* PLCR_PRIVATE */ 113 | 114 | #ifdef PLCR_PRIVATE 115 | # if defined(__clang__) && __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough") 116 | # define PLCR_FALLTHROUGH [[clang::fallthrough]] 117 | # else 118 | # define PLCR_FALLTHROUGH do {} while (0) 119 | # endif 120 | #endif 121 | 122 | #ifdef PLCR_PRIVATE 123 | /** 124 | * @internal 125 | * Static compile-time assertion. 126 | * 127 | * @param name The assertion name; must be valid for use within a C identifier. 128 | * @param cond Assertion condition 129 | */ 130 | # define PLCR_ASSERT_STATIC(name, cond) PLCR_ASSERT_STATIC_(name, cond, __LINE__) 131 | /* 132 | * C++11 and C11 both provide a static_assert(). 133 | * 134 | * Otherwise, we have to use typedef-based static assertions. 135 | */ 136 | # if (defined(__cplusplus) && __cplusplus >= 201103L) || (!defined(__cplusplus) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) 137 | # define PLCR_ASSERT_STATIC_(name, cond, line) PLCR_ASSERT_STATIC__(#name, cond) 138 | # define PLCR_ASSERT_STATIC__(name, cond) static_assert(cond, #name) 139 | # else 140 | # define PLCR_ASSERT_STATIC_(name, cond, line) PLCR_ASSERT_STATIC__(name, cond, line) 141 | # define PLCR_ASSERT_STATIC__(name, cond, line) typedef int plcf_static_assert_##name##_##line [(cond) ? 1 : -1] PLCR_UNUSED 142 | # endif 143 | #endif /* PLCR_PRIVATE */ 144 | 145 | #endif /* PLCRASH_CONSTANTS_H */ 146 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/A/Headers/PLCrashReport.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | 31 | #import "PLCrashReportApplicationInfo.h" 32 | #import "PLCrashReportBinaryImageInfo.h" 33 | #import "PLCrashReportExceptionInfo.h" 34 | #import "PLCrashReportMachineInfo.h" 35 | #import "PLCrashReportMachExceptionInfo.h" 36 | #import "PLCrashReportProcessInfo.h" 37 | #import "PLCrashReportProcessorInfo.h" 38 | #import "PLCrashReportRegisterInfo.h" 39 | #import "PLCrashReportSignalInfo.h" 40 | #import "PLCrashReportStackFrameInfo.h" 41 | #import "PLCrashReportSymbolInfo.h" 42 | #import "PLCrashReportSystemInfo.h" 43 | #import "PLCrashReportThreadInfo.h" 44 | 45 | /** 46 | * @ingroup constants 47 | * Crash file magic identifier */ 48 | #define PLCRASH_REPORT_FILE_MAGIC "plcrash" 49 | 50 | /** 51 | * @ingroup constants 52 | * Crash format version byte identifier. Will not change outside of the introduction of 53 | * an entirely new crash log format. */ 54 | #define PLCRASH_REPORT_FILE_VERSION 1 55 | 56 | /** 57 | * @ingroup types 58 | * Crash log file header format. 59 | * 60 | * Crash log files start with 7 byte magic identifier (#PLCRASH_REPORT_FILE_MAGIC), 61 | * followed by a single unsigned byte version number (#PLCRASH_REPORT_FILE_VERSION). 62 | * The crash log message format itself is extensible, so this version number will only 63 | * be incremented in the event of an incompatible encoding or format change. 64 | */ 65 | struct PLCrashReportFileHeader { 66 | /** Crash log magic identifier, not NULL terminated */ 67 | const char magic[7]; 68 | 69 | /** Crash log encoding/format version */ 70 | const uint8_t version; 71 | 72 | /** File data */ 73 | const uint8_t data[]; 74 | } __attribute__((packed)); 75 | 76 | 77 | /** 78 | * @internal 79 | * Private decoder instance variables (used to hide the underlying protobuf parser). 80 | */ 81 | typedef struct _PLCrashReportDecoder _PLCrashReportDecoder; 82 | 83 | @interface PLCrashReport : NSObject { 84 | @private 85 | /** Private implementation variables (used to hide the underlying protobuf parser) */ 86 | _PLCrashReportDecoder *_decoder; 87 | 88 | /** System info */ 89 | PLCrashReportSystemInfo *_systemInfo; 90 | 91 | /** Machine info */ 92 | PLCrashReportMachineInfo *_machineInfo; 93 | 94 | /** Application info */ 95 | PLCrashReportApplicationInfo *_applicationInfo; 96 | 97 | /** Process info */ 98 | PLCrashReportProcessInfo *_processInfo; 99 | 100 | /** Signal info */ 101 | PLCrashReportSignalInfo *_signalInfo; 102 | 103 | /** Mach exception info */ 104 | PLCrashReportMachExceptionInfo *_machExceptionInfo; 105 | 106 | /** Thread info (PLCrashReportThreadInfo instances) */ 107 | NSArray *_threads; 108 | 109 | /** Binary images (PLCrashReportBinaryImageInfo instances */ 110 | NSArray *_images; 111 | 112 | /** Exception information (may be nil) */ 113 | PLCrashReportExceptionInfo *_exceptionInfo; 114 | 115 | /** Report UUID */ 116 | CFUUIDRef _uuid; 117 | } 118 | 119 | - (id) initWithData: (NSData *) encodedData error: (NSError **) outError; 120 | 121 | - (PLCrashReportBinaryImageInfo *) imageForAddress: (uint64_t) address; 122 | 123 | /** 124 | * System information. 125 | */ 126 | @property(nonatomic, readonly) PLCrashReportSystemInfo *systemInfo; 127 | 128 | /** 129 | * YES if machine information is available. 130 | */ 131 | @property(nonatomic, readonly) BOOL hasMachineInfo; 132 | 133 | /** 134 | * Machine information. Only available in later (v1.1+) crash report format versions. If not available, 135 | * will be nil. 136 | */ 137 | @property(nonatomic, readonly) PLCrashReportMachineInfo *machineInfo; 138 | 139 | /** 140 | * Application information. 141 | */ 142 | @property(nonatomic, readonly) PLCrashReportApplicationInfo *applicationInfo; 143 | 144 | /** 145 | * YES if process information is available. 146 | */ 147 | @property(nonatomic, readonly) BOOL hasProcessInfo; 148 | 149 | /** 150 | * Process information. Only available in later (v1.1+) crash report format versions. If not available, 151 | * will be nil. 152 | */ 153 | @property(nonatomic, readonly) PLCrashReportProcessInfo *processInfo; 154 | 155 | /** 156 | * Signal information. This provides the signal and signal code of the fatal signal. 157 | */ 158 | @property(nonatomic, readonly) PLCrashReportSignalInfo *signalInfo; 159 | 160 | /** 161 | * Mach exception information, if available. This will only be included in the 162 | * case that encoding crash reporter's exception-based reporting was enabled, and a Mach 163 | * exception was caught. 164 | * 165 | * @warning If Mach exception information is available, the legacy signalInfo property will also be provided; this 166 | * s required to maintain backwards compatibility with the established API. Note, however, that the signal info may be derived from the 167 | * Mach exception info by the encoding crash reporter, and thus may not exactly match the kernel exception-to-signal 168 | * mappings implemented in xnu. As such, when Mach exception info is available, its use should be preferred. 169 | */ 170 | @property(nonatomic, readonly) PLCrashReportMachExceptionInfo *machExceptionInfo; 171 | 172 | /** 173 | * Thread information. Returns a list of PLCrashReportThreadInfo instances. 174 | */ 175 | @property(nonatomic, readonly) NSArray *threads; 176 | 177 | /** 178 | * Binary image information. Returns a list of PLCrashReportBinaryImageInfo instances. 179 | */ 180 | @property(nonatomic, readonly) NSArray *images; 181 | 182 | /** 183 | * YES if exception information is available. 184 | */ 185 | @property(nonatomic, readonly) BOOL hasExceptionInfo; 186 | 187 | /** 188 | * Exception information. Only available if a crash was caused by an uncaught exception, 189 | * otherwise nil. 190 | */ 191 | @property(nonatomic, readonly) PLCrashReportExceptionInfo *exceptionInfo; 192 | 193 | /** 194 | * A client-generated 16-byte UUID. May be used to filter duplicate reports submitted or generated 195 | * by a single client. Only available in later (v1.2+) crash report format versions. If not available, 196 | * will be NULL. 197 | */ 198 | @property(nonatomic, readonly) CFUUIDRef uuidRef; 199 | 200 | @end 201 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/A/Headers/PLCrashReportApplicationInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | 31 | @interface PLCrashReportApplicationInfo : NSObject { 32 | @private 33 | /** Application identifier */ 34 | NSString *_applicationIdentifier; 35 | 36 | /** Application version */ 37 | NSString *_applicationVersion; 38 | 39 | /** Application marketing version */ 40 | NSString *_applicationMarketingVersion; 41 | } 42 | 43 | - (id) initWithApplicationIdentifier: (NSString *) applicationIdentifier 44 | applicationVersion: (NSString *) applicationVersion 45 | applicationMarketingVersion: (NSString *) applicationMarketingVersion; 46 | 47 | /** 48 | * The application identifier. This is usually the application's CFBundleIdentifier value. 49 | */ 50 | @property(nonatomic, readonly) NSString *applicationIdentifier; 51 | 52 | /** 53 | * The application version. This is usually the application's CFBundleVersion value. 54 | */ 55 | @property(nonatomic, readonly) NSString *applicationVersion; 56 | 57 | /** 58 | * The application marketing version. This is usually the application's CFBundleShortVersionString value if available. May be nil. 59 | */ 60 | @property(nonatomic, readonly) NSString *applicationMarketingVersion; 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/A/Headers/PLCrashReportBinaryImageInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | #import "PLCrashReportProcessorInfo.h" 31 | 32 | @interface PLCrashReportBinaryImageInfo : NSObject { 33 | @private 34 | /** Code type */ 35 | PLCrashReportProcessorInfo *_processorInfo; 36 | 37 | /** Base image address */ 38 | uint64_t _baseAddress; 39 | 40 | /** Image segment size */ 41 | uint64_t _imageSize; 42 | 43 | /** Name of binary image */ 44 | NSString *_imageName; 45 | 46 | /** If the UUID is available */ 47 | BOOL _hasImageUUID; 48 | 49 | /** 128-bit object UUID. May be nil. */ 50 | NSString *_imageUUID; 51 | } 52 | 53 | - (id) initWithCodeType: (PLCrashReportProcessorInfo *) processorInfo 54 | baseAddress: (uint64_t) baseAddress 55 | size: (uint64_t) imageSize 56 | name: (NSString *) imageName 57 | uuid: (NSData *) uuid; 58 | 59 | /** 60 | * Image code type, or nil if unavailable. 61 | */ 62 | @property(nonatomic, readonly) PLCrashReportProcessorInfo *codeType; 63 | 64 | /** 65 | * Image base address. 66 | */ 67 | @property(nonatomic, readonly) uint64_t imageBaseAddress; 68 | 69 | /** 70 | * Segment size. 71 | */ 72 | @property(nonatomic, readonly) uint64_t imageSize; 73 | 74 | /** 75 | * Image name (absolute path) 76 | */ 77 | @property(nonatomic, readonly) NSString *imageName; 78 | 79 | 80 | /** 81 | * YES if this image has an associated UUID. 82 | */ 83 | @property(nonatomic, readonly) BOOL hasImageUUID; 84 | 85 | /** 86 | * 128-bit object UUID (matches Mach-O DWARF dSYM files). May be nil if unavailable. 87 | */ 88 | @property(nonatomic, readonly) NSString *imageUUID; 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/A/Headers/PLCrashReportExceptionInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | #import "PLCrashReportThreadInfo.h" 31 | 32 | 33 | @interface PLCrashReportExceptionInfo : NSObject { 34 | @private 35 | /** Name */ 36 | NSString *_name; 37 | 38 | /** Reason */ 39 | NSString *_reason; 40 | 41 | /** Ordered list of PLCrashReportStackFrame instances, or nil if unavailable. */ 42 | NSArray *_stackFrames; 43 | } 44 | 45 | - (id) initWithExceptionName: (NSString *) name reason: (NSString *) reason; 46 | 47 | - (id) initWithExceptionName: (NSString *) name 48 | reason: (NSString *) reason 49 | stackFrames: (NSArray *) stackFrames; 50 | 51 | /** 52 | * The exception name. 53 | */ 54 | @property(nonatomic, readonly) NSString *exceptionName; 55 | 56 | /** 57 | * The exception reason. 58 | */ 59 | @property(nonatomic, readonly) NSString *exceptionReason; 60 | 61 | /* The exception's original call stack, as an array of PLCrashReportStackFrameInfo instances, or nil if unavailable. 62 | * This may be preserved across rethrow of an exception, and can be used to determine the original call stack. */ 63 | @property(nonatomic, readonly) NSArray *stackFrames; 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/A/Headers/PLCrashReportFormatter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | 31 | #import "PLCrashReport.h" 32 | 33 | /** 34 | * A crash report formatter accepts a PLCrashReport instance, formats it according to implementation-specified rules, 35 | * (such as implementing text output support), and returns the result. 36 | */ 37 | @protocol PLCrashReportFormatter 38 | 39 | /** 40 | * Format the provided @a report. 41 | * 42 | * @param report Report to be formatted. 43 | * @param outError A pointer to an NSError object variable. If an error occurs, this pointer will contain an error 44 | * object indicating why the pending crash report could not be formatted. If no error occurs, this parameter will 45 | * be left unmodified. You may specify nil for this parameter, and no error information will be provided. 46 | * 47 | * @return Returns the formatted report data on success, or nil on failure. 48 | */ 49 | - (NSData *) formatReport: (PLCrashReport *) report error: (NSError **) outError; 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachExceptionInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2013 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | 31 | @interface PLCrashReportMachExceptionInfo : NSObject { 32 | @private 33 | /** The Mach exception type. */ 34 | uint64_t _type; 35 | 36 | /** The Mach exception codes, represented as an ordered array of NSNumber instances. */ 37 | NSArray *_codes; 38 | } 39 | 40 | - (id) initWithType: (uint64_t) type codes: (NSArray *) codes; 41 | 42 | /** The Mach exception type. */ 43 | @property(nonatomic, readonly) uint64_t type; 44 | 45 | /** The Mach exception codes, represented as an ordered array of 64-bit unsigned NSNumber instances. */ 46 | @property(nonatomic, readonly) NSArray *codes; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachineInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | 31 | #import "PLCrashReportProcessorInfo.h" 32 | 33 | @interface PLCrashReportMachineInfo : NSObject { 34 | @private 35 | /** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */ 36 | NSString *_modelName; 37 | 38 | /** The processor type. */ 39 | PLCrashReportProcessorInfo *_processorInfo; 40 | 41 | /* The number of actual physical processor cores. */ 42 | NSUInteger _processorCount; 43 | 44 | /* The number of logical processors. */ 45 | NSUInteger _logicalProcessorCount; 46 | } 47 | 48 | - (id) initWithModelName: (NSString *) modelName 49 | processorInfo: (PLCrashReportProcessorInfo *) processorInfo 50 | processorCount: (NSUInteger) processorCount 51 | logicalProcessorCount: (NSUInteger) logicalProcessorCount; 52 | 53 | /** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */ 54 | @property(nonatomic, readonly) NSString *modelName; 55 | 56 | /** The processor type. This will be unavailable in reports generated prior to PLCrashReporter 1.2, in which case this property will be nil. */ 57 | @property(nonatomic, readonly) PLCrashReportProcessorInfo *processorInfo; 58 | 59 | /* 60 | * The number of actual physical processor cores. Note that the number of active processors may be managed by the 61 | * operating system's power management system, and this value may not reflect the number of active 62 | * processors at the time of the crash. 63 | */ 64 | @property(nonatomic, readonly) NSUInteger processorCount; 65 | 66 | /* 67 | * The number of logical processors. Note that the number of active processors may be managed by the 68 | * operating system's power management system, and this value may not reflect the number of active 69 | * processors at the time of the crash. 70 | */ 71 | @property(nonatomic, readonly) NSUInteger logicalProcessorCount; 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Damian Morris 3 | * 4 | * Copyright (c) 2010 MOSO Corporation, Pty Ltd. 5 | * Copyright (c) 2010-2013 Plausible Labs Cooperative, Inc. 6 | * 7 | * All rights reserved. 8 | * 9 | * Permission is hereby granted, free of charge, to any person 10 | * obtaining a copy of this software and associated documentation 11 | * files (the "Software"), to deal in the Software without 12 | * restriction, including without limitation the rights to use, 13 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | * copies of the Software, and to permit persons to whom the 15 | * Software is furnished to do so, subject to the following 16 | * conditions: 17 | * 18 | * The above copyright notice and this permission notice shall be 19 | * included in all copies or substantial portions of the Software. 20 | * 21 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 22 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 23 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 24 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 25 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 26 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 27 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 28 | * OTHER DEALINGS IN THE SOFTWARE. 29 | */ 30 | 31 | #import 32 | 33 | @interface PLCrashReportProcessInfo : NSObject { 34 | @private 35 | /** Process name, or nil if unavailable. */ 36 | NSString *_processName; 37 | 38 | /** Process ID */ 39 | NSUInteger _processID; 40 | 41 | /** Process path */ 42 | NSString* _processPath; 43 | 44 | /** Date and time that the crashing process was started. This may be unavailable, and this property 45 | * will be nil. */ 46 | NSDate *_processStartTime; 47 | 48 | /** Parent process name, or nil if unavailable. */ 49 | NSString *_parentProcessName; 50 | 51 | /** Parent process ID */ 52 | NSUInteger _parentProcessID; 53 | 54 | /** If false, the process is being run via process-level CPU emulation (such as Rosetta). */ 55 | BOOL _native; 56 | } 57 | 58 | - (id) initWithProcessName: (NSString *) processName 59 | processID: (NSUInteger) processID 60 | processPath: (NSString *) processPath 61 | processStartTime: (NSDate *) processStartTime 62 | parentProcessName: (NSString *) parentProcessName 63 | parentProcessID: (NSUInteger) parentProcessID 64 | native: (BOOL) native; 65 | 66 | /** 67 | * The process name. This value may not be included in the crash report, in which case this property 68 | * will be nil. 69 | */ 70 | @property(nonatomic, readonly) NSString *processName; 71 | 72 | /** 73 | * The process ID. 74 | */ 75 | @property(nonatomic, readonly) NSUInteger processID; 76 | 77 | /** 78 | * The path to the process executable. This value may not be included in the crash report, in which case this property 79 | * will be nil. 80 | */ 81 | @property(nonatomic, readonly) NSString *processPath; 82 | 83 | /** 84 | * Date and time that the crashing process was started. This value may not be included in the crash report, in which case this property 85 | * will be nil. 86 | */ 87 | @property(nonatomic, readonly) NSDate *processStartTime; 88 | 89 | /** 90 | * The parent process name. This value may not be included in the crash report, in which case this property 91 | * will be nil. 92 | */ 93 | @property(nonatomic, readonly) NSString *parentProcessName; 94 | 95 | /** 96 | * The parent process ID. 97 | */ 98 | @property(nonatomic, readonly) NSUInteger parentProcessID; 99 | 100 | /** The process' native execution status. If false, the process is being run via process-level CPU emulation (such as Rosetta). */ 101 | @property(nonatomic, readonly) BOOL native; 102 | 103 | @end 104 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessorInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | #import 31 | 32 | /** 33 | * @ingroup constants 34 | * 35 | * The type encodings supported for CPU types and subtypes. Currently only Apple 36 | * Mach-O defined encodings are supported. 37 | * 38 | * @internal 39 | * These enum values match the protobuf values. Keep them synchronized. 40 | */ 41 | typedef enum { 42 | /** Unknown cpu type encoding. */ 43 | PLCrashReportProcessorTypeEncodingUnknown = 0, 44 | 45 | /** Apple Mach-defined processor types. */ 46 | PLCrashReportProcessorTypeEncodingMach = 1 47 | } PLCrashReportProcessorTypeEncoding; 48 | 49 | @interface PLCrashReportProcessorInfo : NSObject { 50 | @private 51 | /** Type encoding */ 52 | PLCrashReportProcessorTypeEncoding _typeEncoding; 53 | 54 | /** CPU type */ 55 | uint64_t _type; 56 | 57 | /** CPU subtype */ 58 | uint64_t _subtype; 59 | } 60 | 61 | - (id) initWithTypeEncoding: (PLCrashReportProcessorTypeEncoding) typeEncoding 62 | type: (uint64_t) type 63 | subtype: (uint64_t) subtype; 64 | 65 | /** The CPU type encoding. */ 66 | @property(nonatomic, readonly) PLCrashReportProcessorTypeEncoding typeEncoding; 67 | 68 | /** The CPU type. */ 69 | @property(nonatomic, readonly) uint64_t type; 70 | 71 | /** The CPU subtype. */ 72 | @property(nonatomic, readonly) uint64_t subtype; 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/A/Headers/PLCrashReportRegisterInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | 31 | @interface PLCrashReportRegisterInfo : NSObject { 32 | @private 33 | /** Register name */ 34 | NSString *_registerName; 35 | 36 | /** Register value */ 37 | uint64_t _registerValue; 38 | } 39 | 40 | - (id) initWithRegisterName: (NSString *) registerName registerValue: (uint64_t) registerValue; 41 | 42 | /** 43 | * Register name. 44 | */ 45 | @property(nonatomic, readonly) NSString *registerName; 46 | 47 | /** 48 | * Register value. 49 | */ 50 | @property(nonatomic, readonly) uint64_t registerValue; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/A/Headers/PLCrashReportSignalInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | 31 | @interface PLCrashReportSignalInfo : NSObject { 32 | @private 33 | /** Signal name */ 34 | NSString *_name; 35 | 36 | /** Signal code */ 37 | NSString *_code; 38 | 39 | /** Fauling instruction or address */ 40 | uint64_t _address; 41 | } 42 | 43 | - (id) initWithSignalName: (NSString *) name code: (NSString *) code address: (uint64_t) address; 44 | 45 | /** 46 | * The signal name. 47 | */ 48 | @property(nonatomic, readonly) NSString *name; 49 | 50 | /** 51 | * The signal code. 52 | */ 53 | @property(nonatomic, readonly) NSString *code; 54 | 55 | /** 56 | * The faulting instruction or address. 57 | */ 58 | @property(nonatomic, readonly) uint64_t address; 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/A/Headers/PLCrashReportStackFrameInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | #import "PLCrashReportSymbolInfo.h" 31 | 32 | @interface PLCrashReportStackFrameInfo : NSObject { 33 | @private 34 | /** Frame instruction pointer. */ 35 | uint64_t _instructionPointer; 36 | 37 | /** Symbol information, if available. Otherwise, will be nil. */ 38 | PLCrashReportSymbolInfo *_symbolInfo; 39 | } 40 | 41 | - (id) initWithInstructionPointer: (uint64_t) instructionPointer symbolInfo: (PLCrashReportSymbolInfo *) symbolInfo; 42 | 43 | /** 44 | * Frame's instruction pointer. 45 | */ 46 | @property(nonatomic, readonly) uint64_t instructionPointer; 47 | 48 | /** Symbol information for this frame. 49 | * This may be unavailable, and this property will be nil. */ 50 | @property(nonatomic, readonly) PLCrashReportSymbolInfo *symbolInfo; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/A/Headers/PLCrashReportSymbolInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | 31 | @interface PLCrashReportSymbolInfo : NSObject { 32 | @private 33 | /** The symbol name. */ 34 | NSString *_symbolName; 35 | 36 | /** The symbol start address. */ 37 | uint64_t _startAddress; 38 | 39 | /** The symbol end address, if explicitly defined. Will be 0 if unknown. */ 40 | uint64_t _endAddress; 41 | } 42 | 43 | - (id) initWithSymbolName: (NSString *) symbolName 44 | startAddress: (uint64_t) startAddress 45 | endAddress: (uint64_t) endAddress; 46 | 47 | /** The symbol name. */ 48 | @property(nonatomic, readonly) NSString *symbolName; 49 | 50 | /** The symbol start address. */ 51 | @property(nonatomic, readonly) uint64_t startAddress; 52 | 53 | /* The symbol end address, if explicitly defined. This will only be included if the end address is 54 | * explicitly defined (eg, by DWARF debugging information), will not be derived by best-guess 55 | * heuristics. 56 | * 57 | * If unknown, the address will be 0. 58 | */ 59 | @property(nonatomic, readonly) uint64_t endAddress; 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/A/Headers/PLCrashReportSystemInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | #include "PLCrashMacros.h" 31 | @class PLCrashReportProcessorInfo; 32 | 33 | /** 34 | * @ingroup constants 35 | * 36 | * Indicates the Operating System under which a Crash Log was generated. 37 | * 38 | * @internal 39 | * These enum values match the protobuf values. Keep them synchronized. 40 | */ 41 | typedef enum { 42 | /** Mac OS X. */ 43 | PLCrashReportOperatingSystemMacOSX = 0, 44 | 45 | /** iPhone OS */ 46 | PLCrashReportOperatingSystemiPhoneOS = 1, 47 | 48 | /** iPhone Simulator (Mac OS X with additional simulator-specific runtime libraries) */ 49 | PLCrashReportOperatingSystemiPhoneSimulator = 2, 50 | 51 | /** Unknown operating system */ 52 | PLCrashReportOperatingSystemUnknown = 3, 53 | } PLCrashReportOperatingSystem; 54 | 55 | /** 56 | * @ingroup constants 57 | * 58 | * Indicates the architecture under which a Crash Log was generated. 59 | * 60 | * @note The architecture value has been deprecated in v1.1 and later crash reports. All new reports 61 | * will make use of the new PLCrashReportProcessorInfo CPU type encodings. 62 | * 63 | * @internal 64 | * These enum values match the protobuf values. Keep them synchronized. 65 | */ 66 | typedef enum { 67 | /** x86-32. */ 68 | PLCrashReportArchitectureX86_32 = 0, 69 | 70 | /** x86-64 */ 71 | PLCrashReportArchitectureX86_64 = 1, 72 | 73 | /** ARMv6 */ 74 | PLCrashReportArchitectureARMv6 = 2, 75 | 76 | /** 77 | * ARMv6 78 | * @deprecated This value has been deprecated in favor of ARM subtype-specific 79 | * values. 80 | * @sa PLCrashReportArchitectureARMv6 81 | */ 82 | PLCrashReportArchitectureARM PLCR_DEPRECATED = PLCrashReportArchitectureARMv6, 83 | 84 | /** PPC */ 85 | PLCrashReportArchitecturePPC = 3, 86 | 87 | /** PPC64 */ 88 | PLCrashReportArchitecturePPC64 = 4, 89 | 90 | /** ARMv7 */ 91 | PLCrashReportArchitectureARMv7 = 5, 92 | 93 | /** Unknown */ 94 | PLCrashReportArchitectureUnknown = 6 95 | } PLCrashReportArchitecture; 96 | 97 | 98 | extern PLCrashReportOperatingSystem PLCrashReportHostOperatingSystem; 99 | PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH(); 100 | extern PLCrashReportArchitecture PLCrashReportHostArchitecture PLCR_EXTERNAL_DEPRECATED; 101 | PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH(); 102 | 103 | @interface PLCrashReportSystemInfo : NSObject { 104 | @private 105 | /** Operating system */ 106 | PLCrashReportOperatingSystem _operatingSystem; 107 | 108 | /** Operating system version */ 109 | NSString *_osVersion; 110 | 111 | /** OS build. May be nil. */ 112 | NSString *_osBuild; 113 | 114 | /** Architecture */ 115 | PLCrashReportArchitecture _architecture; 116 | 117 | /** Date crash report was generated. May be nil if the date is unknown. */ 118 | NSDate *_timestamp; 119 | 120 | /** Processor information. */ 121 | PLCrashReportProcessorInfo *_processorInfo; 122 | } 123 | 124 | - (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem 125 | operatingSystemVersion: (NSString *) operatingSystemVersion 126 | architecture: (PLCrashReportArchitecture) architecture 127 | timestamp: (NSDate *) timestamp PLCR_DEPRECATED; 128 | 129 | - (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem 130 | operatingSystemVersion: (NSString *) operatingSystemVersion 131 | operatingSystemBuild: (NSString *) operatingSystemBuild 132 | architecture: (PLCrashReportArchitecture) architecture 133 | timestamp: (NSDate *) timestamp PLCR_DEPRECATED; 134 | 135 | - (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem 136 | operatingSystemVersion: (NSString *) operatingSystemVersion 137 | operatingSystemBuild: (NSString *) operatingSystemBuild 138 | architecture: (PLCrashReportArchitecture) architecture 139 | processorInfo: (PLCrashReportProcessorInfo *) processorInfo 140 | timestamp: (NSDate *) timestamp; 141 | 142 | /** The operating system. */ 143 | @property(nonatomic, readonly) PLCrashReportOperatingSystem operatingSystem; 144 | 145 | /** The operating system's release version. */ 146 | @property(nonatomic, readonly) NSString *operatingSystemVersion; 147 | 148 | /** The operating system's build identifier (eg, 10J869). This may be unavailable, and this property will be nil. */ 149 | @property(nonatomic, readonly) NSString *operatingSystemBuild; 150 | 151 | /** Architecture. @deprecated The architecture value has been deprecated in v1.1 and later crash reports. All new reports 152 | * include the CPU type as part of the crash report's machine info structure, using the PLCrashReportProcessorInfo 153 | * extensible encoding. */ 154 | @property(nonatomic, readonly) PLCrashReportArchitecture architecture PLCR_DEPRECATED; 155 | 156 | /** Date and time that the crash report was generated. This may be unavailable, and this property will be nil. */ 157 | @property(nonatomic, readonly) NSDate *timestamp; 158 | 159 | /** The processor type. For v1.2 reports and later, this is an alias to the machine info's processorInfo. 160 | * For earlier reports, this will be synthesized from the deprecated architecture property. */ 161 | @property(nonatomic, readonly) PLCrashReportProcessorInfo *processorInfo; 162 | 163 | @end 164 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/A/Headers/PLCrashReportTextFormatter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Authors: 3 | * Landon Fuller 4 | * Damian Morris 5 | * 6 | * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. 7 | * Copyright (c) 2010 MOSO Corporation, Pty Ltd. 8 | * All rights reserved. 9 | * 10 | * Permission is hereby granted, free of charge, to any person 11 | * obtaining a copy of this software and associated documentation 12 | * files (the "Software"), to deal in the Software without 13 | * restriction, including without limitation the rights to use, 14 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | * copies of the Software, and to permit persons to whom the 16 | * Software is furnished to do so, subject to the following 17 | * conditions: 18 | * 19 | * The above copyright notice and this permission notice shall be 20 | * included in all copies or substantial portions of the Software. 21 | * 22 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 23 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 24 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 25 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 26 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 27 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 28 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 29 | * OTHER DEALINGS IN THE SOFTWARE. 30 | */ 31 | 32 | 33 | #import 34 | 35 | #import "PLCrashReportFormatter.h" 36 | 37 | /** 38 | * Supported text output formats. 39 | * 40 | * @ingroup enums 41 | */ 42 | typedef enum { 43 | /** An iOS-compatible crash log text format. Compatible with the crash logs generated by the device and available 44 | * through iTunes Connect. */ 45 | PLCrashReportTextFormatiOS = 0 46 | } PLCrashReportTextFormat; 47 | 48 | 49 | @interface PLCrashReportTextFormatter : NSObject { 50 | @private 51 | /** Text output format. */ 52 | PLCrashReportTextFormat _textFormat; 53 | 54 | /** Encoding to use for string output. */ 55 | NSStringEncoding _stringEncoding; 56 | } 57 | 58 | + (NSString *) stringValueForCrashReport: (PLCrashReport *) report withTextFormat: (PLCrashReportTextFormat) textFormat; 59 | 60 | - (id) initWithTextFormat: (PLCrashReportTextFormat) textFormat stringEncoding: (NSStringEncoding) stringEncoding; 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/A/Headers/PLCrashReportThreadInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | 31 | #import "PLCrashReportStackFrameInfo.h" 32 | #import "PLCrashReportRegisterInfo.h" 33 | 34 | @interface PLCrashReportThreadInfo : NSObject { 35 | @private 36 | /** The thread number. Should be unique within a given crash log. */ 37 | NSInteger _threadNumber; 38 | 39 | /** Ordered list of PLCrashReportStackFrame instances */ 40 | NSArray *_stackFrames; 41 | 42 | /** YES if this thread crashed. */ 43 | BOOL _crashed; 44 | 45 | /** List of PLCrashReportRegister instances. Will be empty if _crashed is NO. */ 46 | NSArray *_registers; 47 | } 48 | 49 | - (id) initWithThreadNumber: (NSInteger) threadNumber 50 | stackFrames: (NSArray *) stackFrames 51 | crashed: (BOOL) crashed 52 | registers: (NSArray *) registers; 53 | 54 | /** 55 | * Application thread number. 56 | */ 57 | @property(nonatomic, readonly) NSInteger threadNumber; 58 | 59 | /** 60 | * Thread backtrace. Provides an array of PLCrashReportStackFrameInfo instances. 61 | * The array is ordered, last callee to first. 62 | */ 63 | @property(nonatomic, readonly) NSArray *stackFrames; 64 | 65 | /** 66 | * If this thread crashed, set to YES. 67 | */ 68 | @property(nonatomic, readonly) BOOL crashed; 69 | 70 | /** 71 | * State of the general purpose and related registers, as a list of 72 | * PLCrashReportRegister instances. If this thead did not crash (crashed returns NO), 73 | * this list will be empty. 74 | */ 75 | @property(nonatomic, readonly) NSArray *registers; 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/A/Headers/PLCrashReporter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | #import 31 | 32 | #import "PLCrashReporterConfig.h" 33 | #import "PLCrashMacros.h" 34 | 35 | @class PLCrashMachExceptionServer; 36 | @class PLCrashMachExceptionPortSet; 37 | 38 | /** 39 | * @ingroup functions 40 | * 41 | * Prototype of a callback function used to execute additional user code with signal information as provided 42 | * by PLCrashReporter. Called upon completion of crash handling, after the crash report has been written to disk. 43 | * 44 | * @param info The signal info. 45 | * @param uap The crash's threads context. 46 | * @param context The API client's supplied context value. 47 | * 48 | * @sa The @ref async_safety documentation. 49 | * @sa PLCrashReporter::setPostCrashCallbacks: 50 | */ 51 | typedef void (*PLCrashReporterPostCrashSignalCallback)(siginfo_t *info, ucontext_t *uap, void *context); 52 | 53 | /** 54 | * @ingroup types 55 | * 56 | * This structure contains callbacks supported by PLCrashReporter to allow the host application to perform 57 | * additional tasks prior to program termination after a crash has occured. 58 | * 59 | * @sa The @ref async_safety documentation. 60 | */ 61 | typedef struct PLCrashReporterCallbacks { 62 | /** The version number of this structure. If not one of the defined version numbers for this type, the behavior 63 | * is undefined. The current version of this structure is 0. */ 64 | uint16_t version; 65 | 66 | /** An arbitrary user-supplied context value. This value may be NULL. */ 67 | void *context; 68 | 69 | /** 70 | * The callback used to report caught signal information. In version 0 of this structure, all crashes will be 71 | * reported via this function. 72 | * 73 | * @warning When using PLCrashReporterSignalHandlerTypeMach, the siginfo_t argument to this function will be derived 74 | * from the Mach exception data, and may be incorrect, or may otherwise not match the expected data as provided via 75 | * PLCrashReporterSignalHandlerTypeBSD. In addition, the provided ucontext_t value will be zero-initialized, and will 76 | * not provide valid thread state. 77 | * 78 | * This callback will be deprecated in favor of a Mach-compatible replacement in a future release; support is maintained 79 | * here to allow clients that rely on post-crash callbacks without thread state to make use of Mach exceptions. 80 | */ 81 | PLCrashReporterPostCrashSignalCallback handleSignal; 82 | } PLCrashReporterCallbacks; 83 | 84 | @interface PLCrashReporter : NSObject { 85 | @private 86 | /** Reporter configuration */ 87 | PLCrashReporterConfig *_config; 88 | 89 | /** YES if the crash reporter has been enabled */ 90 | BOOL _enabled; 91 | 92 | #if PLCRASH_FEATURE_MACH_EXCEPTIONS 93 | /** The backing Mach exception server, if any. Nil if the reporter has not been enabled, or if 94 | * the configured signal handler type is not PLCrashReporterSignalHandlerTypeMach. */ 95 | PLCrashMachExceptionServer *_machServer; 96 | 97 | /** Previously registered Mach exception ports, if any. */ 98 | PLCrashMachExceptionPortSet *_previousMachPorts; 99 | #endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */ 100 | 101 | /** Application identifier */ 102 | NSString *_applicationIdentifier; 103 | 104 | /** Application version */ 105 | NSString *_applicationVersion; 106 | 107 | /** Application marketing version */ 108 | NSString *_applicationMarketingVersion; 109 | 110 | /** Path to the crash reporter internal data directory */ 111 | NSString *_crashReportDirectory; 112 | } 113 | 114 | + (PLCrashReporter *) sharedReporter PLCR_DEPRECATED; 115 | 116 | - (instancetype) initWithConfiguration: (PLCrashReporterConfig *) config; 117 | 118 | - (BOOL) hasPendingCrashReport; 119 | 120 | - (NSData *) loadPendingCrashReportData; 121 | - (NSData *) loadPendingCrashReportDataAndReturnError: (NSError **) outError; 122 | 123 | - (NSData *) generateLiveReportWithThread: (thread_t) thread; 124 | - (NSData *) generateLiveReportWithThread: (thread_t) thread error: (NSError **) outError; 125 | 126 | - (NSData *) generateLiveReport; 127 | - (NSData *) generateLiveReportAndReturnError: (NSError **) outError; 128 | 129 | - (BOOL) purgePendingCrashReport; 130 | - (BOOL) purgePendingCrashReportAndReturnError: (NSError **) outError; 131 | 132 | - (BOOL) enableCrashReporter; 133 | - (BOOL) enableCrashReporterAndReturnError: (NSError **) outError; 134 | 135 | - (void) setCrashCallbacks: (PLCrashReporterCallbacks *) callbacks; 136 | 137 | @end 138 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/A/Headers/PLCrashReporterConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Landon Fuller 3 | * 4 | * Copyright (c) 2013 Plausible Labs Cooperative, Inc. 5 | * All rights reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #import 30 | #import "PLCrashFeatureConfig.h" 31 | 32 | /** 33 | * @ingroup enums 34 | * Supported mechanisms for trapping and handling crashes. 35 | */ 36 | typedef NS_ENUM(NSUInteger, PLCrashReporterSignalHandlerType) { 37 | /** 38 | * Trap fatal signals via a sigaction(2)-registered BSD signal handler. 39 | * 40 | * PLCrashReporter's signal handler will supersede previously registered handlers; existing 41 | * handlers will not be called. This behavior may be modified in a future release, and should 42 | * not be relied upon as a mechanism to prevent existing signal handlers from being called. 43 | * 44 | * There are some limitations to signal-based crash handling on Mac OS X and iOS; specifically: 45 | * 46 | * - On Mac OS X, stack overflows will only be handled on the thread on which 47 | * the crash reporter was initialized. This should generally be the main thread. 48 | * - On iOS 6.0 and later, any stack overflows will not be handled due to sigaltstack() being 49 | * non-functional on the device. (see rdar://13002712 - SA_ONSTACK/sigaltstack() ignored on iOS). 50 | * - Some exit paths in Apple's Libc will deregister a signal handler before firing SIGABRT, resulting 51 | * in the signal handler never being called (see rdar://14313497 - ___abort() disables SIGABRT signal 52 | * handlers prior to raising SIGABRT). These __abort()-based checks are: 53 | * - Implemented for unsafe memcpy/strcpy/snprintf C functions. 54 | * - Only enabled when operating on a fixed-width target buffer (in which case the 55 | * compiler rewrites the function calls to the built-in variants, and provides the fixed-width length as an argument). 56 | * - Only trigger in the case that the source data exceeds the size of the fixed width target 57 | * buffer, and the maximum length argument either isn't supplied by the caller (eg, when using strcpy), 58 | * or a too-long argument is supplied (eg, strncpy with a length argument longer than the target buffer), 59 | * AND that argument can't be checked at compile-time. 60 | */ 61 | PLCrashReporterSignalHandlerTypeBSD = 0, 62 | 63 | #if PLCRASH_FEATURE_MACH_EXCEPTIONS 64 | /** 65 | * Trap fatal signals via a Mach exception server. 66 | * 67 | * If any existing Mach exception server has been registered for the task, exceptions will be forwarded to that 68 | * exception handler. Should the exceptions be handled by an existing handler, no report will be generated 69 | * by PLCrashReporter. 70 | * 71 | * @par Mac OS X 72 | * 73 | * On Mac OS X, the Mach exception implementation is fully supported, using publicly available API -- note, 74 | * however, that some kernel-internal constants, as well as architecture-specific trap information, 75 | * may be required to fully interpret a Mach exception's root cause. 76 | * 77 | * @par iOS 78 | * 79 | * On iOS, the APIs required for a complete implementation are not fully public. 80 | * 81 | * The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to 82 | * implement Mach exception handling regardless of concerns over API visiblity. Given this, we've included 83 | * Mach exception handling as an optional feature, with both build-time and runtime configuration 84 | * to disable its inclusion or use, respectively. 85 | * 86 | * @par Debugger Incompatibility 87 | * 88 | * The Mach exception handler executes in-process, and will interfere with debuggers when they attempt to 89 | * suspend all active threads (which will include the Mach exception handler). Mach-based handling 90 | * should not be used when a debugger is attached. 91 | * 92 | * @par More Details 93 | * 94 | * For more information, refer to @ref mach_exceptions. 95 | */ 96 | PLCrashReporterSignalHandlerTypeMach = 1 97 | #endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */ 98 | }; 99 | 100 | /** 101 | * @ingroup enums 102 | * Supported mechanisms for performing local symbolication. 103 | * 104 | * Local symbolication is performed using inexact heuristics and symbol data available at runtime; it may 105 | * return information that is incorrect. This may still be useful in the case where DWARF data is unavailable 106 | * for a given build; in that case, it can provide function and method names (though not line numbers) for a 107 | * crash report that may otherwise be unusable. 108 | * 109 | * Note, however, this comes at the cost of a significant increase in code that must run within the critical 110 | * crash reporting section, where failures may result in crash reports being corrupted or left unwritten. In 111 | * addition, some of the provided symbolication strategies rely on knowledge of runtime internals that may 112 | * change in future iOS releases. Given that DWARF symbolication data will always be more accurate, and 113 | * the risks inherent in executing considerably more code at crash time, it is strongly recommended that local 114 | * symbolication only be enabled for non-release builds. 115 | * 116 | * Multiple symbolication strategies may be enabled, in which case a best-match heuristic will be applied to the 117 | * results. 118 | */ 119 | typedef NS_OPTIONS(NSUInteger, PLCrashReporterSymbolicationStrategy) { 120 | /** No symbolication. */ 121 | PLCrashReporterSymbolicationStrategyNone = 0, 122 | 123 | /** 124 | * Use the standard binary symbol table. On iOS, this alone will return 125 | * incomplete results, as most symbols are rewritten to the common '\' string. 126 | */ 127 | PLCrashReporterSymbolicationStrategySymbolTable = 1 << 0, 128 | 129 | /** 130 | * Use Objective-C metadata to find method and class names. This relies on detailed parsing 131 | * of the Objective-C runtime data, including undefined flags and other runtime internals. As such, 132 | * it may return incorrect data should the runtime be changed incompatibly. 133 | */ 134 | PLCrashReporterSymbolicationStrategyObjC = 1 << 1, 135 | 136 | /** 137 | * Enable all available symbolication strategies. 138 | */ 139 | PLCrashReporterSymbolicationStrategyAll = (PLCrashReporterSymbolicationStrategySymbolTable|PLCrashReporterSymbolicationStrategyObjC) 140 | }; 141 | 142 | @interface PLCrashReporterConfig : NSObject { 143 | @private 144 | /** The configured signal handler type. */ 145 | PLCrashReporterSignalHandlerType _signalHandlerType; 146 | 147 | /** The configured symbolication strategy. */ 148 | PLCrashReporterSymbolicationStrategy _symbolicationStrategy; 149 | } 150 | 151 | + (instancetype) defaultConfiguration; 152 | 153 | - (instancetype) init; 154 | - (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType 155 | symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy; 156 | 157 | /** The configured signal handler type. */ 158 | @property(nonatomic, readonly) PLCrashReporterSignalHandlerType signalHandlerType; 159 | 160 | /** The configured symbolication strategy. */ 161 | @property(nonatomic, readonly) PLCrashReporterSymbolicationStrategy symbolicationStrategy; 162 | 163 | 164 | @end 165 | 166 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 14F1021 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | CrashReporter 11 | CFBundleIdentifier 12 | coop.plausible.CrashReporter 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | CrashReporter 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleSignature 20 | ???? 21 | CFBundleSupportedPlatforms 22 | 23 | MacOSX 24 | 25 | CFBundleVersion 26 | 1.0 27 | DTCompiler 28 | com.apple.compilers.llvm.clang.1_0 29 | DTPlatformBuild 30 | 7B91b 31 | DTPlatformVersion 32 | GM 33 | DTSDKBuild 34 | 15A278 35 | DTSDKName 36 | macosx10.11 37 | DTXcode 38 | 0710 39 | DTXcodeBuild 40 | 7B91b 41 | 42 | 43 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/CrashReporter.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/PerformanceMonitor.h: -------------------------------------------------------------------------------- 1 | // 2 | // PerformanceMonitor.h 3 | // SuperApp 4 | // 5 | // Created by tanhao on 15/11/12. 6 | // Copyright © 2015年 Tencent. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PerformanceMonitor : NSObject 12 | 13 | + (instancetype)sharedInstance; 14 | 15 | - (void)start; 16 | - (void)stop; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/PerformanceMonitor.m: -------------------------------------------------------------------------------- 1 | // 2 | // PerformanceMonitor.m 3 | // SuperApp 4 | // 5 | // Created by tanhao on 15/11/12. 6 | // Copyright © 2015年 Tencent. All rights reserved. 7 | // 8 | 9 | #import "PerformanceMonitor.h" 10 | #import 11 | 12 | @interface PerformanceMonitor () 13 | { 14 | int timeoutCount; 15 | CFRunLoopObserverRef observer; 16 | 17 | @public 18 | dispatch_semaphore_t semaphore; 19 | CFRunLoopActivity activity; 20 | } 21 | @end 22 | 23 | @implementation PerformanceMonitor 24 | 25 | + (instancetype)sharedInstance 26 | { 27 | static id instance = nil; 28 | static dispatch_once_t onceToken; 29 | dispatch_once(&onceToken, ^{ 30 | instance = [[self alloc] init]; 31 | }); 32 | return instance; 33 | } 34 | 35 | static void runLoopObserverCallBack(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info) 36 | { 37 | PerformanceMonitor *moniotr = (__bridge PerformanceMonitor*)info; 38 | 39 | moniotr->activity = activity; 40 | 41 | dispatch_semaphore_t semaphore = moniotr->semaphore; 42 | dispatch_semaphore_signal(semaphore); 43 | } 44 | 45 | - (void)stop 46 | { 47 | if (!observer) 48 | return; 49 | 50 | CFRunLoopRemoveObserver(CFRunLoopGetMain(), observer, kCFRunLoopCommonModes); 51 | CFRelease(observer); 52 | observer = NULL; 53 | } 54 | 55 | - (void)start 56 | { 57 | if (observer) 58 | return; 59 | 60 | // 信号 61 | semaphore = dispatch_semaphore_create(0); 62 | 63 | // 注册RunLoop状态观察 64 | CFRunLoopObserverContext context = {0,(__bridge void*)self,NULL,NULL}; 65 | observer = CFRunLoopObserverCreate(kCFAllocatorDefault, 66 | kCFRunLoopAllActivities, 67 | YES, 68 | 0, 69 | &runLoopObserverCallBack, 70 | &context); 71 | CFRunLoopAddObserver(CFRunLoopGetMain(), observer, kCFRunLoopCommonModes); 72 | 73 | // 在子线程监控时长 74 | dispatch_async(dispatch_get_global_queue(0, 0), ^{ 75 | while (YES) 76 | { 77 | long st = dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, 50*NSEC_PER_MSEC)); 78 | if (st != 0) 79 | { 80 | if (!observer) 81 | { 82 | timeoutCount = 0; 83 | semaphore = 0; 84 | activity = 0; 85 | return; 86 | } 87 | 88 | if (activity==kCFRunLoopBeforeSources || activity==kCFRunLoopAfterWaiting) 89 | { 90 | if (++timeoutCount < 5) 91 | continue; 92 | 93 | PLCrashReporterConfig *config = [[PLCrashReporterConfig alloc] initWithSignalHandlerType:PLCrashReporterSignalHandlerTypeBSD 94 | symbolicationStrategy:PLCrashReporterSymbolicationStrategyAll]; 95 | PLCrashReporter *crashReporter = [[PLCrashReporter alloc] initWithConfiguration:config]; 96 | 97 | NSData *data = [crashReporter generateLiveReport]; 98 | PLCrashReport *reporter = [[PLCrashReport alloc] initWithData:data error:NULL]; 99 | NSString *report = [PLCrashReportTextFormatter stringValueForCrashReport:reporter 100 | withTextFormat:PLCrashReportTextFormatiOS]; 101 | 102 | NSLog(@"------------\n%@\n------------", report); 103 | } 104 | } 105 | timeoutCount = 0; 106 | } 107 | }); 108 | } 109 | 110 | @end 111 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // PerformanceMonitor 4 | // 5 | // Created by tanhao on 15/11/13. 6 | // Copyright © 2015年 Tencent. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // PerformanceMonitor 4 | // 5 | // Created by tanhao on 15/11/13. 6 | // Copyright © 2015年 Tencent. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | { 13 | UITableView *_tableView; 14 | } 15 | @end 16 | 17 | @implementation ViewController 18 | 19 | - (void)viewDidLoad 20 | { 21 | [super viewDidLoad]; 22 | 23 | _tableView = [[UITableView alloc] initWithFrame:self.view.bounds]; 24 | _tableView.dataSource = self; 25 | _tableView.delegate = self; 26 | [self.view addSubview:_tableView]; 27 | } 28 | 29 | - (void)didReceiveMemoryWarning 30 | { 31 | [super didReceiveMemoryWarning]; 32 | // Dispose of any resources that can be recreated. 33 | } 34 | 35 | #pragma mark - UITableViewDataSource 36 | 37 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 38 | { 39 | return 100; 40 | } 41 | 42 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 43 | { 44 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"]; 45 | if (!cell) 46 | { 47 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"]; 48 | } 49 | 50 | NSString *cellText = nil; 51 | if (indexPath.row%10 == 0) 52 | { 53 | usleep(200*1000); 54 | cellText = @"我需要一些时间"; 55 | }else 56 | { 57 | cellText = [NSString stringWithFormat:@"cell%ld",indexPath.row]; 58 | } 59 | 60 | cell.textLabel.text = cellText; 61 | return cell; 62 | } 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /PerformanceMonitor/PerformanceMonitor/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // PerformanceMonitor 4 | // 5 | // Created by tanhao on 15/11/13. 6 | // Copyright © 2015年 Tencent. 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PerformanceMonitor 2 | iOS实时卡顿监控 3 | --------------------------------------------------------------------------------