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

Unified Diff: components/startup_metric_utils/browser/startup_metric_utils.cc

Issue 2530043002: Set process phases in the StackSamplingProfiler. (Closed)
Patch Set: addressed review comments by wittman Created 4 years 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 | « components/startup_metric_utils/browser/DEPS ('k') | content/browser/browser_main_loop.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6d9ffcc2da6bda3e1333fba7211fcbb624c6c3ce..e2eee42f6d21c6a52b9568e69feb9b5fbc855ad6 100644
--- a/components/startup_metric_utils/browser/startup_metric_utils.cc
+++ b/components/startup_metric_utils/browser/startup_metric_utils.cc
@@ -16,11 +16,13 @@
#include "base/metrics/histogram.h"
#include "base/metrics/histogram_macros.h"
#include "base/process/process_info.h"
+#include "base/profiler/stack_sampling_profiler.h"
#include "base/strings/string_number_conversions.h"
#include "base/sys_info.h"
#include "base/threading/platform_thread.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
+#include "components/metrics/call_stack_profile_metrics_provider.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
#include "components/startup_metric_utils/browser/pref_names.h"
@@ -601,6 +603,9 @@ void RecordBrowserMainMessageLoopStart(const base::TimeTicks& ticks,
RecordSystemUptimeHistogram();
RecordMainEntryTimeHistogram();
+ base::StackSamplingProfiler::SetProcessPhase(
+ metrics::CallStackProfileMetricsProvider::MAIN_LOOP_START);
Mike Wittman 2016/12/01 18:46:50 This line should be as close as possible to where
Alexei Svitkine (slow) 2016/12/01 19:49:12 Right, I think we need to clearly define what SetP
Alexei Svitkine (slow) 2017/01/05 20:54:12 Ping on this comment.
bcwhite 2017/01/06 16:50:56 In this case, the name indicates that the "main lo
Alexei Svitkine (slow) 2017/01/09 19:12:18 I guess I'm less concerned with the name and more
bcwhite 2017/01/10 17:56:54 That's not what it does, though. Perhaps "SetProc
Mike Wittman 2017/01/10 20:10:36 Just noticed that this comment still remains to be
bcwhite 2017/01/11 16:15:48 If I understand you correctly, this amounts to rem
Mike Wittman 2017/01/11 16:24:47 Yes, and moving the histogram recording immediatel
bcwhite 2017/01/11 16:26:39 Looking further, every other method also takes a t
Mike Wittman 2017/01/11 16:30:18 Sounds good to me.
bcwhite 2017/01/11 16:53:28 Done (order) and Done (naming).
+
const base::TimeTicks& process_creation_ticks =
g_process_creation_ticks.Get();
if (!is_first_run && !process_creation_ticks.is_null()) {
@@ -736,6 +741,8 @@ void RecordFirstWebContentsNonEmptyPaint(const base::TimeTicks& ticks) {
if (WasNonBrowserUIDisplayed() || g_process_creation_ticks.Get().is_null())
return;
+ base::StackSamplingProfiler::SetProcessPhase(
+ metrics::CallStackProfileMetricsProvider::FIRST_NONEMPTY_PAINT);
UMA_HISTOGRAM_AND_TRACE_WITH_TEMPERATURE_AND_SAME_VERSION_COUNT(
UMA_HISTOGRAM_LONG_TIMES_100, "Startup.FirstWebContents.NonEmptyPaint2",
g_process_creation_ticks.Get(), ticks);
@@ -749,6 +756,8 @@ void RecordFirstWebContentsMainNavigationStart(const base::TimeTicks& ticks) {
if (WasNonBrowserUIDisplayed() || g_process_creation_ticks.Get().is_null())
return;
+ base::StackSamplingProfiler::SetProcessPhase(
+ metrics::CallStackProfileMetricsProvider::MAIN_NAVIGATION_START);
UMA_HISTOGRAM_AND_TRACE_WITH_TEMPERATURE_AND_SAME_VERSION_COUNT(
UMA_HISTOGRAM_LONG_TIMES_100,
"Startup.FirstWebContents.MainNavigationStart",
@@ -764,6 +773,8 @@ void RecordFirstWebContentsMainNavigationFinished(
if (WasNonBrowserUIDisplayed() || g_process_creation_ticks.Get().is_null())
return;
+ base::StackSamplingProfiler::SetProcessPhase(
+ metrics::CallStackProfileMetricsProvider::MAIN_NAVIGATION_FINISHED);
UMA_HISTOGRAM_AND_TRACE_WITH_TEMPERATURE_AND_SAME_VERSION_COUNT(
UMA_HISTOGRAM_LONG_TIMES_100,
"Startup.FirstWebContents.MainNavigationFinished",
« no previous file with comments | « components/startup_metric_utils/browser/DEPS ('k') | content/browser/browser_main_loop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698