From f84cafe4fd33d0bc8f8ae3744a5d23eb277cd0d8 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Tue, 24 May 2022 07:41:08 -0700 Subject: [PATCH] chore: add a TRACE call for `crash_reporter::Start()` (#34326) chore: add a TRACE call for crash_reporter::Start() Initializing the crashReporter takes around 620 milliseconds on Intel macOS. I have sent a CL to crashpad to partially fix the performance issue in https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3641386. It would be beneficial to log the performance impact of this function in the traces in case this slows down in the future. Signed-off-by: Darshan Sen Co-authored-by: Darshan Sen --- shell/browser/api/electron_api_crash_reporter.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shell/browser/api/electron_api_crash_reporter.cc b/shell/browser/api/electron_api_crash_reporter.cc index 7740441b3a0bc..984c412bb6b71 100644 --- a/shell/browser/api/electron_api_crash_reporter.cc +++ b/shell/browser/api/electron_api_crash_reporter.cc @@ -16,6 +16,7 @@ #include "base/path_service.h" #include "base/strings/utf_string_conversions.h" #include "base/threading/thread_restrictions.h" +#include "base/trace_event/trace_event.h" #include "chrome/common/chrome_paths.h" #include "components/upload_list/crash_upload_list.h" #include "components/upload_list/text_log_upload_list.h" @@ -135,6 +136,7 @@ void Start(const std::string& submit_url, const std::map& global_extra, const std::map& extra, bool is_node_process) { + TRACE_EVENT0("electron", "crash_reporter::Start"); #if !defined(MAS_BUILD) if (g_crash_reporter_initialized) return;