Skip to content

Commit a7e995a

Browse files
committed
Add logging to parse_events()
1 parent cbdc6e1 commit a7e995a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

collector/src/etw_parser.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ fn parse_events(r: &mut dyn BufRead, headers: Vec<EventHeader>) -> anyhow::Resul
197197
match columns[0].trim() {
198198
PROCESS_START => {
199199
let process_name = columns[pstart_process_name].trim();
200+
log::trace!("saw P-Start for {}", process_name);
200201

201202
match (process_name.contains("rustc.exe"), &rustc_process) {
202203
(true, None) =>{
@@ -239,6 +240,7 @@ fn parse_events(r: &mut dyn BufRead, headers: Vec<EventHeader>) -> anyhow::Resul
239240
// because sometimes C-Switch events come in after the P-End event and we
240241
// don't want to miss them. (If PID reuse occurs for a watched process, we
241242
// detect this in PROCESS_START).
243+
log::trace!("saw P-End for {}", columns[pend_process_name].trim());
242244
}
243245
PMC => {
244246
last_pmc = Some(Pmc {
@@ -251,8 +253,11 @@ fn parse_events(r: &mut dyn BufRead, headers: Vec<EventHeader>) -> anyhow::Resul
251253
CSWITCH => {
252254
let timestamp = columns[cswitch_timestamp].trim().parse()?;
253255
let old_process = columns[cswitch_old_process].trim();
254-
let old_pid = extract_pid(old_process);
255256
let new_process = columns[cswitch_new_process].trim();
257+
258+
log::trace!("saw CSwitch from {} to {}", old_process, new_process);
259+
260+
let old_pid = extract_pid(old_process);
256261
let new_pid = extract_pid(new_process);
257262

258263
if !currently_watched_processes.contains(&old_pid) && !currently_watched_processes.contains(&new_pid) {

0 commit comments

Comments
 (0)