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

Unified Diff: chrome/browser/metrics/thread_watcher.cc

Issue 2362493002: Stack sampling profiler: set process and thread information (Closed)
Patch Set: address comments Created 4 years, 3 months 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 | « chrome/browser/metrics/thread_watcher.h ('k') | chrome/browser/metrics/thread_watcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/thread_watcher.cc
diff --git a/chrome/browser/metrics/thread_watcher.cc b/chrome/browser/metrics/thread_watcher.cc
index 6981f63052c83f34a868ca562981b2653c4ae2a2..75c4463e29a97cf8829e7c24e14805380e76f1ad 100644
--- a/chrome/browser/metrics/thread_watcher.cc
+++ b/chrome/browser/metrics/thread_watcher.cc
@@ -35,6 +35,20 @@
using content::BrowserThread;
+namespace {
+
+base::StackSamplingProfiler::SamplingParams GetJankTimeBombSamplingParams() {
+ base::StackSamplingProfiler::SamplingParams params;
+ params.initial_delay = base::TimeDelta::FromMilliseconds(0);
+ params.bursts = 1;
+ // 5 seconds at 10Hz.
+ params.samples_per_burst = 50;
+ params.sampling_interval = base::TimeDelta::FromMilliseconds(100);
+ return params;
+}
+
+} // namespace
+
// ThreadWatcher methods and members.
ThreadWatcher::ThreadWatcher(const WatchingParams& params)
: thread_id_(params.thread_id),
@@ -915,20 +929,11 @@ void StartupTimeBomb::DisarmStartupTimeBomb() {
g_startup_timebomb_->Disarm();
}
-base::StackSamplingProfiler::SamplingParams GetJankTimeBombSamplingParams() {
- base::StackSamplingProfiler::SamplingParams params;
- params.initial_delay = base::TimeDelta::FromMilliseconds(0);
- params.bursts = 1;
- // 5 seconds at 10Hz.
- params.samples_per_burst = 50;
- params.sampling_interval = base::TimeDelta::FromMilliseconds(100);
- return params;
-}
-
// JankTimeBomb methods and members.
//
-JankTimeBomb::JankTimeBomb(base::TimeDelta duration)
- : weak_ptr_factory_(this) {
+JankTimeBomb::JankTimeBomb(base::TimeDelta duration,
+ metrics::CallStackProfileParams::Thread thread)
+ : thread_(thread), weak_ptr_factory_(this) {
if (IsEnabled()) {
WatchDogThread::PostDelayedTask(
FROM_HERE,
@@ -956,6 +961,8 @@ void JankTimeBomb::Alarm(base::PlatformThreadId thread_id) {
GetJankTimeBombSamplingParams(),
metrics::CallStackProfileMetricsProvider::GetProfilerCallback(
metrics::CallStackProfileParams(
+ metrics::CallStackProfileParams::BROWSER_PROCESS,
+ thread_,
metrics::CallStackProfileParams::JANKY_TASK,
metrics::CallStackProfileParams::PRESERVE_ORDER))));
// Use synchronous profiler. It will automatically stop collection when
« no previous file with comments | « chrome/browser/metrics/thread_watcher.h ('k') | chrome/browser/metrics/thread_watcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698