#include "base/trace_event/trace_event_impl.h"
#include <stddef.h>
#include <sstream>
#include "base/format_macros.h"
#include "base/json/string_escape.h"
#include "base/memory/ptr_util.h"
#include "base/notreached.h"
#include "base/process/process_handle.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/trace_log.h"
#include "base/trace_event/traced_value.h"
#include "build/build_config.h"
PERFETTO_TRACK_EVENT_STATIC_STORAGE_IN_NAMESPACE_WITH_ATTRS(base, BASE_EXPORT);
namespace perfetto {
namespace legacy {
template <>
perfetto::ThreadTrack ConvertThreadId(const ::base::PlatformThreadId& thread) { … }
}
TraceTimestamp
TraceTimestampTraits<::base::TimeTicks>::ConvertTimestampToTraceTimeNs(
const ::base::TimeTicks& ticks) { … }
namespace internal {
void WriteDebugAnnotation(protos::pbzero::DebugAnnotation* annotation,
::base::TimeTicks ticks) { … }
void WriteDebugAnnotation(protos::pbzero::DebugAnnotation* annotation,
::base::Time time) { … }
}
}
namespace base {
namespace trace_event {
bool ConvertableToTraceFormat::AppendToProto(ProtoAppender* appender) const { … }
static_assert …;
TraceEvent::TraceEvent() = default;
TraceEvent::TraceEvent(PlatformThreadId thread_id,
TimeTicks timestamp,
ThreadTicks thread_timestamp,
char phase,
const unsigned char* category_group_enabled,
const char* name,
const char* scope,
unsigned long long id,
unsigned long long bind_id,
TraceArguments* args,
unsigned int flags)
: … { … }
TraceEvent::~TraceEvent() = default;
TraceEvent::TraceEvent(TraceEvent&& other) noexcept = default;
TraceEvent& TraceEvent::operator=(TraceEvent&& other) noexcept = default;
void TraceEvent::Reset() { … }
void TraceEvent::Reset(PlatformThreadId thread_id,
TimeTicks timestamp,
ThreadTicks thread_timestamp,
char phase,
const unsigned char* category_group_enabled,
const char* name,
const char* scope,
unsigned long long id,
unsigned long long bind_id,
TraceArguments* args,
unsigned int flags) { … }
void TraceEvent::InitArgs(TraceArguments* args) { … }
void TraceEvent::UpdateDuration(const TimeTicks& now,
const ThreadTicks& thread_now) { … }
void TraceEvent::EstimateTraceMemoryOverhead(
TraceEventMemoryOverhead* overhead) { … }
void TraceEvent::AppendAsJSON(
std::string* out,
const ArgumentFilterPredicate& argument_filter_predicate) const { … }
void TraceEvent::AppendPrettyPrinted(std::ostringstream* out) const { … }
}
}