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

Issue 8233037: Update task tracking to not depend on message_loop_ singleton (Closed)

Created:
9 years, 2 months ago by jar (doing other things)
Modified:
9 years, 2 months ago
CC:
chromium-reviews, brettw-cc_chromium.org, eroman, darin (slow to review)
Visibility:
Public.

Description

Update task tracking to not depend on message_loop_ singleton I also did a bunch of cleanup, and transitioned to tracking the duration of a run, rather than the time from posting (construction of a task) to completion of the run. It is less interesting for now to track queueing delay, and we need a focus on task execution time. I left in the hook (API) with the expectation that I'll be extending the tracked_objects code to include this as well. I also landed changes to run in Linux/Mac. The fact that I've punted on shutdown made this landing easy (all code support was previously lost during migration to some flavor of bind support). r=willchan,jam,viettrungluu,ajwong BUG=62728 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=105694

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Total comments: 15

Patch Set 9 : '' #

Total comments: 12

Patch Set 10 : '' #

Patch Set 11 : '' #

Patch Set 12 : '' #

Patch Set 13 : '' #

Patch Set 14 : '' #

Patch Set 15 : '' #

Patch Set 16 : '' #

Patch Set 17 : '' #

Patch Set 18 : '' #

Patch Set 19 : '' #

Patch Set 20 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+356 lines, -396 lines) Patch
M base/message_loop.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +8 lines, -6 lines 0 comments Download
M base/threading/worker_pool_posix.h View 1 2 3 4 5 6 2 chunks +10 lines, -4 lines 0 comments Download
M base/threading/worker_pool_posix.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +12 lines, -0 lines 0 comments Download
M base/threading/worker_pool_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +8 lines, -4 lines 0 comments Download
M base/tracked_objects.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 23 chunks +108 lines, -97 lines 0 comments Download
M base/tracked_objects.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 27 chunks +195 lines, -276 lines 0 comments Download
M base/tracked_objects_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +8 lines, -6 lines 0 comments Download
M content/browser/browser_main.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +7 lines, -3 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
jar (doing other things)
@willchan: This relates to the bug you filed about message loop. I basically stopped saving ...
9 years, 2 months ago (2011-10-14 02:29:52 UTC) #1
jar (doing other things)
http://codereview.chromium.org/8233037/diff/19006/base/tracked_objects.cc File base/tracked_objects.cc (right): http://codereview.chromium.org/8233037/diff/19006/base/tracked_objects.cc#newcode380 base/tracked_objects.cc:380: NOTREACHED(); This has to be removed. This code is ...
9 years, 2 months ago (2011-10-14 15:48:42 UTC) #2
jam
content lgtm
9 years, 2 months ago (2011-10-14 16:03:15 UTC) #3
awong
So lgtm for mac TODO. For my TODO, which I think was mac only, the ...
9 years, 2 months ago (2011-10-14 16:54:49 UTC) #4
jar (doing other things)
Response to comment by ajwong. http://codereview.chromium.org/8233037/diff/19006/base/threading/worker_pool_posix.cc File base/threading/worker_pool_posix.cc (right): http://codereview.chromium.org/8233037/diff/19006/base/threading/worker_pool_posix.cc#newcode93 base/threading/worker_pool_posix.cc:93: tracked_objects::ThreadData::TallyADeathIfActive(pending_task.post_births, Look in this ...
9 years, 2 months ago (2011-10-14 22:15:53 UTC) #5
jar (doing other things)
http://codereview.chromium.org/8233037/diff/19006/base/threading/worker_pool_posix.cc File base/threading/worker_pool_posix.cc (right): http://codereview.chromium.org/8233037/diff/19006/base/threading/worker_pool_posix.cc#newcode93 base/threading/worker_pool_posix.cc:93: tracked_objects::ThreadData::TallyADeathIfActive(pending_task.post_births, Doh.... I' misread.... your question is about the ...
9 years, 2 months ago (2011-10-14 22:18:23 UTC) #6
jar (doing other things)
Uploaded changes. http://codereview.chromium.org/8233037/diff/19006/base/threading/worker_pool_posix.cc File base/threading/worker_pool_posix.cc (right): http://codereview.chromium.org/8233037/diff/19006/base/threading/worker_pool_posix.cc#newcode93 base/threading/worker_pool_posix.cc:93: tracked_objects::ThreadData::TallyADeathIfActive(pending_task.post_births, Sorry about that... until I modify ...
9 years, 2 months ago (2011-10-14 22:59:57 UTC) #7
awong
I got a chance to look at more than just my TODO and had a ...
9 years, 2 months ago (2011-10-14 23:29:01 UTC) #8
jar (doing other things)
9 years, 2 months ago (2011-10-15 15:11:32 UTC) #9
Response to ajwong's comments.

I did more name cleaning beyond the requested changes, and implemented support
for queue duration display as well as run-time duration display.

http://codereview.chromium.org/8233037/diff/24001/base/tracked_objects.cc
File base/tracked_objects.cc (right):

http://codereview.chromium.org/8233037/diff/24001/base/tracked_objects.cc#new...
base/tracked_objects.cc:53: static_cast<int>(life_duration_.InMilliseconds()),
Done.

I'll be surprised when we have more than 24days of milliseconds.... but I guess
this way I don't need to worry about it.


On 2011/10/14 23:29:02, awong wrote:
> Would it be worth using the 64-bit compatibility format macros and avoid the
> cast?
> 
>
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#64-bit_Portabi...

http://codereview.chromium.org/8233037/diff/24001/base/tracked_objects.cc#new...
base/tracked_objects.cc:273: #endif
On 2011/10/14 23:29:02, awong wrote:
> It'd be nice to just #else the rest of the function rather than relying on
> compiler deadbranch elimination.

Done.

http://codereview.chromium.org/8233037/diff/24001/base/tracked_objects.cc#new...
base/tracked_objects.cc:289: #endif
On 2011/10/14 23:29:02, awong wrote:
> Same as above.

Done.

http://codereview.chromium.org/8233037/diff/24001/base/tracked_objects.cc#new...
base/tracked_objects.cc:298: // we discard time_posted.
On 2011/10/14 23:29:02, awong wrote:
> Should this be a TODO with a bug?

I went ahead and implemented queue duration tallying as well.

http://codereview.chromium.org/8233037/diff/24001/base/tracked_objects.h
File base/tracked_objects.h (right):

http://codereview.chromium.org/8233037/diff/24001/base/tracked_objects.h#newc...
base/tracked_objects.h:69: // currently over-write the birth time with the time
at which a Run() of the
On 2011/10/14 23:29:02, awong wrote:
> over-write -> overwrite

Done.

http://codereview.chromium.org/8233037/diff/24001/base/tracked_objects.h#newc...
base/tracked_objects.h:485: static ThreadData* FactoryGet(const char*
suggested_name);
Done.

On 2011/10/14 23:29:02, awong wrote:
> I thought the general pattern for singleton-ish getters was just to call this
> ThreadData* Get().
> 
> FactoryGet() makes me think you're getting a factory.
> 
> If we use the MessageLoopProxy style convention, we'd just leave this as
> "current()"
> 
> BTW, what happens if you call it with different suggested_names twice in one
> thread?  Would it be better to just have a InitForThread() function separate
> from the current() call?

Powered by Google App Engine
This is Rietveld 408576698