Skip to content

Commit

Permalink
Merge "tp: simplify track classification" into main
Browse files Browse the repository at this point in the history
  • Loading branch information
LalitMaganti authored and Gerrit Code Review committed Oct 21, 2024
2 parents 0b144a5 + 109ab3e commit 7a7ed30
Show file tree
Hide file tree
Showing 24 changed files with 307 additions and 414 deletions.
2 changes: 1 addition & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -1628,9 +1628,9 @@ perfetto_filegroup(
"src/trace_processor/importers/common/trace_file_tracker.cc",
"src/trace_processor/importers/common/trace_file_tracker.h",
"src/trace_processor/importers/common/trace_parser.cc",
"src/trace_processor/importers/common/track_classification.h",
"src/trace_processor/importers/common/track_tracker.cc",
"src/trace_processor/importers/common/track_tracker.h",
"src/trace_processor/importers/common/tracks.h",
"src/trace_processor/importers/common/virtual_memory_mapping.cc",
"src/trace_processor/importers/common/virtual_memory_mapping.h",
],
Expand Down
16 changes: 8 additions & 8 deletions src/trace_processor/export_json_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
#include "src/trace_processor/importers/common/metadata_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_classification.h"
#include "src/trace_processor/importers/common/track_tracker.h"
#include "src/trace_processor/importers/common/tracks.h"
#include "src/trace_processor/importers/proto/track_event_tracker.h"
#include "src/trace_processor/storage/metadata.h"
#include "src/trace_processor/storage/stats.h"
Expand Down Expand Up @@ -252,8 +252,8 @@ TEST_F(ExportJsonTest, StorageWithThreadName) {
}

TEST_F(ExportJsonTest, SystemEventsIgnored) {
TrackId track = context_.track_tracker->InternProcessTrack(
TrackClassification::kUnknown, 0);
TrackId track =
context_.track_tracker->InternProcessTrack(tracks::unknown, 0);
context_.args_tracker->Flush(); // Flush track args.

// System events have no category.
Expand Down Expand Up @@ -770,7 +770,7 @@ TEST_F(ExportJsonTest, InstantEvent) {

// Global legacy track.
TrackId track = context_.track_tracker->InternGlobalTrack(
TrackClassification::kChromeLegacyGlobalInstant, TrackTracker::AutoName(),
tracks::legacy_chrome_global_instants, TrackTracker::AutoName(),
[this](ArgsTracker::BoundInserter& inserter) {
inserter.AddArg(
context_.storage->InternString("source"),
Expand Down Expand Up @@ -1814,8 +1814,8 @@ TEST_F(ExportJsonTest, MemorySnapshotOsDumpEvent) {
const char* kModuleDebugPath = "debugpath";

UniquePid upid = context_.process_tracker->GetOrCreateProcess(kProcessID);
TrackId track = context_.track_tracker->InternProcessTrack(
TrackClassification::kTrackEvent, upid);
TrackId track =
context_.track_tracker->InternProcessTrack(tracks::track_event, upid);
StringId level_of_detail_id =
context_.storage->InternString(base::StringView(kLevelOfDetail));
auto snapshot_id = context_.storage->mutable_memory_snapshot_table()
Expand Down Expand Up @@ -1936,8 +1936,8 @@ TEST_F(ExportJsonTest, MemorySnapshotChromeDumpEvent) {

UniquePid os_upid =
context_.process_tracker->GetOrCreateProcess(kOsProcessID);
TrackId track = context_.track_tracker->InternProcessTrack(
TrackClassification::kTrackEvent, os_upid);
TrackId track =
context_.track_tracker->InternProcessTrack(tracks::track_event, os_upid);
StringId level_of_detail_id =
context_.storage->InternString(base::StringView(kLevelOfDetail));
auto snapshot_id = context_.storage->mutable_memory_snapshot_table()
Expand Down
2 changes: 1 addition & 1 deletion src/trace_processor/importers/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ source_set("common") {
"trace_file_tracker.cc",
"trace_file_tracker.h",
"trace_parser.cc",
"track_classification.h",
"track_tracker.cc",
"track_tracker.h",
"tracks.h",
"virtual_memory_mapping.cc",
"virtual_memory_mapping.h",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ TrackId AsyncTrackSetTracker::CreateTrackForSet(const TrackSet& set) {
context_->track_tracker->CreateDimensionsBuilder();
builder.AppendName(set.global_track_name);
return context_->track_tracker->CreateTrack(
TrackClassification::kUnknown, std::move(builder).Build(),
tracks::unknown, std::move(builder).Build(),
TrackTracker::LegacyStringIdName{set.global_track_name});
}
case TrackSetScope::kProcess:
Expand All @@ -208,7 +208,7 @@ TrackId AsyncTrackSetTracker::CreateTrackForSet(const TrackSet& set) {
TrackTracker::Dimensions dims_id = std::move(dims_builder).Build();

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

if (!source.is_null()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ TEST_F(EventTrackerTest, CounterDuration) {
uint32_t cpu = 3;
int64_t timestamp = 100;

TrackId track = context.track_tracker->InternCpuCounterTrack(
TrackClassification::kCpuFrequency, cpu);
TrackId track =
context.track_tracker->InternCpuCounterTrack(tracks::cpu_frequency, cpu);
context.event_tracker->PushCounter(timestamp, 1000, track);
context.event_tracker->PushCounter(timestamp + 1, 4000, track);
context.event_tracker->PushCounter(timestamp + 3, 5000, track);
Expand Down
186 changes: 0 additions & 186 deletions src/trace_processor/importers/common/track_classification.h

This file was deleted.

Loading

0 comments on commit 7a7ed30

Please sign in to comment.