tracing: demistify "metadata" events |
||||
Issue descriptionIn the context of https://codereview.chromium.org/2040663002/ oysteine@ and I realised that the current state of "metadata" event is an utter mess. "metadata" became an extremely overloaded term in tracing. When we speak of metadata events there are four, completely orthogonal, things in play: 1) The fact that the event is unconditionally added to the trace, regardless of the fact that the default categories are enabled or not (i.e. category filter "-*") 2) The fact that the event, if added, is guaranteed to be emitted in the final trace and never pushed out from the ring buffer 3) The category of the event itself (__metadata or something else). 4) The phase of the event itself (TRACE_EVENT_PHASE_METADATA or something else) All these three concepts today are inconsistently intermixed, leading to confusing situations like https://github.com/catapult-project/catapult/issues/2341. Some concrete examples: ----------------------- - metadata events like "process_name" which are added in TraceLog::AddMetadataEventsWhileLocked() satisfy 1+2+3+4 - TRACE_EVENT_API_ADD_METADATA_EVENT, which is used by memory-infra heap profiler and for IsTimeTicksHighResolution, satistifes only 1,2,4. It also satisfies 3 if it is called with GetCategoryGroupEnabled("__metadata") as argument. - TRACE_EVENT_METADATA1, which is used by v8.cpu_profile, satisfies 1,4, but not 2,3. In particular, if the category filter is "-*" the event will be dropped on the floor event for the "__metadata" category. - TRACE_EVENT_CLOCK_SYNC_* satisfy only 3. Clock sync markers are NOT added to the trace in presence of "-*". They Are not guaranteed to be persistent in the trace (even though the current implementation makes it very unlikely to get dropped as they are added before stopping the trace). They have ph:TRACE_EVENT_PHASE_CLOCK_SYNC. They have cat: __metadata though. Oystein and I are discussing and will figure out a plan. In the meantime the most urgent thing to fix is guaranteeing that TRACE_EVENT_CLOCK_SYNC_* satisfy 1. I'll send out a temporary fix to that.
,
Jun 29 2016
,
Feb 10 2017
,
Feb 10 2017
,
May 15 2018
> Oystein and I are discussing and will figure out a plan. Did a plan end up getting materialized?
,
May 15 2018
There's been some shakeups in the tracing space since then; currently we're working on deprecating TraceLog in favor of Perfetto (https://bugs.chromium.org/p/chromium/issues/list?can=2&q=label%3APerfetto) and figuring out how to do metadata would be part of that. |
||||
►
Sign in to add a comment |
||||
Comment 1 by bugdroid1@chromium.org
, Jun 7 2016