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

Issue 1784133002: [tracing] Adding task information to heap profiler (Closed)

Created:
4 years, 9 months ago by ssid
Modified:
4 years, 8 months ago
CC:
chirantan+watch_chromium.org, chromium-reviews, sadrul, scheduler-bugs_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[tracing] Adding task information to heap profiler This CL adds more information to the malloc heap profiler added in crrev.com/1675183006. The heap profiler only shows trace events and all the tasks show up as "MessageLoop::Runtask". This CL does: - Moves TRACE_TASK_EXECUTION macro from task_annotator to trace_event.h. - Adds extra scoped trace event to track the task context in heap profiler. - The folder where the task was posted from is used to categorize allocations. - Uses the type_name for context temporarily till we define a new context dimension for allocations. BUG=594803 Committed: https://crrev.com/533c402f8b21e503ebcaf3f0de427f41076b4de1 Cr-Commit-Position: refs/heads/master@{#384521}

Patch Set 1 : fix file name as type. #

Patch Set 2 : Use tracked_objects. #

Patch Set 3 : use SetThreadName function. #

Total comments: 12

Patch Set 4 : Use ThreadIdNameManager #

Total comments: 2

Patch Set 5 : Stack of categories. #

Patch Set 6 : With hack to get posted_by. #

Patch Set 7 : Without posted_by. #

Patch Set 8 : Just add file name #

Patch Set 9 : Only add file name. #

Patch Set 10 : nits. #

Total comments: 14

Patch Set 11 : Fixes. #

Total comments: 18

Patch Set 12 : Petr's comments #

Total comments: 10

Patch Set 13 : Fix macros and add unittest. #

Patch Set 14 : Fix macros again and the builds. #

Total comments: 25

Patch Set 15 : Renames, parentheses and fix win build #

Patch Set 16 : nit. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+169 lines, -27 lines) Patch
M base/debug/task_annotator.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -5 lines 0 comments Download
M base/threading/sequenced_worker_pool.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M base/threading/worker_pool_posix.cc View 1 1 chunk +1 line, -3 lines 0 comments Download
M base/threading/worker_pool_win.cc View 1 2 3 4 14 1 chunk +1 line, -3 lines 0 comments Download
M base/trace_event/common/trace_event_common.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +9 lines, -0 lines 0 comments Download
M base/trace_event/heap_profiler_allocation_context_tracker.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +9 lines, -0 lines 0 comments Download
M base/trace_event/heap_profiler_allocation_context_tracker.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +19 lines, -1 line 0 comments Download
M base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +27 lines, -0 lines 0 comments Download
M base/trace_event/heap_profiler_type_name_deduplicator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +32 lines, -1 line 0 comments Download
M base/trace_event/heap_profiler_type_name_deduplicator_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +39 lines, -14 lines 0 comments Download
M base/trace_event/trace_event.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +30 lines, -0 lines 0 comments Download
M components/scheduler/base/task_queue_manager.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 70 (36 generated)
ssid
This adds the file name as the type for malloc. Do you think I should ...
4 years, 9 months ago (2016-03-14 23:08:18 UTC) #11
Primiano Tucci (use gerrit)
Thanks so much, see comments below. I think my major concern is: not sure we ...
4 years, 9 months ago (2016-03-15 16:44:33 UTC) #12
Dmitry Skiba
https://codereview.chromium.org/1784133002/diff/200001/base/debug/task_annotator.h File base/debug/task_annotator.h (right): https://codereview.chromium.org/1784133002/diff/200001/base/debug/task_annotator.h#newcode47 base/debug/task_annotator.h:47: if (base::trace_event::AllocationContextTracker::capture_enabled()) { BTW, since this is inside base ...
4 years, 9 months ago (2016-03-15 19:38:31 UTC) #14
ssid
I don't understand when u say stack traces might look independent. Do you have an ...
4 years, 9 months ago (2016-03-17 00:11:47 UTC) #15
Sami
https://codereview.chromium.org/1784133002/diff/240001/base/debug/task_annotator.h File base/debug/task_annotator.h (right): https://codereview.chromium.org/1784133002/diff/240001/base/debug/task_annotator.h#newcode47 base/debug/task_annotator.h:47: if (trace_event::AllocationContextTracker::capture_enabled()) { Might want to add a throw ...
4 years, 9 months ago (2016-03-17 17:06:26 UTC) #18
ssid
Thanks for reviews. I think I understand the issue better now. 1. I cannot add ...
4 years, 9 months ago (2016-03-17 21:52:05 UTC) #19
ssid
On 2016/03/17 21:52:05, ssid wrote: > Thanks for reviews. I think I understand the issue ...
4 years, 9 months ago (2016-03-17 22:42:20 UTC) #20
ssid
+petr One more review for you. background context: We are not yet sure how the ...
4 years, 9 months ago (2016-03-25 00:19:48 UTC) #26
Primiano Tucci (use gerrit)
Some comments here and there, approach sounds reasonable % implementation details. https://codereview.chromium.org/1784133002/diff/400001/base/debug/task_annotator.h File base/debug/task_annotator.h (right): ...
4 years, 9 months ago (2016-03-25 01:56:31 UTC) #28
ssid
Thanks comments addressed. https://codereview.chromium.org/1784133002/diff/400001/base/debug/task_annotator.h File base/debug/task_annotator.h (right): https://codereview.chromium.org/1784133002/diff/400001/base/debug/task_annotator.h#newcode47 base/debug/task_annotator.h:47: base::trace_event::AllocationContextTracker::ScopedTaskExecutionEvent event( \ On 2016/03/25 01:56:31, ...
4 years, 8 months ago (2016-03-28 18:14:49 UTC) #32
ssid
+oysteine Can you please take a look at trace_event.h and tell me if this a ...
4 years, 8 months ago (2016-03-28 18:19:15 UTC) #34
petrcermak
I'm fine with this hack and I added some comments. However, I do NOT want ...
4 years, 8 months ago (2016-03-29 12:49:05 UTC) #35
ssid
On 2016/03/29 12:49:05, petrcermak wrote: > I'm fine with this hack and I added some ...
4 years, 8 months ago (2016-03-29 18:32:45 UTC) #36
petrcermak
LGTM from my side (assuming you're not expecting me to parse the categories in Trace ...
4 years, 8 months ago (2016-03-29 18:42:13 UTC) #38
oystein (OOO til 10th of July)
https://codereview.chromium.org/1784133002/diff/500001/base/trace_event/heap_profiler_allocation_context_tracker.cc File base/trace_event/heap_profiler_allocation_context_tracker.cc (right): https://codereview.chromium.org/1784133002/diff/500001/base/trace_event/heap_profiler_allocation_context_tracker.cc#newcode106 base/trace_event/heap_profiler_allocation_context_tracker.cc:106: if (task_contexts_.size() < kMaxTaskDepth) Shouldn't this be a DCHECK(task_contexts.size() ...
4 years, 8 months ago (2016-03-29 21:28:35 UTC) #39
ssid
Thanks, made changes. https://codereview.chromium.org/1784133002/diff/460001/base/trace_event/heap_profiler_type_name_deduplicator.cc File base/trace_event/heap_profiler_type_name_deduplicator.cc (right): https://codereview.chromium.org/1784133002/diff/460001/base/trace_event/heap_profiler_type_name_deduplicator.cc#newcode23 base/trace_event/heap_profiler_type_name_deduplicator.cc:23: StringPiece ExtractDirNameFromTaskContext(const char* type_name) { On ...
4 years, 8 months ago (2016-03-29 23:04:19 UTC) #41
oystein (OOO til 10th of July)
https://codereview.chromium.org/1784133002/diff/500001/base/trace_event/heap_profiler_allocation_context_tracker.cc File base/trace_event/heap_profiler_allocation_context_tracker.cc (right): https://codereview.chromium.org/1784133002/diff/500001/base/trace_event/heap_profiler_allocation_context_tracker.cc#newcode106 base/trace_event/heap_profiler_allocation_context_tracker.cc:106: if (task_contexts_.size() < kMaxTaskDepth) On 2016/03/29 23:04:19, ssid wrote: ...
4 years, 8 months ago (2016-03-29 23:44:52 UTC) #42
ssid
> Almost! I mainly don't think trace_event.h should have the macro at all, for > ...
4 years, 8 months ago (2016-03-30 00:01:23 UTC) #44
oystein (OOO til 10th of July)
On 2016/03/30 00:01:23, ssid wrote: > > Almost! I mainly don't think trace_event.h should have ...
4 years, 8 months ago (2016-03-30 16:28:59 UTC) #46
ssid
This change is mostly to reflect trace event movement in base and to be consistent ...
4 years, 8 months ago (2016-03-30 17:51:49 UTC) #47
ssid
<Actually add reviewers this time> This change is mostly to reflect trace event movement in ...
4 years, 8 months ago (2016-03-30 17:52:46 UTC) #49
jochen (gone - plz use gerrit)
lgtm
4 years, 8 months ago (2016-03-31 15:09:43 UTC) #50
Primiano Tucci (use gerrit)
//base/trace_event LGTM with some minor comments (plz look at them before landing) https://codereview.chromium.org/1784133002/diff/590001/base/trace_event/heap_profiler_allocation_context_tracker.h File base/trace_event/heap_profiler_allocation_context_tracker.h ...
4 years, 8 months ago (2016-03-31 15:37:16 UTC) #51
ssid
https://codereview.chromium.org/1784133002/diff/590001/base/trace_event/heap_profiler_allocation_context_tracker.h File base/trace_event/heap_profiler_allocation_context_tracker.h (right): https://codereview.chromium.org/1784133002/diff/590001/base/trace_event/heap_profiler_allocation_context_tracker.h#newcode63 base/trace_event/heap_profiler_allocation_context_tracker.h:63: void PushCurrentTaskContext(const char* context); On 2016/03/31 15:37:16, Primiano Tucci ...
4 years, 8 months ago (2016-03-31 16:02:49 UTC) #52
Primiano Tucci (use gerrit)
https://codereview.chromium.org/1784133002/diff/590001/base/trace_event/heap_profiler_allocation_context_tracker.h File base/trace_event/heap_profiler_allocation_context_tracker.h (right): https://codereview.chromium.org/1784133002/diff/590001/base/trace_event/heap_profiler_allocation_context_tracker.h#newcode63 base/trace_event/heap_profiler_allocation_context_tracker.h:63: void PushCurrentTaskContext(const char* context); On 2016/03/31 16:02:49, ssid wrote: ...
4 years, 8 months ago (2016-03-31 16:10:59 UTC) #53
Nico
base/ lgtm https://codereview.chromium.org/1784133002/diff/590001/base/threading/worker_pool_win.cc File base/threading/worker_pool_win.cc (right): https://codereview.chromium.org/1784133002/diff/590001/base/threading/worker_pool_win.cc#newcode24 base/threading/worker_pool_win.cc:24: TRACE_TASK_EXECUTION("WorkerThread::ThreadMain::Run", (*pending_task)); nit: no parens around *pending_task ...
4 years, 8 months ago (2016-03-31 16:12:48 UTC) #54
ssid
https://codereview.chromium.org/1784133002/diff/590001/base/threading/worker_pool_win.cc File base/threading/worker_pool_win.cc (right): https://codereview.chromium.org/1784133002/diff/590001/base/threading/worker_pool_win.cc#newcode24 base/threading/worker_pool_win.cc:24: TRACE_TASK_EXECUTION("WorkerThread::ThreadMain::Run", (*pending_task)); On 2016/03/31 16:12:48, Nico wrote: > nit: ...
4 years, 8 months ago (2016-04-01 04:34:54 UTC) #55
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1784133002/630001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1784133002/630001
4 years, 8 months ago (2016-04-01 05:10:04 UTC) #57
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-01 06:44:25 UTC) #59
Primiano Tucci (use gerrit)
https://codereview.chromium.org/1784133002/diff/590001/base/trace_event/heap_profiler_allocation_context_tracker.h File base/trace_event/heap_profiler_allocation_context_tracker.h (right): https://codereview.chromium.org/1784133002/diff/590001/base/trace_event/heap_profiler_allocation_context_tracker.h#newcode63 base/trace_event/heap_profiler_allocation_context_tracker.h:63: void PushCurrentTaskContext(const char* context); On 2016/04/01 04:34:54, ssid wrote: ...
4 years, 8 months ago (2016-04-01 08:36:16 UTC) #60
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1784133002/630001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1784133002/630001
4 years, 8 months ago (2016-04-01 08:36:49 UTC) #63
commit-bot: I haz the power
Committed patchset #18 (id:630001)
4 years, 8 months ago (2016-04-01 08:42:04 UTC) #65
commit-bot: I haz the power
Patchset 18 (id:??) landed as https://crrev.com/533c402f8b21e503ebcaf3f0de427f41076b4de1 Cr-Commit-Position: refs/heads/master@{#384521}
4 years, 8 months ago (2016-04-01 08:44:41 UTC) #67
Ken Russell (switch to Gerrit)
4 years, 8 months ago (2016-04-01 21:44:35 UTC) #68
Message was sent while issue was closed.
A revert of this CL (patchset #18 id:630001) has been created in
https://codereview.chromium.org/1846333002/ by kbr@chromium.org.

The reason for reverting is: Caused flakiness of trace_test; see Issue 599794.
.

Powered by Google App Engine
This is Rietveld 408576698