Skip to content

Commit

Permalink
Merge changes I0e36ff25,I09b34540,Iddabcfa0,Ibe622451 into main
Browse files Browse the repository at this point in the history
* changes:
  tp: migrate all cpu counter tracks to new track name system
  tp: migrate all cpu tracks to new naming system
  tp: improve track name specification and migrate global tracks to it
  tp: remove dependency of devfreq parsing on name
  • Loading branch information
LalitMaganti authored and Gerrit Code Review committed Oct 21, 2024
2 parents 80acfd9 + 2cf86e4 commit 0ba84ac
Show file tree
Hide file tree
Showing 20 changed files with 372 additions and 259 deletions.
7 changes: 6 additions & 1 deletion src/trace_processor/export_json_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,12 @@ TEST_F(ExportJsonTest, InstantEvent) {

// Global legacy track.
TrackId track = context_.track_tracker->InternGlobalTrack(
TrackClassification::kChromeLegacyGlobalInstant);
TrackClassification::kChromeLegacyGlobalInstant, TrackTracker::AutoName(),
[this](ArgsTracker::BoundInserter& inserter) {
inserter.AddArg(
context_.storage->InternString("source"),
Variadic::String(context_.storage->InternString("chrome")));
});
context_.args_tracker->Flush(); // Flush track args.
StringId cat_id = context_.storage->InternString(base::StringView(kCategory));
StringId name_id = context_.storage->InternString(base::StringView(kName));
Expand Down
16 changes: 7 additions & 9 deletions src/trace_processor/importers/common/async_track_set_tracker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
#include "src/trace_processor/storage/trace_storage.h"
#include "src/trace_processor/types/trace_processor_context.h"

namespace perfetto {
namespace trace_processor {
namespace perfetto::trace_processor {

AsyncTrackSetTracker::AsyncTrackSetTracker(TraceProcessorContext* context)
: android_source_(context->storage->InternString("android")),
Expand Down Expand Up @@ -187,10 +186,9 @@ TrackId AsyncTrackSetTracker::CreateTrackForSet(const TrackSet& set) {
TrackTracker::DimensionsBuilder builder =
context_->track_tracker->CreateDimensionsBuilder();
builder.AppendName(set.global_track_name);

return context_->track_tracker->CreateTrack(TrackClassification::kAsync,
std::move(builder).Build(),
set.global_track_name);
return context_->track_tracker->CreateTrack(
TrackClassification::kUnknown, std::move(builder).Build(),
TrackTracker::LegacyStringIdName{set.global_track_name});
}
case TrackSetScope::kProcess:
// TODO(lalitm): propogate source from callers rather than just passing
Expand All @@ -210,7 +208,8 @@ TrackId AsyncTrackSetTracker::CreateTrackForSet(const TrackSet& set) {
TrackTracker::Dimensions dims_id = std::move(dims_builder).Build();

TrackId id = context_->track_tracker->CreateProcessTrack(
TrackClassification::kAsync, set.process_tuple.upid, dims_id, name);
TrackClassification::kUnknown, set.process_tuple.upid, dims_id,
TrackTracker::LegacyStringIdName{name});

if (!source.is_null()) {
context_->args_tracker->AddArgsTo(id).AddArg(source,
Expand All @@ -222,5 +221,4 @@ TrackId AsyncTrackSetTracker::CreateTrackForSet(const TrackSet& set) {
PERFETTO_FATAL("For GCC");
}

} // namespace trace_processor
} // namespace perfetto
} // namespace perfetto::trace_processor
9 changes: 0 additions & 9 deletions src/trace_processor/importers/common/track_classification.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ enum class TrackClassification : size_t {
// General tracks.
kThread,
kChromeProcessInstant,
kAsync,
kTrackEvent,

// Gpu tracks.
Expand All @@ -49,8 +48,6 @@ enum class TrackClassification : size_t {
kSoftirqCpu,
kNapiGroCpu,
kMaliIrqCpu,
kMinFreqCpu,
kMaxFreqCpu,
kFuncgraphCpu,
kPkvmHypervisor,

Expand Down Expand Up @@ -118,8 +115,6 @@ static inline const char* TrackClassificationToString(
return "linux_rpm";
case TrackClassification::kLinuxDeviceFrequency:
return "linux_device_frequency";
case TrackClassification::kAsync:
return "async";
case TrackClassification::kTrackEvent:
return "track_event";
case TrackClassification::kIrqCounter:
Expand All @@ -144,10 +139,6 @@ static inline const char* TrackClassificationToString(
return "cpu_softirq_time";
case TrackClassification::kPkvmHypervisor:
return "pkvm_hypervisor";
case TrackClassification::kMaxFreqCpu:
return "cpu_max_frequency";
case TrackClassification::kMinFreqCpu:
return "cpu_min_frequency";
case TrackClassification::kCpuFrequency:
return "cpu_frequency";
case TrackClassification::kCpuFrequencyThrottle:
Expand Down
Loading

0 comments on commit 0ba84ac

Please sign in to comment.