Skip to content

Commit 1a60b9f

Browse files
authored
Add stack samples to ETW events (#5466)
This is the preliminary proto change to allow chromium to start parsing ETW StackWalk events into perfetto. These will be grouped by TID post-facto by the traceprocessor to tie stack sample and track event together.
1 parent b43c2f7 commit 1a60b9f

5 files changed

Lines changed: 24 additions & 0 deletions

File tree

protos/perfetto/config/etw/etw_config.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,6 @@ message EtwConfig {
4343
repeated string memory_provider_events = 3;
4444
// Provides events relating to file I/O.
4545
repeated string file_provider_events = 4;
46+
// Events for which stacks should be collected.
47+
repeated string stack_sampling_events = 5;
4648
}

protos/perfetto/config/perfetto_config.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,6 +1318,8 @@ message EtwConfig {
13181318
repeated string memory_provider_events = 3;
13191319
// Provides events relating to file I/O.
13201320
repeated string file_provider_events = 4;
1321+
// Events for which stacks should be collected.
1322+
repeated string stack_sampling_events = 5;
13211323
}
13221324

13231325
// End of protos/perfetto/config/etw/etw_config.proto

protos/perfetto/trace/etw/etw.proto

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,3 +270,11 @@ message FileIoOpEndEtwEvent {
270270
optional uint64 extra_info = 2;
271271
optional uint32 nt_status = 3;
272272
}
273+
274+
// Proto definition based on the `StackWalk_Event` class definition. See
275+
// `Callstack` in `perfetto/protos/perfetto/trace/track_event/track_event.proto`
276+
// for context on what is contained in it.
277+
message StackWalkEtwEvent {
278+
optional string trigger = 1;
279+
optional uint64 callstack_iid = 2;
280+
}

protos/perfetto/trace/etw/etw_event.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@ message EtwTraceEvent {
3434
FileIoReadWriteEtwEvent file_io_read_write = 10;
3535
FileIoSimpleOpEtwEvent file_io_simple_op = 11;
3636
FileIoOpEndEtwEvent file_io_op_end = 12;
37+
StackWalkEtwEvent stack_walk = 13;
3738
}
3839
}

protos/perfetto/trace/perfetto_trace.proto

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,6 +1318,8 @@ message EtwConfig {
13181318
repeated string memory_provider_events = 3;
13191319
// Provides events relating to file I/O.
13201320
repeated string file_provider_events = 4;
1321+
// Events for which stacks should be collected.
1322+
repeated string stack_sampling_events = 5;
13211323
}
13221324

13231325
// End of protos/perfetto/config/etw/etw_config.proto
@@ -8549,6 +8551,14 @@ message FileIoOpEndEtwEvent {
85498551
optional uint32 nt_status = 3;
85508552
}
85518553

8554+
// Proto definition based on the `StackWalk_Event` class definition. See
8555+
// `Callstack` in `perfetto/protos/perfetto/trace/track_event/track_event.proto`
8556+
// for context on what is contained in it.
8557+
message StackWalkEtwEvent {
8558+
optional string trigger = 1;
8559+
optional uint64 callstack_iid = 2;
8560+
}
8561+
85528562
// End of protos/perfetto/trace/etw/etw.proto
85538563

85548564
// Begin of protos/perfetto/trace/etw/etw_event.proto
@@ -8568,6 +8578,7 @@ message EtwTraceEvent {
85688578
FileIoReadWriteEtwEvent file_io_read_write = 10;
85698579
FileIoSimpleOpEtwEvent file_io_simple_op = 11;
85708580
FileIoOpEndEtwEvent file_io_op_end = 12;
8581+
StackWalkEtwEvent stack_walk = 13;
85718582
}
85728583
}
85738584

0 commit comments

Comments
 (0)