diff options
author | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-28 21:11:06 +0000 |
---|---|---|
committer | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-28 21:11:06 +0000 |
commit | f15841fb802ccfd27e9fd914734e38f64e6b880d (patch) | |
tree | f9c670ccb8665db7f327b2ab7f9cd5157426100f /base/threading/worker_pool_posix.cc | |
parent | fad8296611231b3efca90eeb6708fd3036c04cbd (diff) | |
download | chromium_src-f15841fb802ccfd27e9fd914734e38f64e6b880d.zip chromium_src-f15841fb802ccfd27e9fd914734e38f64e6b880d.tar.gz chromium_src-f15841fb802ccfd27e9fd914734e38f64e6b880d.tar.bz2 |
Fully enable about:tracking by default
Support is now controlled by the flag:
--enable-tracking
and the default is always on. To turn it off, use:
--enable-tracking=0
All profiler code is compiled now in release and official
builds (in addition to debug, where it was already active),
but most entry points can be disabled (turned into no-ops)
by a single const bool setting atop tracked_objects.cc (in
case folks want to revert the perf-impact of this change).
Transition to faster Now() service on Windows for the
profiler use only.
The TimeTicks::Now() function on Window uses locking
to get a 64 bit time value. This CL transitions
times used for profiling to more directly use a
32 bit Time interface, which is actually what drives the
64 bit TimeTicks. By using the smaller value, we avoid
the need for locks, or even atomic operations for the most
part in the tracking system. On linux, we just down-sample
the standard TimeTicks to 32 bits for consistency (clean
ability to snapshot asyncronously without atomics...
but I should verify that such is helpful to performance).
I've also put in yet more cleanup and refactoring.
r=rtenneti
bug=101856
Review URL: http://codereview.chromium.org/8391019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107793 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/threading/worker_pool_posix.cc')
-rw-r--r-- | base/threading/worker_pool_posix.cc | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/base/threading/worker_pool_posix.cc b/base/threading/worker_pool_posix.cc index 41fa01a..917565d 100644 --- a/base/threading/worker_pool_posix.cc +++ b/base/threading/worker_pool_posix.cc @@ -88,15 +88,14 @@ void WorkerThread::ThreadMain() { "src_file", pending_task.posted_from.file_name(), "src_func", pending_task.posted_from.function_name()); -#if defined(TRACK_ALL_TASK_OBJECTS) - TimeTicks start_of_run = tracked_objects::ThreadData::Now(); -#endif // defined(TRACK_ALL_TASK_OBJECTS) + tracked_objects::TrackedTime start_time = + tracked_objects::ThreadData::Now(); + pending_task.task.Run(); -#if defined(TRACK_ALL_TASK_OBJECTS) - tracked_objects::ThreadData::TallyADeathIfActive(pending_task.post_births, - pending_task.time_posted, TimeTicks(), start_of_run, - tracked_objects::ThreadData::Now()); -#endif // defined(TRACK_ALL_TASK_OBJECTS) + + tracked_objects::ThreadData::TallyRunOnWorkerThreadIfTracking( + pending_task.birth_tally, pending_task.time_posted, + start_time, tracked_objects::ThreadData::Now()); } // The WorkerThread is non-joinable, so it deletes itself. @@ -122,10 +121,8 @@ PosixDynamicThreadPool::PendingTask::PendingTask( const base::Closure& task) : posted_from(posted_from), task(task) { -#if defined(TRACK_ALL_TASK_OBJECTS) - post_births = tracked_objects::ThreadData::TallyABirthIfActive(posted_from); + birth_tally = tracked_objects::ThreadData::TallyABirthIfActive(posted_from); time_posted = tracked_objects::ThreadData::Now(); -#endif // defined(TRACK_ALL_TASK_OBJECTS) } PosixDynamicThreadPool::PendingTask::~PendingTask() { |