Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(909)

Side by Side Diff: third_party/crashpad/crashpad/util/misc/metrics.h

Issue 2705373005: Revert of Update Crashpad to 6da9708e7cc93e2e1772439d51646e47583cb225 (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Crashpad Authors. All rights reserved. 1 // Copyright 2016 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 12 matching lines...) Expand all
23 namespace crashpad { 23 namespace crashpad {
24 24
25 //! \brief Container class to hold shared UMA metrics integration points. 25 //! \brief Container class to hold shared UMA metrics integration points.
26 //! 26 //!
27 //! Each static function in this class will call a `UMA_*` from 27 //! Each static function in this class will call a `UMA_*` from
28 //! `base/metrics/histogram_macros.h`. When building Crashpad standalone, 28 //! `base/metrics/histogram_macros.h`. When building Crashpad standalone,
29 //! (against mini_chromium), these macros do nothing. When built against 29 //! (against mini_chromium), these macros do nothing. When built against
30 //! Chromium's base, they allow integration with its metrics system. 30 //! Chromium's base, they allow integration with its metrics system.
31 class Metrics { 31 class Metrics {
32 public: 32 public:
33 //! \brief Values for CrashReportPending(). 33 //! \brief Values for CrashReportPending(). These are used as metrics
34 //! 34 //! enumeration values, so new values should always be added at the end.
35 //! \note These are used as metrics enumeration values, so new values should
36 //! always be added at the end, before PendingReportReason::kMaxValue.
37 enum class PendingReportReason : int32_t { 35 enum class PendingReportReason : int32_t {
38 //! \brief A report was newly created and is ready for upload. 36 //! \brief A report was newly created and is ready for upload.
39 kNewlyCreated = 0, 37 kNewlyCreated = 0,
40 38
41 //! \brief The user manually requested the report be uploaded. 39 //! \brief The user manually requested the report be uploaded.
42 kUserInitiated = 1, 40 kUserInitiated = 1,
43 41
44 //! \brief The number of values in this enumeration; not a valid value. 42 //! \brief The number of values in this enumeration; not a valid value.
45 kMaxValue 43 kMaxValue
46 }; 44 };
47 45
48 //! \brief Reports when a crash upload has entered the pending state. 46 //! \brief Reports when a crash upload has entered the pending state.
49 static void CrashReportPending(PendingReportReason reason); 47 static void CrashReportPending(PendingReportReason reason);
50 48
51 //! \brief Reports the size of a crash report file in bytes. Should be called 49 //! \brief Reports the size of a crash report file in bytes. Should be called
52 //! when a new report is written to disk. 50 //! when a new report is written to disk.
53 static void CrashReportSize(FileHandle file); 51 static void CrashReportSize(FileHandle file);
54 52
55 //! \brief Reports on a crash upload attempt, and if it succeeded. 53 //! \brief Reports on a crash upload attempt, and if it succeeded.
56 static void CrashUploadAttempted(bool successful); 54 static void CrashUploadAttempted(bool successful);
57 55
58 //! \brief Values for CrashUploadSkipped(). 56 //! \brief Values for CrashUploadSkipped(). These are used as metrics
59 //! 57 //! enumeration values, so new values should always be added at the end.
60 //! \note These are used as metrics enumeration values, so new values should
61 //! always be added at the end, before CrashSkippedReason::kMaxValue.
62 enum class CrashSkippedReason : int32_t { 58 enum class CrashSkippedReason : int32_t {
63 //! \brief Crash uploading is disabled. 59 //! \brief Crash uploading is disabled.
64 kUploadsDisabled = 0, 60 kUploadsDisabled = 0,
65 61
66 //! \brief There was another upload too recently, so this one was throttled. 62 //! \brief There was another upload too recently, so this one was throttled.
67 kUploadThrottled = 1, 63 kUploadThrottled = 1,
68 64
69 //! \brief The report had an unexpected timestamp. 65 //! \brief The report had an unexpected timestamp.
70 kUnexpectedTime = 2, 66 kUnexpectedTime = 2,
71 67
72 //! \brief The database reported an error, likely due to a filesystem 68 //! \brief The database reported an error, likely due to a filesystem
73 //! problem. 69 //! problem.
74 kDatabaseError = 3, 70 kDatabaseError = 3,
75 71
76 //! \brief The upload of the crash failed during communication with the 72 //! \brief The upload of the crash failed during communication with the
77 //! server. 73 //! server.
78 kUploadFailed = 4, 74 kUploadFailed = 4,
79 75
80 //! \brief The number of values in this enumeration; not a valid value. 76 //! \brief The number of values in this enumeration; not a valid value.
81 kMaxValue 77 kMaxValue
82 }; 78 };
83 79
84 //! \brief Reports when a report is moved to the completed state in the 80 //! \brief Reports when a report is moved to the completed state in the
85 //! database, without the report being uploadad. 81 //! database, without the report being uploadad.
86 static void CrashUploadSkipped(CrashSkippedReason reason); 82 static void CrashUploadSkipped(CrashSkippedReason reason);
87 83
88 //! \brief The result of capturing an exception. 84 //! \brief The result of capturing an exception. These are used as metrics
89 //! 85 //! enumeration values, so new values should always be added at the end.
90 //! \note These are used as metrics enumeration values, so new values should
91 //! always be added at the end, before CaptureResult::kMaxValue.
92 enum class CaptureResult : int32_t { 86 enum class CaptureResult : int32_t {
93 //! \brief The exception capture succeeded normally. 87 //! \brief The exception capture succeeded normally.
94 kSuccess = 0, 88 kSuccess = 0,
95 89
96 //! \brief Unexpected exception behavior. 90 //! \brief Unexpected exception behavior.
97 //! 91 //!
98 //! This value is only used on macOS. 92 //! This value is only used on macOS.
99 kUnexpectedExceptionBehavior = 1, 93 kUnexpectedExceptionBehavior = 1,
100 94
101 //! \brief Failed due to attempt to suspend self. 95 //! \brief Failed due to attempt to suspend self.
(...skipping 27 matching lines...) Expand all
129 123
130 //! \brief The exception code for an exception was retrieved. 124 //! \brief The exception code for an exception was retrieved.
131 //! 125 //!
132 //! These values are OS-specific, and correspond to 126 //! These values are OS-specific, and correspond to
133 //! MINIDUMP_EXCEPTION::ExceptionCode. 127 //! MINIDUMP_EXCEPTION::ExceptionCode.
134 static void ExceptionCode(uint32_t exception_code); 128 static void ExceptionCode(uint32_t exception_code);
135 129
136 //! \brief The exception handler server started capturing an exception. 130 //! \brief The exception handler server started capturing an exception.
137 static void ExceptionEncountered(); 131 static void ExceptionEncountered();
138 132
139 //! \brief An important event in a handler process’ lifetime.
140 //!
141 //! \note These are used as metrics enumeration values, so new values should
142 //! always be added at the end, before LifetimeMilestone::kMaxValue.
143 enum class LifetimeMilestone : int32_t {
144 //! \brief The handler process started.
145 kStarted = 0,
146
147 //! \brief The handler process exited normally and cleanly.
148 kExitedNormally,
149
150 //! \brief The handler process exited early, but was successful in
151 //! performing some non-default action on user request.
152 kExitedEarly,
153
154 //! \brief The handler process exited with a failure code.
155 kFailed,
156
157 //! \brief The handler process was forcibly terminated.
158 kTerminated,
159
160 //! \brief The handler process crashed.
161 kCrashed,
162
163 //! \brief The number of values in this enumeration; not a valid value.
164 kMaxValue
165 };
166
167 //! \brief Records a handler start/exit/crash event.
168 static void HandlerLifetimeMilestone(LifetimeMilestone milestone);
169
170 //! \brief The handler process crashed with the given exception code. 133 //! \brief The handler process crashed with the given exception code.
171 //! 134 //!
172 //! This is currently only reported on Windows. 135 //! This is currently only reported on Windows.
173 static void HandlerCrashed(uint32_t exception_code); 136 static void HandlerCrashed(uint32_t exception_code);
174 137
175 private: 138 private:
176 DISALLOW_IMPLICIT_CONSTRUCTORS(Metrics); 139 DISALLOW_IMPLICIT_CONSTRUCTORS(Metrics);
177 }; 140 };
178 141
179 } // namespace crashpad 142 } // namespace crashpad
180 143
181 #endif // CRASHPAD_UTIL_MISC_METRICS_H_ 144 #endif // CRASHPAD_UTIL_MISC_METRICS_H_
OLDNEW
« no previous file with comments | « third_party/crashpad/crashpad/third_party/zlib/zlib_crashpad.h ('k') | third_party/crashpad/crashpad/util/misc/metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698