#include "base/trace_event/typed_macros_internal.h"
#include "base/notreached.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/typed_macros.h"
namespace {
base::ThreadTicks ThreadNow() { … }
base::trace_event::PrepareTrackEventFunction g_typed_event_callback = …;
base::trace_event::PrepareTracePacketFunction g_trace_packet_callback = …;
base::trace_event::EmitEmptyTracePacketFunction g_empty_packet_callback = …;
std::pair<char , unsigned long long >
GetPhaseAndIdForTraceLog(bool explicit_track, uint64_t track_uuid, char phase) { … }
}
namespace trace_event_internal {
const perfetto::Track kDefaultTrack{ … };
}
namespace base {
namespace trace_event {
void EnableTypedTraceEvents(
PrepareTrackEventFunction typed_event_callback,
PrepareTracePacketFunction trace_packet_callback,
EmitEmptyTracePacketFunction empty_packet_callback) { … }
void ResetTypedTraceEventsForTesting() { … }
TrackEventHandle::TrackEventHandle(TrackEvent* event,
IncrementalState* incremental_state,
CompletionListener* listener,
bool filter_debug_annotations)
: … { … }
TrackEventHandle::TrackEventHandle()
: … { … }
TrackEventHandle::~TrackEventHandle() { … }
TrackEventHandle::CompletionListener::~CompletionListener() = default;
TracePacketHandle::TracePacketHandle(PerfettoPacketHandle packet,
CompletionListener* listener)
: … { … }
TracePacketHandle::TracePacketHandle()
: … { … }
TracePacketHandle::~TracePacketHandle() { … }
TracePacketHandle::TracePacketHandle(TracePacketHandle&& handle) noexcept { … }
TracePacketHandle& TracePacketHandle::operator=(TracePacketHandle&& handle) { … }
TracePacketHandle::CompletionListener::~CompletionListener() = default;
}
}
namespace trace_event_internal {
base::trace_event::TrackEventHandle CreateTrackEvent(
char phase,
const unsigned char* category_group_enabled,
perfetto::StaticString name,
base::TimeTicks ts,
uint64_t track_uuid,
bool explicit_track) { … }
base::trace_event::TracePacketHandle CreateTracePacket() { … }
void AddEmptyPacket() { … }
bool ShouldEmitTrackDescriptor(
uint64_t track_uuid,
base::trace_event::TrackEventHandle::IncrementalState* incr_state) { … }
}