Skip to content

Commit 183be58

Browse files
tp: Add support for ART Method v2 streaming trace format (#5236)
tp: Add support for ART Method v2 streaming trace format Introducing the ArtMethodV2Tokenizer to parse the new ART Method Trace v2 format (identified by version 0x0004/0x0005). The v2 format drastically differs from the legacy v1 format by using a fully binary, delta-encoded structure to reduce CPU overhead and file size on Android devices. Bug: 441438736
1 parent 9b86a57 commit 183be58

File tree

12 files changed

+631
-1
lines changed

12 files changed

+631
-1
lines changed

Android.bp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15335,6 +15335,7 @@ filegroup {
1533515335
srcs: [
1533615336
"src/trace_processor/importers/art_method/art_method_parser.cc",
1533715337
"src/trace_processor/importers/art_method/art_method_tokenizer.cc",
15338+
"src/trace_processor/importers/art_method/art_method_v2_tokenizer.cc",
1533815339
],
1533915340
}
1534015341

BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2240,6 +2240,8 @@ perfetto_filegroup(
22402240
"src/trace_processor/importers/art_method/art_method_parser.h",
22412241
"src/trace_processor/importers/art_method/art_method_tokenizer.cc",
22422242
"src/trace_processor/importers/art_method/art_method_tokenizer.h",
2243+
"src/trace_processor/importers/art_method/art_method_v2_tokenizer.cc",
2244+
"src/trace_processor/importers/art_method/art_method_v2_tokenizer.h",
22432245
],
22442246
)
22452247

src/trace_processor/forwarding_trace_parser.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ std::optional<TraceSorter::SortingMode> GetMinimumSortingMode(
6363
case kAndroidLogcatTraceType:
6464
case kArtHprofTraceType:
6565
case kArtMethodTraceType:
66+
case kArtMethodV2TraceType:
6667
case kCollapsedStackTraceType:
6768
case kCtraceTraceType:
6869
case kFuchsiaTraceType:
@@ -157,7 +158,8 @@ base::Status ForwardingTraceParser::Init(const TraceBlobView& blob) {
157158
trace_type_ == kSimpleperfProtoTraceType ||
158159
trace_type_ == kPerfTextTraceType ||
159160
trace_type_ == kPerfDataTraceType ||
160-
trace_type_ == kArtMethodTraceType) {
161+
trace_type_ == kArtMethodTraceType ||
162+
trace_type_ == kArtMethodV2TraceType) {
161163
trace_context_->clock_tracker->SetGlobalClock(
162164
ClockId::Machine(protos::pbzero::BUILTIN_CLOCK_MONOTONIC));
163165
} else if (trace_type_ == kFuchsiaTraceType) {

src/trace_processor/importers/art_method/BUILD.gn

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ source_set("art_method") {
2828
"art_method_parser.h",
2929
"art_method_tokenizer.cc",
3030
"art_method_tokenizer.h",
31+
"art_method_v2_tokenizer.cc",
32+
"art_method_v2_tokenizer.h",
3133
]
3234
deps = [
3335
":art_method_event",

0 commit comments

Comments
 (0)