aboutsummaryrefslogtreecommitdiff
path: root/src/trace_processor/importers/proto/perf_sample_tracker.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/trace_processor/importers/proto/perf_sample_tracker.h')
-rw-r--r--src/trace_processor/importers/proto/perf_sample_tracker.h47
1 files changed, 9 insertions, 38 deletions
diff --git a/src/trace_processor/importers/proto/perf_sample_tracker.h b/src/trace_processor/importers/proto/perf_sample_tracker.h
index 82f40d03b..81dd73e1f 100644
--- a/src/trace_processor/importers/proto/perf_sample_tracker.h
+++ b/src/trace_processor/importers/proto/perf_sample_tracker.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,56 +19,27 @@
#include <stdint.h>
-#include <unordered_map>
-
#include "src/trace_processor/storage/trace_storage.h"
namespace perfetto {
-namespace protos {
-namespace pbzero {
-class TracePacketDefaults_Decoder;
-} // namespace pbzero
-} // namespace protos
namespace trace_processor {
+
class TraceProcessorContext;
class PerfSampleTracker {
public:
- struct SamplingStreamInfo {
- uint32_t perf_session_id = 0;
- TrackId timebase_track_id = kInvalidTrackId;
-
- SamplingStreamInfo(uint32_t _perf_session_id, TrackId _timebase_track_id)
- : perf_session_id(_perf_session_id),
- timebase_track_id(_timebase_track_id) {}
- };
-
explicit PerfSampleTracker(TraceProcessorContext* context)
: context_(context) {}
- SamplingStreamInfo GetSamplingStreamInfo(
- uint32_t seq_id,
- uint32_t cpu,
- protos::pbzero::TracePacketDefaults_Decoder* nullable_defaults);
+ // Interim UI track for visualizing stack samples as stacks of slices.
+ void AddStackToSliceTrack(int64_t timestamp,
+ CallsiteId leaf_id,
+ uint32_t pid,
+ uint32_t tid,
+ uint32_t cpu);
private:
- struct CpuSequenceState {
- TrackId timebase_track_id = kInvalidTrackId;
-
- CpuSequenceState(TrackId _timebase_track_id)
- : timebase_track_id(_timebase_track_id) {}
- };
-
- struct SequenceState {
- uint32_t perf_session_id = 0;
- std::unordered_map<uint32_t, CpuSequenceState> per_cpu;
-
- SequenceState(uint32_t _perf_session_id)
- : perf_session_id(_perf_session_id) {}
- };
-
- std::unordered_map<uint32_t, SequenceState> seq_state_;
- uint32_t next_perf_session_id_ = 0;
+ StringId MaybeDemangle(StringId original);
TraceProcessorContext* const context_;
};