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

Issue 1140843003: Reduce overhead of Chrome's ETW tracing to make it more usable. (Closed)

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

Description

Reduce overhead of Chrome's ETW tracing to make it more usable. When Chrome's ETW tracing is enabled it can consume more than half of the total CPU time in the process, which means it is distorting the results it is trying to measure. It also puts a lot of data into the trace which cannot be viewed. The biggest consumer of CPU time, by far, is AppendAsTraceFormat, which consumes over 95% of the CPU time in TraceEventETWExport::AddEvent. Because all categories are enabled this ends up creating many large buffers. The cc::LayerTreeHostImpl events have been seen up to 22,500 bytes and cc::Picture payloads have been seen up to 3,200,000 bytes! Ironically the WPA trace viewer can't view payloads larger than 4094 bytes so all we see for this effort and overhead is "Unable to parse data". Truncating the payloads would let us see the partial data but would still leave the distortion of execution time. The long-term solution is to specify what categories are enabled in order to manage the volume of data. Until then the prudent thing to do is to disable calls to AppendAsTraceFormat. In addition, there is no reason for phase_string to be a std::string. This overhead is relatively minor but measurable. It's worth fixing because the fix is clean and simple. The net effect is to drop the CPU overhead from 33-50% down to 1-7%. This change makes Chrome's ETW tracing much more usable. R=primiano@chromium.org BUG=488257 Committed: https://crrev.com/41bf7a187137f3e13271de8062fb84382c54bff6 Cr-Commit-Position: refs/heads/master@{#329989}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Add reference to tracking bug. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -4 lines) Patch
M base/trace_event/trace_event_etw_export_win.cc View 1 3 chunks +12 lines, -4 lines 0 comments Download

Messages

Total messages: 11 (3 generated)
brucedawson
5 years, 7 months ago (2015-05-14 00:18:04 UTC) #1
brucedawson
Primiano, can you take a look? The other owners appear to be out right now. ...
5 years, 7 months ago (2015-05-14 20:13:14 UTC) #3
Primiano Tucci (use gerrit)
LGTM, seems reasonable to me. Just one request about keeping track of this in crbug ...
5 years, 7 months ago (2015-05-14 22:12:53 UTC) #4
brucedawson
Bug opened and linked. WPA can display *some* of the results of AppendAsTraceFormat -- all ...
5 years, 7 months ago (2015-05-14 22:41:41 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1140843003/20001
5 years, 7 months ago (2015-05-14 22:50:01 UTC) #8
brucedawson
Comment in the code added. https://codereview.chromium.org/1140843003/diff/1/base/trace_event/trace_event_etw_export_win.cc File base/trace_event/trace_event_etw_export_win.cc (right): https://codereview.chromium.org/1140843003/diff/1/base/trace_event/trace_event_etw_export_win.cc#newcode212 base/trace_event/trace_event_etw_export_win.cc:212: // "Unable to parse ...
5 years, 7 months ago (2015-05-14 22:50:06 UTC) #9
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 7 months ago (2015-05-15 00:20:56 UTC) #10
commit-bot: I haz the power
5 years, 7 months ago (2015-05-15 00:22:49 UTC) #11
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/41bf7a187137f3e13271de8062fb84382c54bff6
Cr-Commit-Position: refs/heads/master@{#329989}

Powered by Google App Engine
This is Rietveld 408576698