#include "perfetto/ext/base/metatrace.h"
#include "perfetto/base/compiler.h"
#include "perfetto/base/task_runner.h"
#include "perfetto/base/time.h"
#include "perfetto/ext/base/file_utils.h"
#include "perfetto/ext/base/thread_annotations.h"
namespace perfetto {
namespace metatrace {
std::atomic<uint32_t> g_enabled_tags{ … };
std::atomic<uint64_t> g_enabled_timestamp{ … };
std::array<Record, RingBuffer::kCapacity> RingBuffer::records_;
std::atomic<bool> RingBuffer::read_task_queued_;
std::atomic<uint64_t> RingBuffer::wr_index_;
std::atomic<uint64_t> RingBuffer::rd_index_;
std::atomic<bool> RingBuffer::has_overruns_;
Record RingBuffer::bankruptcy_record_;
namespace {
struct Delegate { … };
}
bool Enable(std::function<void()> read_task,
base::TaskRunner* task_runner,
uint32_t tags) { … }
void Disable() { … }
void RingBuffer::Reset() { … }
Record* RingBuffer::AppendNewRecord() { … }
bool RingBuffer::IsOnValidTaskRunner() { … }
}
}