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

Issue 2327333002: Add OnBeforeTraceLogDisabled notification to EnabledStateObserver (Closed)

Created:
4 years, 3 months ago by alph
Modified:
4 years, 1 month ago
CC:
chromium-reviews, tracing+reviews_chromium.org, wfh+watch_chromium.org, jam, darin-cc_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add OnBeforeTraceLogDisabled notification to EnabledStateObserver The method can be used to perform last call actions that require tracing still being enabled. BUG=406277

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+58 lines, -9 lines) Patch
M base/trace_event/trace_event_unittest.cc View 6 chunks +30 lines, -0 lines 0 comments Download
M base/trace_event/trace_log.h View 2 chunks +9 lines, -0 lines 0 comments Download
M base/trace_event/trace_log.cc View 3 chunks +15 lines, -5 lines 0 comments Download
M content/browser/tracing/tracing_controller_impl.cc View 1 chunk +4 lines, -4 lines 0 comments Download

Messages

Total messages: 15 (10 generated)
alph
This is a resurrection of ancient CL https://codereview.chromium.org/492823002/ Nat, could you please do the review. ...
4 years, 3 months ago (2016-09-10 00:38:41 UTC) #2
Primiano Tucci (use gerrit)
Uhm what is the context and the use case for this? Is it because you ...
4 years, 3 months ago (2016-09-12 08:08:50 UTC) #12
alph
On 2016/09/12 08:08:50, Primiano Tucci wrote: > Uhm what is the context and the use ...
4 years, 3 months ago (2016-09-12 22:18:51 UTC) #13
Primiano Tucci (use gerrit)
On 2016/09/12 22:18:51, alph wrote: > I'm going to record the CpuProfile event at the ...
4 years, 3 months ago (2016-09-12 23:02:57 UTC) #14
alph
4 years, 3 months ago (2016-09-12 23:08:22 UTC) #15
On 2016/09/12 23:02:57, Primiano Tucci wrote:
> On 2016/09/12 22:18:51, alph wrote:
> > I'm going to record the CpuProfile event at the end of the tracing session. 
> > 
> > > Is it because you want some events to "definitely" be included in the
trace
> > and
> > 
> > That's because I don't have the CPU profile ready until the recording is
done.
> 
> We have the same problem with the heap profiler, where we want to emit one
> object that has all the stack traces dictionary, but that is known only at the
> end.
> 
> The trick we use ([1] above) is the following:
> you emit an event when you know that you will need it (very likely
> ontracelogenabled or something similar *) even if you don't have the final
data
> yet (because it's too early when you emit the event).
> You pass a ConvertableToTraceFormat object as argument to this event. Think to
> this object as a promise (in the JS sense) that will be resolved only at the
end
> of the trace.
> CTTF::AppendAsTraceFormat is called at the end of the trace. You know that
this
> is the right time to dump all the data you need and that no further event can
> possibly be appended after this.
> Essentially you append beforehand an object to the trace that you know will be
> expanded at the very end. The code I linked above does precisely this
> Can this work for you?

Sounds like it can. I'll give it a try. Thanks.

>  
> * The only extra feature of a "metadata" event (poor name choice) is that it
> gives the further guarantee that the event will be there, even in cycling
mode.
> But sounds like you don't care about this case, so a plain event should just
> work.

This perhaps may make sense, as if the event is preempted I'll lose the entire
profile. 
 
> >Why's that? I'd assume that all events are there unless you're in a cyclic
> buffer mode, when it's fine if some events are preempted.
> Ah fine, I was thinking to the cycling mode ("record continuously")

Powered by Google App Engine
This is Rietveld 408576698