Description[tracing] Add trace events filtering predicate for heap profiler
The heap profiler gets context for each allocation only from trace
events whose category is enabled for recording. This CL changes:
1. The AddTraceEvent was called only for trace events with categories
that are enabled for recording modes, but now it gets called for all
categories including ones specified in filters.
2. Trace events are not added to traces if the category is enabled for
filtering but not enabled for recording, irrespective of the filter
result.
3. Add new filter "heap_profiler_predicate" that tracks trace events and
adds to heap profiler pseudo stack. This filter returns true only for
the events enabled for recording mode (only the recording mode is
affected by filters, not etw and event callback modes).
4. When "memory-infra" is enabled with heap profiler flag turned on,
then the heap profiler filter is installed by default and filters all
categories and adds to trace only if the category is enabled for
recording.
This ensures that the heap profiler filter always gets all trace events
and they only get added to trace file if they are enabled for recording,
or they are enabled by other filters.
BUG=598426, 625170
Committed: https://crrev.com/f35fbb8a6b310e118dc2e04d29849f27613a4754
Cr-Commit-Position: refs/heads/master@{#414210}
Patch Set 1 #
Total comments: 1
Patch Set 2 : Ignore filter if not recording. #
Total comments: 2
Patch Set 3 : base_export and MakeUnique #
Total comments: 8
Patch Set 4 : Primiano's comments. #
Depends on Patchset: Dependent Patchsets: Messages
Total messages: 38 (31 generated)
|