#ifndef BASE_TRACE_EVENT_TYPED_MACROS_INTERNAL_H_
#define BASE_TRACE_EVENT_TYPED_MACROS_INTERNAL_H_
#include "base/base_export.h"
#include "base/macros/uniquify.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/typed_macros_embedder_support.h"
#include "build/build_config.h"
#include "third_party/perfetto/include/perfetto/protozero/message_handle.h"
#include "third_party/perfetto/include/perfetto/tracing/event_context.h"
#include "third_party/perfetto/include/perfetto/tracing/internal/write_track_event_args.h"
#include "third_party/perfetto/include/perfetto/tracing/string_helpers.h"
#include "third_party/perfetto/include/perfetto/tracing/track.h"
#include "third_party/perfetto/protos/perfetto/trace/track_event/track_event.pbzero.h"
namespace trace_event_internal {
extern BASE_EXPORT const perfetto::Track kDefaultTrack;
inline constexpr char kTraceEventEndName[] = …;
base::trace_event::TrackEventHandle BASE_EXPORT
CreateTrackEvent(char phase,
const unsigned char* category_group_enabled,
perfetto::StaticString name,
base::TimeTicks timestamp,
uint64_t track_uuid,
bool explicit_track);
base::trace_event::TracePacketHandle BASE_EXPORT CreateTracePacket();
void BASE_EXPORT AddEmptyPacket();
bool BASE_EXPORT ShouldEmitTrackDescriptor(
uint64_t track_uuid,
base::trace_event::TrackEventHandle::IncrementalState* incr_state);
template <typename TrackType>
void WriteTrackDescriptor(const TrackType& track) { … }
template <typename... Args>
inline void AddTypedTraceEventImpl(char phase,
const unsigned char* category_group_enabled,
perfetto::StaticString name,
const perfetto::Track& track,
base::TimeTicks timestamp,
Args&&... args) { … }
template <typename TrackType,
typename... Args,
typename TrackTypeCheck = std::enable_if_t<
std::is_convertible_v<TrackType, perfetto::Track>>>
inline void AddTypedTraceEvent(char phase,
const unsigned char* category_group_enabled,
perfetto::StaticString name,
TrackType&& track,
base::TimeTicks timestamp,
Args&&... args) { … }
template <typename TrackType,
typename... Args,
typename TrackTypeCheck = std::enable_if_t<
std::is_convertible_v<TrackType, perfetto::Track>>>
inline void AddTypedTraceEvent(char phase,
const unsigned char* category_group_enabled,
perfetto::StaticString name,
TrackType&& track,
Args&&... args) { … }
template <typename... Args>
inline void AddTypedTraceEvent(char phase,
const unsigned char* category_group_enabled,
perfetto::StaticString name,
base::TimeTicks timestamp,
Args&&... args) { … }
template <typename... Args>
inline void AddTypedTraceEvent(char phase,
const unsigned char* category_group_enabled,
perfetto::StaticString name,
Args&&... args) { … }
}
#endif