#include "services/tracing/public/cpp/perfetto/track_name_recorder.h"
#include "base/debug/crash_logging.h"
#include "base/no_destructor.h"
#include "base/process/current_process.h"
#include "base/rand_util.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "services/tracing/public/cpp/perfetto/trace_string_lookup.h"
#include "third_party/perfetto/include/perfetto/tracing/internal/track_event_internal.h"
#include "third_party/perfetto/protos/perfetto/trace/track_event/chrome_process_descriptor.gen.h"
#include "third_party/perfetto/protos/perfetto/trace/track_event/chrome_thread_descriptor.gen.h"
#include "third_party/perfetto/protos/perfetto/trace/track_event/process_descriptor.gen.h"
#include "third_party/perfetto/protos/perfetto/trace/track_event/thread_descriptor.gen.h"
#if BUILDFLAG(IS_ANDROID)
#include "base/android/build_info.h"
#endif
namespace tracing {
void SetProcessTrackDescriptor(int64_t process_start_timestamp) { … }
namespace {
void FillThreadTrack(const perfetto::ThreadTrack& track, const char* name) { … }
void SetThreadTrackDescriptors() { … }
}
std::optional<uint64_t> GetTraceCrashId() { … }
TrackNameRecorder::TrackNameRecorder()
: … { … }
TrackNameRecorder::~TrackNameRecorder() = default;
TrackNameRecorder* TrackNameRecorder::GetInstance() { … }
void TrackNameRecorder::OnSetup(const perfetto::DataSourceBase::SetupArgs&) { … }
void TrackNameRecorder::OnStop(const perfetto::DataSourceBase::StopArgs&) { … }
void TrackNameRecorder::OnThreadNameChanged(const char* name) { … }
}