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

Issue 7495031: trace_event support for thread names (Closed)

Created:
9 years, 5 months ago by nduca
Modified:
9 years, 4 months ago
CC:
chromium-reviews, Paweł Hajdan Jr., brettw-cc_chromium.org, John Grabowski, tonyg
Visibility:
Public.

Description

Implement backend for thread names and process names. Added a new trace event phase 'M'/TRACE_EVENT_PHASE_METADATA, which can become a general mechanism for adding metadata to traces. The two M-type events that we then add are: {ph=M pid=<pid> name="process_name" args={ name="name of pid" }} {ph=M pid=<pid> tid=<tid> name="thread_name" args={ name="name of tid" }} base::thread is instrumented to set names automatically. I will do a followon changelist to add instrumentation to Chrome for its various processes and threads. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=95997

Patch Set 1 #

Patch Set 2 : Remove process names. With thread names, they are redundant. #

Total comments: 10

Patch Set 3 : Much cleaner, using siggi's approach.p #

Total comments: 10

Patch Set 4 : Handle thread id repeats, fix locking, clarify name lifetime. #

Total comments: 2

Patch Set 5 : Tweaks, remove changes to chrome/ #

Patch Set 6 : Tweaks to pass all trybots. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+214 lines, -8 lines) Patch
M base/debug/trace_event.h View 1 2 4 chunks +6 lines, -1 line 0 comments Download
M base/debug/trace_event.cc View 1 2 3 4 5 8 chunks +64 lines, -3 lines 0 comments Download
M base/debug/trace_event_unittest.cc View 1 2 5 chunks +93 lines, -1 line 1 comment Download
M base/threading/platform_thread.h View 1 2 3 1 chunk +6 lines, -1 line 0 comments Download
M base/threading/platform_thread_mac.mm View 1 2 3 chunks +14 lines, -0 lines 1 comment Download
M base/threading/platform_thread_posix.cc View 1 2 3 4 chunks +20 lines, -2 lines 0 comments Download
M base/threading/platform_thread_win.cc View 1 2 3 chunks +11 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
nduca
Here's the beginnings of names for threads in trace_event recordings. I will be working on ...
9 years, 5 months ago (2011-07-26 06:43:08 UTC) #1
joth
Great, thanks for adding this! A couple drive-by-ish comments attached. One thing I wonder is ...
9 years, 5 months ago (2011-07-26 09:53:17 UTC) #2
scheib
1 comment. Re: AtExit, something is causing the singleton to not be released, will chat ...
9 years, 5 months ago (2011-07-26 18:47:16 UTC) #3
jbates
I know you're already thinking about how to work around the threading startup issues, so ...
9 years, 5 months ago (2011-07-26 20:57:00 UTC) #4
nduca
So I've simplified this patch ab it based on feedback, namely by a patch to ...
9 years, 4 months ago (2011-07-28 20:38:30 UTC) #5
Sigurður Ásgeirsson
As we discussed, maybe it'd be better to stash the thread name in TLS at ...
9 years, 4 months ago (2011-08-02 19:36:41 UTC) #6
nduca
I'm psyched about this approach. Jbates, I know you suggested this previously in a discussion, ...
9 years, 4 months ago (2011-08-02 20:51:23 UTC) #7
nduca
Any feedback, folks? Lets get this shipped or shot. :)
9 years, 4 months ago (2011-08-03 21:56:53 UTC) #8
scheib
Did you catch what was causing the AtExit failures? Otherwise looked good to me.
9 years, 4 months ago (2011-08-03 22:18:13 UTC) #9
jbates
On 2011/08/03 21:56:53, nduca wrote: > Any feedback, folks? Lets get this shipped or shot. ...
9 years, 4 months ago (2011-08-03 22:20:40 UTC) #10
nduca
On 2011/08/03 22:18:13, scheib wrote: > Did you catch what was causing the AtExit failures? ...
9 years, 4 months ago (2011-08-03 22:58:07 UTC) #11
Sigurður Ásgeirsson
very neat! http://codereview.chromium.org/7495031/diff/13001/base/debug/trace_event.cc File base/debug/trace_event.cc (right): http://codereview.chromium.org/7495031/diff/13001/base/debug/trace_event.cc#newcode369 base/debug/trace_event.cc:369: if (thread_names_.find(thread_id) == thread_names_.end()) { On Windows, ...
9 years, 4 months ago (2011-08-04 12:31:39 UTC) #12
nduca
http://codereview.chromium.org/7495031/diff/13001/base/debug/trace_event.cc File base/debug/trace_event.cc (right): http://codereview.chromium.org/7495031/diff/13001/base/debug/trace_event.cc#newcode369 base/debug/trace_event.cc:369: if (thread_names_.find(thread_id) == thread_names_.end()) { On 2011/08/04 12:31:39, Ruðrugis ...
9 years, 4 months ago (2011-08-04 18:17:38 UTC) #13
Sigurður Ásgeirsson
lgtm as far as base is concerned. http://codereview.chromium.org/7495031/diff/22001/base/debug/trace_event.cc File base/debug/trace_event.cc (right): http://codereview.chromium.org/7495031/diff/22001/base/debug/trace_event.cc#newcode386 base/debug/trace_event.cc:386: // This ...
9 years, 4 months ago (2011-08-04 20:07:05 UTC) #14
nduca
Mmm, find! Whod'a thunk? :) Since we don't capture thread creation or deletion events, in ...
9 years, 4 months ago (2011-08-04 20:16:24 UTC) #15
brettw
LGTM mostly rubber stamp. http://codereview.chromium.org/7495031/diff/25001/base/debug/trace_event_unittest.cc File base/debug/trace_event_unittest.cc (right): http://codereview.chromium.org/7495031/diff/25001/base/debug/trace_event_unittest.cc#newcode584 base/debug/trace_event_unittest.cc:584: void TraceCallsWithCachedCategoryPointersPointers(const char* name_str) { ...
9 years, 4 months ago (2011-08-08 20:10:37 UTC) #16
nduca
9 years, 4 months ago (2011-08-08 22:51:16 UTC) #17
Thanks again, folks.

Powered by Google App Engine
This is Rietveld 408576698