Skip to content

Commit

Permalink
Don't add markers for unknown ETW events
Browse files Browse the repository at this point in the history
  • Loading branch information
vvuk committed May 22, 2024
1 parent 6d11f3b commit e373b72
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions samply/src/windows/etw_gecko.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ pub fn profile_pid_from_etl_file(context: &mut ProfileContext, etl_file: &Path)

let mut core_clr_context = coreclr::CoreClrContext::new();

let markers_for_unknown_events = false; // TODO allow specifying this on command line

// Make a dummy TimestampConverter. Once we've parsed the header, this will have correct values.

let result = open_trace(etl_file, |e| {
Expand Down
8 changes: 8 additions & 0 deletions samply/src/windows/profile_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ pub struct ProfileContext {

timestamp_converter: TimestampConverter,
event_timestamps_are_qpc: bool,

// If true, will convert unhandled events to markers
unknown_events_to_markers: bool,
}

impl ProfileContext {
Expand Down Expand Up @@ -297,6 +300,7 @@ impl ProfileContext {
raw_to_ns_factor: 1,
},
event_timestamps_are_qpc: false,
unknown_events_to_markers: false,
}
}

Expand Down Expand Up @@ -1480,6 +1484,10 @@ impl ProfileContext {
task_and_op: &str,
stringified_properties: String,
) {
if !self.unknown_events_to_markers {
return;
}

let Some(thread) = self.threads.get_mut(&tid) else {
return;
};
Expand Down

0 comments on commit e373b72

Please sign in to comment.