18 #ifndef ION_PROFILE_CALLTRACEMANAGER_H_
19 #define ION_PROFILE_CALLTRACEMANAGER_H_
149 return static_cast<uint32
>(
150 std::chrono::duration_cast<std::chrono::microseconds>(timer_.
Get())
158 return static_cast<uint64>(
159 std::chrono::duration_cast<std::chrono::nanoseconds>(timer_.
Get())
165 void WriteFile(
const std::string& filename)
const;
172 timeline_metrics_.push_back(std::move(metric));
181 struct NamedTraceRecorderArray {
182 NamedTraceRecorderArray() {
193 TraceRecorder* AllocateTraceRecorder();
199 base::ThreadLocalObject<TraceRecorder*> trace_recorder_;
202 base::ThreadLocalObject<NamedTraceRecorderArray> named_trace_recorders_;
222 std::vector<std::unique_ptr<TimelineMetric>> timeline_metrics_;
250 #endif // ION_PROFILE_CALLTRACEMANAGER_H_
Leaving the current scope.
The event for defining new WTF events, both custom and built-in events.
base::AllocUnorderedMap< uint32, const char * > ReverseScopeEventMap
Reversed mapping from custom scope event id to name.
static int GetNumArgsForEvent(uint32 event_id)
Gets the number of arguments for a particular event.
Class to automatically record scope start and end events using the given TraceRecorder.
Class for recording frame events.
Attaching data to the current scope.
static EventArgType GetArgType(uint32 event_id, int arg_index)
Gets the argument types for a particular event.
Copyright 2016 Google Inc.
Class to automatically record frame start and end events using the given TraceRecorder.
~CallTraceManager() override
void WriteFile(const std::string &filename) const
Writes the current WTF trace to a file, which usually ends in the extension ".wtf-trace".
virtual uint32 GetTimeInUs() const
Returns the time in microseconds, relative to the timebase.
BuiltinEventType
Defines the built-in WTF events that we use.
Allocatable is an abstract base class for classes whose memory is managed by an Allocator.
base::AllocUnorderedMap< const void *, uint32 > ScopeEventMap
Custom scope event mapping from name (as a pointer to a literal string) to uint32 id...
NamedTraceRecorderType
Defines name trace recorders.
Time range start and end events.
EventArgType
Defines argument types for WTF events.
Clock::duration Get() const
Returns the elapsed time since construction or the last Reset().
The frame start and end events.
std::string SnapshotCallTraces() const
Returns a snapshot of traces to a string in binary .wtf-trace format.
TraceRecorder * GetNamedTraceRecorder(NamedTraceRecorderType name)
Gets the TraceRecorder instance specific to the current thread of the given name. ...
analytics::Benchmark RunTimelineMetrics() const
Runs all registered metrics on the current timeline and returns a benchmark object containing the col...
ScopedFrameTracer(TraceRecorder *recorder, uint32 id)
const TraceList & GetAllTraceRecorders() const
Gets the list of all trace recorders for all threads.
Manages call trace recording for visualization in Web Tracing Framework (WTF) format.
Events for managing zones.
TraceRecorder * GetTraceRecorder()
Gets the TraceRecorder instance specific to the current thread.
size_t GetNumScopeEvents() const
Returns the number of unique custom scope events recorded.
The starting offset for scope event ids, purposefully set high to make room for built-in WTF events...
int GetScopeEnterEvent(const char *string_id)
Queries the event id of a scope enter event, based on string_id.
ScopedTracer(TraceRecorder *recorder, int id)
The Benchmark class provides types and utilities to make it easier to create performance benchmarks...
Timeline BuildTimeline() const
Convert the current WTF trace into a timeline.
void RegisterTimelineMetric(std::unique_ptr< TimelineMetric > metric)
Registers a timeline metric.
base::AllocVector< TraceRecorder * > TraceList
List of TraceRecorders, one created for each thread of execution.
const char * GetScopeEnterEventName(uint32 event_id) const
Returns the name of the scope enter event with the given id.
uint64 GetTimeInNs() const
Returns the time in nanoseconds, relative to the timebase.