#ifndef BASE_TRACE_EVENT_TRACE_EVENT_H_
#define BASE_TRACE_EVENT_TRACE_EVENT_H_
#include <stddef.h>
#include <stdint.h>
#include <memory>
#include <utility>
#include "base/atomicops.h"
#include "base/base_export.h"
#include "base/threading/platform_thread.h"
#include "base/time/time.h"
#include "base/time/time_override.h"
#include "base/trace_event/builtin_categories.h"
#include "base/trace_event/common/trace_event_common.h"
#include "base/trace_event/trace_arguments.h"
#include "base/trace_event/trace_category.h"
#include "base/trace_event/trace_log.h"
#include "base/trace_event/traced_value_support.h"
#include "base/tracing_buildflags.h"
#define TRACE_EVENT_API_ADD_TRACE_EVENT …
#define TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_BIND_ID …
#define TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_PROCESS_ID …
#define TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP …
#define TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION …
#define TRACE_EVENT_API_ADD_METADATA_EVENT …
#define TRACE_EVENT_API_ATOMIC_WORD …
#define TRACE_EVENT_API_ATOMIC_LOAD(var) …
#define TRACE_EVENT_API_ATOMIC_STORE(var, value) …
#define TRACE_EVENT_API_CLASS_EXPORT …
namespace trace_event_internal {
const int kZeroNumArgs = …;
const std::nullptr_t kGlobalScope = …;
const uint64_t kNoId = …;
class BASE_EXPORT TraceID { … };
base::trace_event::TraceEventHandle BASE_EXPORT
AddTraceEvent(char phase,
const unsigned char* category_group_enabled,
const char* name,
const char* scope,
uint64_t id,
base::trace_event::TraceArguments* args,
unsigned int flags);
base::trace_event::TraceEventHandle BASE_EXPORT
AddTraceEventWithBindId(char phase,
const unsigned char* category_group_enabled,
const char* name,
const char* scope,
uint64_t id,
uint64_t bind_id,
base::trace_event::TraceArguments* args,
unsigned int flags);
base::trace_event::TraceEventHandle BASE_EXPORT
AddTraceEventWithProcessId(char phase,
const unsigned char* category_group_enabled,
const char* name,
const char* scope,
uint64_t id,
base::ProcessId process_id,
base::trace_event::TraceArguments* args,
unsigned int flags);
base::trace_event::TraceEventHandle BASE_EXPORT
AddTraceEventWithThreadIdAndTimestamp(
char phase,
const unsigned char* category_group_enabled,
const char* name,
const char* scope,
uint64_t id,
base::PlatformThreadId thread_id,
const base::TimeTicks& timestamp,
base::trace_event::TraceArguments* args,
unsigned int flags);
base::trace_event::TraceEventHandle BASE_EXPORT
AddTraceEventWithThreadIdAndTimestamp(
char phase,
const unsigned char* category_group_enabled,
const char* name,
const char* scope,
uint64_t id,
uint64_t bind_id,
base::PlatformThreadId thread_id,
const base::TimeTicks& timestamp,
base::trace_event::TraceArguments* args,
unsigned int flags);
base::trace_event::TraceEventHandle BASE_EXPORT
AddTraceEventWithThreadIdAndTimestamps(
char phase,
const unsigned char* category_group_enabled,
const char* name,
const char* scope,
uint64_t id,
base::PlatformThreadId thread_id,
const base::TimeTicks& timestamp,
const base::ThreadTicks& thread_timestamp,
unsigned int flags);
void BASE_EXPORT AddMetadataEvent(const unsigned char* category_group_enabled,
const char* name,
base::trace_event::TraceArguments* args,
unsigned int flags);
int BASE_EXPORT GetNumTracesRecorded();
void BASE_EXPORT
UpdateTraceEventDuration(const unsigned char* category_group_enabled,
const char* name,
base::trace_event::TraceEventHandle handle);
void BASE_EXPORT
UpdateTraceEventDurationExplicit(const unsigned char* category_group_enabled,
const char* name,
base::trace_event::TraceEventHandle handle,
base::PlatformThreadId thread_id,
bool explicit_timestamps,
const base::TimeTicks& now,
const base::ThreadTicks& thread_now);
template <class ARG1_TYPE>
inline base::trace_event::TraceEventHandle
AddTraceEventWithThreadIdAndTimestamp(
char phase,
const unsigned char* category_group_enabled,
const char* name,
const char* scope,
uint64_t id,
base::PlatformThreadId thread_id,
const base::TimeTicks& timestamp,
unsigned int flags,
uint64_t bind_id,
const char* arg1_name,
ARG1_TYPE&& arg1_val) { … }
template <class ARG1_TYPE, class ARG2_TYPE>
inline base::trace_event::TraceEventHandle
AddTraceEventWithThreadIdAndTimestamp(
char phase,
const unsigned char* category_group_enabled,
const char* name,
const char* scope,
uint64_t id,
base::PlatformThreadId thread_id,
const base::TimeTicks& timestamp,
unsigned int flags,
uint64_t bind_id,
const char* arg1_name,
ARG1_TYPE&& arg1_val,
const char* arg2_name,
ARG2_TYPE&& arg2_val) { … }
inline base::trace_event::TraceEventHandle
AddTraceEventWithThreadIdAndTimestamp(
char phase,
const unsigned char* category_group_enabled,
const char* name,
const char* scope,
uint64_t id,
base::PlatformThreadId thread_id,
const base::TimeTicks& timestamp,
unsigned int flags,
uint64_t bind_id) { … }
inline base::trace_event::TraceEventHandle AddTraceEvent(
char phase,
const unsigned char* category_group_enabled,
const char* name,
const char* scope,
uint64_t id,
unsigned int flags,
uint64_t bind_id) { … }
template <class ARG1_TYPE>
inline base::trace_event::TraceEventHandle AddTraceEvent(
char phase,
const unsigned char* category_group_enabled,
const char* name,
const char* scope,
uint64_t id,
unsigned int flags,
uint64_t bind_id,
const char* arg1_name,
ARG1_TYPE&& arg1_val) { … }
template <class ARG1_TYPE, class ARG2_TYPE>
inline base::trace_event::TraceEventHandle AddTraceEvent(
char phase,
const unsigned char* category_group_enabled,
const char* name,
const char* scope,
uint64_t id,
unsigned int flags,
uint64_t bind_id,
const char* arg1_name,
ARG1_TYPE&& arg1_val,
const char* arg2_name,
ARG2_TYPE&& arg2_val) { … }
template <class ARG1_TYPE>
void AddMetadataEvent(const unsigned char* category_group_enabled,
const char* event_name,
const char* arg_name,
ARG1_TYPE&& arg_val) { … }
}
namespace base {
namespace trace_event {
template <typename IDType, const char* category>
class TraceScopedTrackableObject { … };
}
}
#endif