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

Issue 1958703002: [tracing] Fix mising thread names in heap profiler (Closed)

Created:
4 years, 7 months ago by ssid
Modified:
4 years, 7 months ago
CC:
chromium-reviews, tracing+reviews_chromium.org, wfh+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[tracing] Fix mising thread names in heap profiler The thread name goes missing in cases where the heap profiling is enabled after SetThreadName is called. To fix this, the tracker now tries to get the thread name from prctl sys call. Both Linux and Android sets the thread name using prctl. The string allocated for thread name in tracker needs to be guarded for rentracncy. This CL also makes thread name as default first entry in the pseudo stack with thread id if unable to get thread name. Removes thread name unittest since other unittests cover these cases. BUG=609912 Committed: https://crrev.com/94291d6f25efbd4c28db5d6ba859cfcec61dc664 Cr-Commit-Position: refs/heads/master@{#394416}

Patch Set 1 : #

Patch Set 2 : Use prctl. #

Patch Set 3 : fix unittest. #

Total comments: 6

Patch Set 4 : Use strdup #

Patch Set 5 : Use thread id. #

Total comments: 4

Patch Set 6 : Array size and number format. #

Total comments: 8

Patch Set 7 : Rename and annotate. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+76 lines, -50 lines) Patch
M base/trace_event/heap_profiler_allocation_context_tracker.cc View 1 2 3 4 5 6 3 chunks +40 lines, -1 line 0 comments Download
M base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc View 1 2 3 4 5 6 10 chunks +36 lines, -49 lines 0 comments Download

Messages

Total messages: 33 (15 generated)
ssid
ptal, thanks.
4 years, 7 months ago (2016-05-06 18:42:02 UTC) #4
Primiano Tucci (use gerrit)
Hmm I'd try to avoid adding too many TLS. THey are a scarce resource and ...
4 years, 7 months ago (2016-05-09 17:21:54 UTC) #5
ssid
On 2016/05/09 17:21:54, Primiano Tucci wrote: > Hmm I'd try to avoid adding too many ...
4 years, 7 months ago (2016-05-09 23:19:53 UTC) #6
ssid
So, I updated the CL to get the name from prctl calls. It is not ...
4 years, 7 months ago (2016-05-11 23:54:32 UTC) #9
Dmitry Skiba
https://codereview.chromium.org/1958703002/diff/80001/base/trace_event/heap_profiler_allocation_context_tracker.cc File base/trace_event/heap_profiler_allocation_context_tracker.cc (right): https://codereview.chromium.org/1958703002/diff/80001/base/trace_event/heap_profiler_allocation_context_tracker.cc#newcode154 base/trace_event/heap_profiler_allocation_context_tracker.cc:154: // Ignore the string allocation and allocations from prctl ...
4 years, 7 months ago (2016-05-13 18:34:06 UTC) #11
ssid
Thanks, see replies inline. https://codereview.chromium.org/1958703002/diff/80001/base/trace_event/heap_profiler_allocation_context_tracker.cc File base/trace_event/heap_profiler_allocation_context_tracker.cc (right): https://codereview.chromium.org/1958703002/diff/80001/base/trace_event/heap_profiler_allocation_context_tracker.cc#newcode154 base/trace_event/heap_profiler_allocation_context_tracker.cc:154: // Ignore the string allocation ...
4 years, 7 months ago (2016-05-13 20:48:09 UTC) #12
ssid
Added thread ids if we dont have names.
4 years, 7 months ago (2016-05-13 21:47:52 UTC) #13
Dmitry Skiba
https://codereview.chromium.org/1958703002/diff/140001/base/trace_event/heap_profiler_allocation_context_tracker.cc File base/trace_event/heap_profiler_allocation_context_tracker.cc (right): https://codereview.chromium.org/1958703002/diff/140001/base/trace_event/heap_profiler_allocation_context_tracker.cc#newcode45 base/trace_event/heap_profiler_allocation_context_tracker.cc:45: char name[50]; Why 50? PRCTL needs 16 and longest ...
4 years, 7 months ago (2016-05-16 21:11:10 UTC) #15
ssid
https://codereview.chromium.org/1958703002/diff/140001/base/trace_event/heap_profiler_allocation_context_tracker.cc File base/trace_event/heap_profiler_allocation_context_tracker.cc (right): https://codereview.chromium.org/1958703002/diff/140001/base/trace_event/heap_profiler_allocation_context_tracker.cc#newcode45 base/trace_event/heap_profiler_allocation_context_tracker.cc:45: char name[50]; On 2016/05/16 21:11:10, Dmitry Skiba wrote: > ...
4 years, 7 months ago (2016-05-16 23:22:41 UTC) #18
Primiano Tucci (use gerrit)
Remind me one thing, why don't we use ThreadIdNameManager::GetName ? I think we had this ...
4 years, 7 months ago (2016-05-17 19:38:44 UTC) #19
Dmitry Skiba
https://codereview.chromium.org/1958703002/diff/180001/base/trace_event/heap_profiler_allocation_context_tracker.cc File base/trace_event/heap_profiler_allocation_context_tracker.cc (right): https://codereview.chromium.org/1958703002/diff/180001/base/trace_event/heap_profiler_allocation_context_tracker.cc#newcode44 base/trace_event/heap_profiler_allocation_context_tracker.cc:44: const char* GetThreadName() { On 2016/05/17 19:38:43, Primiano Tucci ...
4 years, 7 months ago (2016-05-17 20:05:18 UTC) #20
Primiano Tucci (use gerrit)
https://codereview.chromium.org/1958703002/diff/180001/base/trace_event/heap_profiler_allocation_context_tracker.cc File base/trace_event/heap_profiler_allocation_context_tracker.cc (right): https://codereview.chromium.org/1958703002/diff/180001/base/trace_event/heap_profiler_allocation_context_tracker.cc#newcode44 base/trace_event/heap_profiler_allocation_context_tracker.cc:44: const char* GetThreadName() { On 2016/05/17 20:05:18, Dmitry Skiba ...
4 years, 7 months ago (2016-05-17 20:46:12 UTC) #21
ssid
Thanks for the review. Added leak in the name and added leak annotation. https://codereview.chromium.org/1958703002/diff/180001/base/trace_event/heap_profiler_allocation_context_tracker.cc File ...
4 years, 7 months ago (2016-05-18 03:38:06 UTC) #22
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1958703002/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1958703002/200001
4 years, 7 months ago (2016-05-18 03:38:52 UTC) #24
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_compile_dbg_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_compile_dbg_ng/builds/192118)
4 years, 7 months ago (2016-05-18 04:35:36 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1958703002/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1958703002/200001
4 years, 7 months ago (2016-05-18 14:04:23 UTC) #29
commit-bot: I haz the power
Committed patchset #7 (id:200001)
4 years, 7 months ago (2016-05-18 14:35:28 UTC) #31
commit-bot: I haz the power
4 years, 7 months ago (2016-05-18 14:37:59 UTC) #33
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/94291d6f25efbd4c28db5d6ba859cfcec61dc664
Cr-Commit-Position: refs/heads/master@{#394416}

Powered by Google App Engine
This is Rietveld 408576698