Commit 3e538dd5 authored by Joshua Peraza's avatar Joshua Peraza Committed by Commit Bot

linux: enable monitor self and crashpad metrics

Also, Crashpad for Android can't yet monitor itself in the various
configurations that Chrome packages it, so remove references to the
flag from crashpad_android.cc to avoid accidentally turning it on.

Bug: 942279
Change-Id: I1afae5fd433f9e2b1475e8fa3e883547542eb6cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1834401Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#702128}
parent 2f0d1174
...@@ -139,6 +139,13 @@ bool ChromeCrashReporterClient::GetCrashDumpLocation( ...@@ -139,6 +139,13 @@ bool ChromeCrashReporterClient::GetCrashDumpLocation(
return base::PathService::Get(chrome::DIR_CRASH_DUMPS, crash_dir); return base::PathService::Get(chrome::DIR_CRASH_DUMPS, crash_dir);
} }
#if defined(OS_MACOSX) || defined(OS_LINUX)
bool ChromeCrashReporterClient::GetCrashMetricsLocation(
base::FilePath* metrics_dir) {
return base::PathService::Get(chrome::DIR_USER_DATA, metrics_dir);
}
#endif // OS_MACOSX || OS_LINUX
bool ChromeCrashReporterClient::IsRunningUnattended() { bool ChromeCrashReporterClient::IsRunningUnattended() {
std::unique_ptr<base::Environment> env(base::Environment::Create()); std::unique_ptr<base::Environment> env(base::Environment::Create());
return env->HasVar(env_vars::kHeadless); return env->HasVar(env_vars::kHeadless);
...@@ -178,6 +185,15 @@ int ChromeCrashReporterClient::GetAndroidMinidumpDescriptor() { ...@@ -178,6 +185,15 @@ int ChromeCrashReporterClient::GetAndroidMinidumpDescriptor() {
} }
#endif #endif
#if defined(OS_LINUX)
bool ChromeCrashReporterClient::ShouldMonitorCrashHandlerExpensively() {
// TODO(jperaza): Turn this on less frequently for stable channels when
// Crashpad is always enabled on Linux. Consider combining with the
// macOS implementation.
return true;
}
#endif // OS_LINUX
bool ChromeCrashReporterClient::EnableBreakpadForProcess( bool ChromeCrashReporterClient::EnableBreakpadForProcess(
const std::string& process_type) { const std::string& process_type) {
return process_type == switches::kRendererProcess || return process_type == switches::kRendererProcess ||
......
...@@ -43,7 +43,7 @@ class ChromeCrashReporterClient : public crash_reporter::CrashReporterClient { ...@@ -43,7 +43,7 @@ class ChromeCrashReporterClient : public crash_reporter::CrashReporterClient {
bool GetCrashDumpLocation(base::FilePath* crash_dir) override; bool GetCrashDumpLocation(base::FilePath* crash_dir) override;
#if defined(OS_MACOSX) #if defined(OS_MACOSX) || defined(OS_LINUX)
bool GetCrashMetricsLocation(base::FilePath* metrics_dir) override; bool GetCrashMetricsLocation(base::FilePath* metrics_dir) override;
#endif #endif
...@@ -59,7 +59,7 @@ class ChromeCrashReporterClient : public crash_reporter::CrashReporterClient { ...@@ -59,7 +59,7 @@ class ChromeCrashReporterClient : public crash_reporter::CrashReporterClient {
int GetAndroidMinidumpDescriptor() override; int GetAndroidMinidumpDescriptor() override;
#endif #endif
#if defined(OS_MACOSX) #if defined(OS_MACOSX) || defined(OS_LINUX)
bool ShouldMonitorCrashHandlerExpensively() override; bool ShouldMonitorCrashHandlerExpensively() override;
#endif #endif
......
...@@ -15,11 +15,6 @@ ...@@ -15,11 +15,6 @@
#include "components/policy/policy_constants.h" #include "components/policy/policy_constants.h"
#include "components/version_info/version_info.h" #include "components/version_info/version_info.h"
bool ChromeCrashReporterClient::GetCrashMetricsLocation(
base::FilePath* metrics_dir) {
return base::PathService::Get(chrome::DIR_USER_DATA, metrics_dir);
}
bool ChromeCrashReporterClient::ReportingIsEnforcedByPolicy( bool ChromeCrashReporterClient::ReportingIsEnforcedByPolicy(
bool* breakpad_enabled) { bool* breakpad_enabled) {
base::ScopedCFTypeRef<CFStringRef> key( base::ScopedCFTypeRef<CFStringRef> key(
......
...@@ -419,15 +419,6 @@ void BuildHandlerArgs(CrashReporterClient* crash_reporter_client, ...@@ -419,15 +419,6 @@ void BuildHandlerArgs(CrashReporterClient* crash_reporter_client,
} }
(*process_annotations)["plat"] = std::string("Android"); (*process_annotations)["plat"] = std::string("Android");
if (crash_reporter_client->ShouldMonitorCrashHandlerExpensively()) {
arguments->push_back("--monitor-self");
}
// Set up --monitor-self-annotation even in the absence of --monitor-self
// so that minidumps produced by Crashpad's generate_dump tool will
// contain these annotations.
arguments->push_back("--monitor-self-annotation=ptype=crashpad-handler");
} }
bool GetHandlerPath(base::FilePath* exe_dir, base::FilePath* handler_path) { bool GetHandlerPath(base::FilePath* exe_dir, base::FilePath* handler_path) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment