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

Issue 1251203003: [tracing] Fix, simplify and speed up accounting of TraceEvent memory overhead (Closed)

Created:
5 years, 5 months ago by Primiano Tucci (use gerrit)
Modified:
5 years, 5 months ago
Reviewers:
dsinclair
CC:
chromium-reviews, tracing+reviews_chromium.org, wfh+watch_chromium.org, erikwright+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, simplify and speed up accounting of TraceEvent memory overhead So far the accounting of TraceEvent memory overhead worked as follows: - Each TraceEvent keeps a cache of its own overhead. - The TraceBufferChunk (which is approx an array of 64 TraceEvent) keeps a cache of the all 64 TraceEvent, but only when completelly filled. This is sub-optimal because: - There can be many TraceEvent(s), 10k-100k in a bulky 30s trace: when memory-infra is enabled, this causes a cost of several MB to keep the aforementioned per-TraceEvent caches. - Every time we have to estimate the size of a non-completely-full TraceBufferChunk, we still have to loop over their individual caches. - Least but not last, turns out that the current accounting is just wrong, as we ended up counting the sizeof(TraceEvent) both in TraceBufferChunk and in the individual TraceEvent. This CL improves the situation as follows: - The per-TraceEvent cache is dropped. Much less memory is used. - The TraceBufferChunk still keeps a cache, but its cache is used in a smarter way and not just when it is full. We simply remember how many TraceEvent(s) we estimated in the previous pass and then estimate just the missing ones. - The double accounting issue is fixed, as now we count TraceEvent(s) only in TraceBufferChunk. BUG=512383 Committed: https://crrev.com/b2ae97fb331cbad132a8e1aad9a25441fde75048 Cr-Commit-Position: refs/heads/master@{#340005}

Patch Set 1 #

Patch Set 2 : #

Total comments: 2

Patch Set 3 : Typo #

Patch Set 4 : Get rid of rendundant check #

Unified diffs Side-by-side diffs Delta from patch set Stats (+49 lines, -36 lines) Patch
M base/trace_event/trace_event_impl.h View 2 chunks +1 line, -2 lines 0 comments Download
M base/trace_event/trace_event_impl.cc View 1 2 3 4 chunks +38 lines, -34 lines 0 comments Download
M base/trace_event/trace_event_memory_overhead.h View 1 chunk +3 lines, -0 lines 0 comments Download
M base/trace_event/trace_event_memory_overhead.cc View 1 chunk +7 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 10 (3 generated)
Primiano Tucci (use gerrit)
PTAL
5 years, 5 months ago (2015-07-22 19:52:41 UTC) #2
dsinclair
lgtm w/ nit https://codereview.chromium.org/1251203003/diff/20001/base/trace_event/trace_event_impl.cc File base/trace_event/trace_event_impl.cc (right): https://codereview.chromium.org/1251203003/diff/20001/base/trace_event/trace_event_impl.cc#newcode491 base/trace_event/trace_event_impl.cc:491: // computed on the flight. nit: ...
5 years, 5 months ago (2015-07-22 20:37:31 UTC) #3
Primiano Tucci (use gerrit)
https://codereview.chromium.org/1251203003/diff/20001/base/trace_event/trace_event_impl.cc File base/trace_event/trace_event_impl.cc (right): https://codereview.chromium.org/1251203003/diff/20001/base/trace_event/trace_event_impl.cc#newcode491 base/trace_event/trace_event_impl.cc:491: // computed on the flight. On 2015/07/22 20:37:31, dsinclair ...
5 years, 5 months ago (2015-07-22 21:55:23 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1251203003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1251203003/60001
5 years, 5 months ago (2015-07-22 21:58:07 UTC) #7
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years, 5 months ago (2015-07-23 00:26:11 UTC) #8
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/b2ae97fb331cbad132a8e1aad9a25441fde75048 Cr-Commit-Position: refs/heads/master@{#340005}
5 years, 5 months ago (2015-07-23 00:27:10 UTC) #9
oystein (OOO til 10th of July)
5 years, 4 months ago (2015-08-04 20:16:13 UTC) #10
Message was sent while issue was closed.
A revert of this CL (patchset #4 id:60001) has been created in
https://codereview.chromium.org/1258903003/ by oysteine@chromium.org.

The reason for reverting is: Speculative revert for
https://code.google.com/p/chromium/issues/detail?id=516056.

Powered by Google App Engine
This is Rietveld 408576698