summaryrefslogtreecommitdiffstats
path: root/base/tracked_objects.cc
diff options
context:
space:
mode:
authorwangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-10 17:50:22 +0000
committerwangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-10 17:50:22 +0000
commite1a38d600ac88e2b70a50f1a95416ccfcb2de858 (patch)
treea40d0f20dadc3a0ac7aed507a81e179920ee4e84 /base/tracked_objects.cc
parente7537bbb3170fa60eb28b3e39a95afbefac22fd3 (diff)
downloadchromium_src-e1a38d600ac88e2b70a50f1a95416ccfcb2de858.zip
chromium_src-e1a38d600ac88e2b70a50f1a95416ccfcb2de858.tar.gz
chromium_src-e1a38d600ac88e2b70a50f1a95416ccfcb2de858.tar.bz2
Add queued_time_ms trace for events in message loop
These trace can be useful for examining the status of message loop queues when debugging some performance issues. BUG=none Review URL: https://chromiumcodereview.appspot.com/18083015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210880 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/tracked_objects.cc')
-rw-r--r--base/tracked_objects.cc13
1 files changed, 2 insertions, 11 deletions
diff --git a/base/tracked_objects.cc b/base/tracked_objects.cc
index c45276b..cc00ce6 100644
--- a/base/tracked_objects.cc
+++ b/base/tracked_objects.cc
@@ -465,16 +465,6 @@ void ThreadData::TallyRunOnNamedThreadIfTracking(
if (!current_thread_data)
return;
- // To avoid conflating our stats with the delay duration in a PostDelayedTask,
- // we identify such tasks, and replace their post_time with the time they
- // were scheduled (requested?) to emerge from the delayed task queue. This
- // means that queueing delay for such tasks will show how long they went
- // unserviced, after they *could* be serviced. This is the same stat as we
- // have for non-delayed tasks, and we consistently call it queueing delay.
- TrackedTime effective_post_time = completed_task.delayed_run_time.is_null()
- ? tracked_objects::TrackedTime(completed_task.time_posted)
- : tracked_objects::TrackedTime(completed_task.delayed_run_time);
-
// Watch out for a race where status_ is changing, and hence one or both
// of start_of_run or end_of_run is zero. In that case, we didn't bother to
// get a time value since we "weren't tracking" and we were trying to be
@@ -483,7 +473,8 @@ void ThreadData::TallyRunOnNamedThreadIfTracking(
int32 queue_duration = 0;
int32 run_duration = 0;
if (!start_of_run.is_null()) {
- queue_duration = (start_of_run - effective_post_time).InMilliseconds();
+ queue_duration = (start_of_run - completed_task.EffectiveTimePosted())
+ .InMilliseconds();
if (!end_of_run.is_null())
run_duration = (end_of_run - start_of_run).InMilliseconds();
}