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

Issue 7778033: Add trace code to track all posted tasks in message_loop. (Closed)

Created:
9 years, 3 months ago by jbates
Modified:
9 years, 2 months ago
CC:
chromium-reviews, Raghu Simha, ncarter (slow), idana, tim (not reviewing), brettw-cc_chromium.org
Visibility:
Public.

Description

Add trace code to track all posted tasks in message_loop and WorkerThreads (non-official builds only). It's very helpful to understand what chrome is doing at runtime. Sometimes a thread in chrome does something expensive that causes a frame hitch. With this change, any expensive task will show up clearly in traces, with the file/function of where the task was posted. TEST=go to about:tracing, run a trace and notice that all tasks are traced. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=103740

Patch Set 1 #

Total comments: 31

Patch Set 2 : tests, feedback #

Patch Set 3 : . #

Patch Set 4 : test fix #

Patch Set 5 : test fix #

Patch Set 6 : win trace tests #

Total comments: 7

Patch Set 7 : removed file/line merge from Location #

Total comments: 4

Patch Set 8 : trace_event.h formatting fix #

Patch Set 9 : trace_event.h formatting fix #

Patch Set 10 : trace_event.h formatting fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+195 lines, -142 lines) Patch
M base/debug/trace_event.h View 1 2 3 4 5 6 7 7 chunks +124 lines, -105 lines 0 comments Download
M base/debug/trace_event.cc View 1 2 3 4 5 6 7 8 9 3 chunks +13 lines, -1 line 0 comments Download
M base/debug/trace_event_unittest.cc View 1 2 3 4 5 6 7 8 5 chunks +19 lines, -15 lines 0 comments Download
M base/location.h View 1 2 3 4 5 6 1 chunk +4 lines, -4 lines 0 comments Download
M base/memory/singleton.h View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M base/message_loop.h View 1 2 3 4 5 6 1 chunk +3 lines, -3 lines 0 comments Download
M base/message_loop.cc View 1 2 3 4 5 6 4 chunks +8 lines, -3 lines 0 comments Download
M base/threading/worker_pool_posix.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M base/threading/worker_pool_posix.cc View 1 2 3 4 5 6 3 chunks +6 lines, -1 line 0 comments Download
M base/threading/worker_pool_win.cc View 1 2 3 4 5 6 3 chunks +9 lines, -1 line 0 comments Download
M chrome/browser/sync/profile_sync_service.h View 1 2 3 4 5 6 2 chunks +2 lines, -3 lines 0 comments Download
M chrome/browser/sync/profile_sync_service.cc View 1 2 3 4 5 6 2 chunks +2 lines, -6 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
jbates
http://codereview.chromium.org/7778033/diff/1/base/message_loop.h File base/message_loop.h (right): http://codereview.chromium.org/7778033/diff/1/base/message_loop.h#newcode434 base/message_loop.h:434: tracked_objects::Location birth_location; Location is only three pointers, so if ...
9 years, 3 months ago (2011-08-31 00:40:48 UTC) #1
darin (slow to review)
http://codereview.chromium.org/7778033/diff/1/base/message_loop.cc File base/message_loop.cc (right): http://codereview.chromium.org/7778033/diff/1/base/message_loop.cc#newcode462 base/message_loop.cc:462: TRACE_EVENT2("base", "MessageLoop::RunTask", does this cause the FROM_HERE strings to ...
9 years, 3 months ago (2011-08-31 21:40:54 UTC) #2
jar (doing other things)
http://codereview.chromium.org/7778033/diff/1/base/tracked.cc File base/tracked.cc (right): http://codereview.chromium.org/7778033/diff/1/base/tracked.cc#newcode46 base/tracked.cc:46: base::StringPiece str(file_line_); nit: style guide suggests abbreviations be avoided. ...
9 years, 3 months ago (2011-09-01 18:17:51 UTC) #3
jbates
With this CL, size on linux increases in text by 80KB, but bss and data ...
9 years, 3 months ago (2011-09-01 23:01:52 UTC) #4
jar (doing other things)
http://codereview.chromium.org/7778033/diff/1/base/tracked.h File base/tracked.h (right): http://codereview.chromium.org/7778033/diff/1/base/tracked.h#newcode80 base/tracked.h:80: const void* program_counter_; I think it made it clear ...
9 years, 3 months ago (2011-09-03 00:26:33 UTC) #5
jbates
http://codereview.chromium.org/7778033/diff/1/base/tracked.h File base/tracked.h (right): http://codereview.chromium.org/7778033/diff/1/base/tracked.h#newcode80 base/tracked.h:80: const void* program_counter_; On 2011/09/03 00:26:33, jar wrote: > ...
9 years, 3 months ago (2011-09-03 01:11:41 UTC) #6
jbates
Finally found the source of windows test errors. Fixed in another CL: http://codereview.chromium.org/7840017/ LG?
9 years, 3 months ago (2011-09-07 00:05:18 UTC) #7
jbates
jar: LG?
9 years, 3 months ago (2011-09-07 17:24:18 UTC) #8
joth
Thanks for adding this, I've already found these traces really useful in my own work. ...
9 years, 3 months ago (2011-09-15 10:38:09 UTC) #9
jar (doing other things)
http://codereview.chromium.org/7778033/diff/1/base/tracked.h File base/tracked.h (right): http://codereview.chromium.org/7778033/diff/1/base/tracked.h#newcode88 base/tracked.h:88: #define FROM_HERE tracked_objects::Location( \ Can you clarify how this ...
9 years, 3 months ago (2011-09-15 16:26:39 UTC) #10
joth
On 15 September 2011 17:26, <jar@chromium.org> wrote: > > http://codereview.chromium.**org/7778033/diff/1/base/**tracked.h<http://codereview.chromium.org/7778033/diff/1/base/tracked.h> > > File base/tracked.h (right): ...
9 years, 3 months ago (2011-09-15 16:45:22 UTC) #11
jbates
http://codereview.chromium.org/7778033/diff/1/base/tracked.h File base/tracked.h (right): http://codereview.chromium.org/7778033/diff/1/base/tracked.h#newcode88 base/tracked.h:88: #define FROM_HERE tracked_objects::Location( \ On 2011/09/15 16:26:39, jar wrote: ...
9 years, 3 months ago (2011-09-15 16:48:33 UTC) #12
jbates
PTAL. I removed the file/line merge change from Location and disabled the task trace events ...
9 years, 2 months ago (2011-09-29 22:59:36 UTC) #13
jar (doing other things)
nits below: You may choose to make them a separate CL. http://codereview.chromium.org/7778033/diff/24001/base/debug/trace_event_unittest.cc File base/debug/trace_event_unittest.cc (right): ...
9 years, 2 months ago (2011-09-29 23:47:05 UTC) #14
jbates
http://codereview.chromium.org/7778033/diff/24001/base/debug/trace_event_unittest.cc File base/debug/trace_event_unittest.cc (right): http://codereview.chromium.org/7778033/diff/24001/base/debug/trace_event_unittest.cc#newcode685 base/debug/trace_event_unittest.cc:685: FROM_HERE, NewRunnableFunction(&TraceWithAllMacroVariants, On 2011/09/29 23:47:05, jar wrote: > nit: ...
9 years, 2 months ago (2011-09-30 17:56:05 UTC) #15
jar (doing other things)
LGTM
9 years, 2 months ago (2011-09-30 21:14:48 UTC) #16
darin (slow to review)
LGTM
9 years, 2 months ago (2011-09-30 22:23:23 UTC) #17
akalin
9 years, 2 months ago (2011-10-03 17:21:55 UTC) #18
sync stuff LGTM

Powered by Google App Engine
This is Rietveld 408576698