#include "src/trace_processor/importers/proto/track_event_tracker.h"
#include <algorithm>
#include <cinttypes>
#include <cstddef>
#include <cstdint>
#include <map>
#include <memory>
#include <optional>
#include <tuple>
#include <utility>
#include <vector>
#include "perfetto/base/logging.h"
#include "src/trace_processor/importers/common/args_tracker.h"
#include "src/trace_processor/importers/common/process_track_translation_table.h"
#include "src/trace_processor/importers/common/process_tracker.h"
#include "src/trace_processor/importers/common/track_tracker.h"
#include "src/trace_processor/storage/stats.h"
#include "src/trace_processor/storage/trace_storage.h"
#include "src/trace_processor/tables/track_tables_py.h"
#include "src/trace_processor/types/trace_processor_context.h"
#include "src/trace_processor/types/variadic.h"
namespace perfetto::trace_processor {
TrackEventTracker::TrackEventTracker(TraceProcessorContext* context)
: … { … }
void TrackEventTracker::ReserveDescriptorProcessTrack(uint64_t uuid,
StringId name,
uint32_t pid,
int64_t timestamp) { … }
void TrackEventTracker::ReserveDescriptorThreadTrack(uint64_t uuid,
uint64_t parent_uuid,
StringId name,
uint32_t pid,
uint32_t tid,
int64_t timestamp,
bool use_separate_track) { … }
void TrackEventTracker::ReserveDescriptorCounterTrack(
uint64_t uuid,
uint64_t parent_uuid,
StringId name,
StringId category,
int64_t unit_multiplier,
bool is_incremental,
uint32_t packet_sequence_id) { … }
void TrackEventTracker::ReserveDescriptorChildTrack(uint64_t uuid,
uint64_t parent_uuid,
StringId name) { … }
TrackId TrackEventTracker::InsertThreadTrack(UniqueTid utid) { … }
TrackId TrackEventTracker::InternThreadTrack(UniqueTid utid) { … }
std::optional<TrackId> TrackEventTracker::GetDescriptorTrack(
uint64_t uuid,
StringId event_name,
std::optional<uint32_t> packet_sequence_id) { … }
std::optional<TrackId> TrackEventTracker::GetDescriptorTrackImpl(
uint64_t uuid,
std::optional<uint32_t> packet_sequence_id) { … }
TrackId TrackEventTracker::CreateTrackFromResolved(
const ResolvedDescriptorTrack& track) { … }
std::optional<TrackEventTracker::ResolvedDescriptorTrack>
TrackEventTracker::ResolveDescriptorTrack(
uint64_t uuid,
std::vector<uint64_t>* descendent_uuids) { … }
std::optional<TrackEventTracker::ResolvedDescriptorTrack>
TrackEventTracker::ResolveDescriptorTrackImpl(
uint64_t uuid,
const DescriptorTrackReservation& reservation,
std::vector<uint64_t>* descendent_uuids) { … }
TrackId TrackEventTracker::GetOrCreateDefaultDescriptorTrack() { … }
std::optional<double> TrackEventTracker::ConvertToAbsoluteCounterValue(
uint64_t counter_track_uuid,
uint32_t packet_sequence_id,
double value) { … }
void TrackEventTracker::OnIncrementalStateCleared(uint32_t packet_sequence_id) { … }
void TrackEventTracker::OnFirstPacketOnSequence(uint32_t packet_sequence_id) { … }
TrackEventTracker::ResolvedDescriptorTrack
TrackEventTracker::ResolvedDescriptorTrack::Process(UniquePid upid,
bool is_counter,
bool is_root) { … }
TrackEventTracker::ResolvedDescriptorTrack
TrackEventTracker::ResolvedDescriptorTrack::Thread(UniqueTid utid,
bool is_counter,
bool is_root,
bool use_separate_track) { … }
TrackEventTracker::ResolvedDescriptorTrack
TrackEventTracker::ResolvedDescriptorTrack::Global(bool is_counter,
bool is_root) { … }
}