Chromium Code Reviews| Index: components/startup_metric_utils/browser/startup_metric_utils.cc |
| diff --git a/components/startup_metric_utils/browser/startup_metric_utils.cc b/components/startup_metric_utils/browser/startup_metric_utils.cc |
| index 122326e95daff16a888d4106c7d148d12afeb4d7..3025e2dc618dd76b176eff6220c4db44e5f6eb75 100644 |
| --- a/components/startup_metric_utils/browser/startup_metric_utils.cc |
| +++ b/components/startup_metric_utils/browser/startup_metric_utils.cc |
| @@ -284,6 +284,8 @@ void RecordMainEntryTimeHistogram() { |
| (browser_main_entry_time_raw_ms >> 1) & kLower31BitsMask); |
| // A timestamp is a 64 bit value, yet histograms can only store 32 bits. |
| + // TODO(gabadie): Once startup_with_url.* benchmarks are replaced by |
| + // startup_with_url2.*, remove this dirty hack. |
| LOCAL_HISTOGRAM_TIMES("Startup.BrowserMainEntryTimeAbsoluteHighWord", |
| browser_main_entry_time_raw_ms_high_word); |
| LOCAL_HISTOGRAM_TIMES("Startup.BrowserMainEntryTimeAbsoluteLowWord", |
| @@ -306,6 +308,25 @@ base::Time ExeMainEntryPointTime() { |
| return base::Time(); |
| } |
| +// Traces process creation and main entry point mark events. |
| +void TraceMissingStartupInstantEvents() { |
|
gab
2015/11/10 19:30:53
Would prefer an even more specific name, e.g. AddS
gabadie
2015/11/12 08:57:20
Done.
|
| + static bool is_first_call = true; |
| + if (!is_first_call) |
| + return; |
| + is_first_call = false; |
|
gab
2015/11/10 19:30:53
This method only be called once hence you shouldn'
gabadie
2015/11/12 08:57:20
Good catch! Done.
|
| + |
| + DCHECK(!g_process_creation_time.Get().is_null()); |
| + DCHECK(!g_main_entry_point_time.Get().is_null()); |
| + |
| + TRACE_EVENT_INSTANT_WITH_TIMESTAMP("startup", |
|
gab
2015/11/10 19:30:53
Suggest running "git cl format", the argument alig
gabadie
2015/11/12 08:57:20
My bad. Done.
|
| + "Startup.BrowserProcessCreation", 0, |
| + StartupTimeToTimeTicks(g_process_creation_time.Get()).ToInternalValue()); |
|
gab
2015/11/10 19:30:53
FYI: Very soon this should use g_process_creation_
gabadie
2015/11/12 08:57:20
Done.
|
| + |
| + TRACE_EVENT_INSTANT_WITH_TIMESTAMP("startup", |
| + "Startup.BrowserMainEntryPoint", 0, |
| + StartupTimeToTimeTicks(g_main_entry_point_time.Get()).ToInternalValue()); |
|
gab
2015/11/10 19:30:53
g_main_entry_point_ticks for this too
gabadie
2015/11/12 08:57:20
Done.
|
| +} |
| + |
| } // namespace |
| bool WasNonBrowserUIDisplayed() { |
| @@ -336,6 +357,7 @@ void RecordExeMainEntryPointTime(const base::Time& time) { |
| void RecordBrowserMainMessageLoopStart(const base::Time& time, |
| bool is_first_run) { |
| + TraceMissingStartupInstantEvents(); |
| RecordHardFaultHistogram(is_first_run); |
| RecordMainEntryTimeHistogram(); |