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

Unified Diff: crash_reporter.cc

Issue 2716010: Broadcast a D-Bus message whenever a user-space process crash happens. (Closed) Base URL: ssh://git@chromiumos-git/crash.git
Patch Set: Be explicit about the unused result status. Created 10 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crash_reporter.cc
diff --git a/crash_reporter.cc b/crash_reporter.cc
index 951d3fae3d4ecfc96104f949b1c9cf1d3a19545b..e283322dab15b1c2c1640866755bd6bf5f7fe182 100644
--- a/crash_reporter.cc
+++ b/crash_reporter.cc
@@ -77,6 +77,18 @@ static void CountUserCrash() {
s_metrics_lib.SendEnumToUMA(std::string(kCrashCounterHistogram),
CRASH_KIND_USER,
CRASH_KIND_MAX);
+
+ // Announce through D-Bus whenever a user crash happens. This is
+ // used by the metrics daemon to log active use time between
+ // crashes.
+ //
+ // This could be done more efficiently by explicit fork/exec or
+ // using a dbus library directly. However, this should run
+ // relatively rarely and longer term we may need to implement a
+ // better way to do this that doesn't rely on D-Bus.
+ int status __attribute__((unused)) =
+ system("/usr/bin/dbus-send --type=signal --system / "
+ "org.chromium.CrashReporter.UserCrash");
}
int main(int argc, char *argv[]) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698