#include "src/trace_processor/importers/ftrace/ftrace_tokenizer.h"
#include "perfetto/base/logging.h"
#include "perfetto/base/status.h"
#include "perfetto/protozero/proto_decoder.h"
#include "perfetto/protozero/proto_utils.h"
#include "perfetto/trace_processor/basic_types.h"
#include "src/trace_processor/importers/common/machine_tracker.h"
#include "src/trace_processor/importers/common/metadata_tracker.h"
#include "src/trace_processor/sorter/trace_sorter.h"
#include "src/trace_processor/storage/metadata.h"
#include "src/trace_processor/storage/stats.h"
#include "src/trace_processor/storage/trace_storage.h"
#include "src/trace_processor/types/variadic.h"
#include "src/trace_processor/util/status_macros.h"
#include "protos/perfetto/common/builtin_clock.pbzero.h"
#include "protos/perfetto/trace/ftrace/ftrace_event.pbzero.h"
#include "protos/perfetto/trace/ftrace/ftrace_event_bundle.pbzero.h"
#include "protos/perfetto/trace/ftrace/power.pbzero.h"
#include "protos/perfetto/trace/ftrace/thermal_exynos.pbzero.h"
namespace perfetto {
namespace trace_processor {
ProtoDecoder;
MakeTagVarInt;
ParseVarInt;
BuiltinClock;
FtraceClock;
FtraceEventBundle;
namespace {
static constexpr uint32_t kFtraceGlobalClockIdForOldKernels = …;
PERFETTO_ALWAYS_INLINE base::StatusOr<int64_t> ResolveTraceTime(
TraceProcessorContext* context,
ClockTracker::ClockId clock_id,
int64_t ts) { … }
uint64_t TryFastParseFtraceEventId(const uint8_t* start, const uint8_t* end) { … }
}
PERFETTO_ALWAYS_INLINE
base::Status FtraceTokenizer::TokenizeFtraceBundle(
TraceBlobView bundle,
RefPtr<PacketSequenceStateGeneration> state,
uint32_t packet_sequence_id) { … }
PERFETTO_ALWAYS_INLINE
void FtraceTokenizer::TokenizeFtraceEvent(
uint32_t cpu,
ClockTracker::ClockId clock_id,
TraceBlobView event,
RefPtr<PacketSequenceStateGeneration> state) { … }
PERFETTO_ALWAYS_INLINE
void FtraceTokenizer::TokenizeFtraceCompactSched(uint32_t cpu,
ClockTracker::ClockId clock_id,
protozero::ConstBytes packet) { … }
void FtraceTokenizer::TokenizeFtraceCompactSchedSwitch(
uint32_t cpu,
ClockTracker::ClockId clock_id,
const FtraceEventBundle::CompactSched::Decoder& compact,
const std::vector<StringId>& string_table) { … }
void FtraceTokenizer::TokenizeFtraceCompactSchedWaking(
uint32_t cpu,
ClockTracker::ClockId clock_id,
const FtraceEventBundle::CompactSched::Decoder& compact,
const std::vector<StringId>& string_table) { … }
void FtraceTokenizer::HandleFtraceClockSnapshot(int64_t ftrace_ts,
int64_t boot_ts,
uint32_t packet_sequence_id) { … }
void FtraceTokenizer::TokenizeFtraceGpuWorkPeriod(
uint32_t cpu,
TraceBlobView event,
RefPtr<PacketSequenceStateGeneration> state) { … }
void FtraceTokenizer::TokenizeFtraceThermalExynosAcpmBulk(
uint32_t cpu,
TraceBlobView event,
RefPtr<PacketSequenceStateGeneration> state) { … }
}
}