Browse Source

chore: add a TRACE call for `crash_reporter::Start()` (#34268)

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 <[email protected]>
Darshan Sen 2 years ago
parent
commit
df9383cb3c
1 changed files with 2 additions and 0 deletions
  1. 2 0
      shell/browser/api/electron_api_crash_reporter.cc

+ 2 - 0
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<std::string, std::string>& global_extra,
            const std::map<std::string, std::string>& extra,
            bool is_node_process) {
+  TRACE_EVENT0("electron", "crash_reporter::Start");
 #if !defined(MAS_BUILD)
   if (g_crash_reporter_initialized)
     return;