Skip to content

Commit add9de4

Browse files
committed
Allow summarize to be used with data sources other than rustc
1 parent db70f3a commit add9de4

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

summarize/src/analysis.rs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,10 @@ pub fn perform_analysis(data: ProfilingData) -> Results {
179179
data.incremental_load_time -= current_event_duration;
180180
}
181181
_ => {
182-
eprintln!(
183-
"Unexpectedly enountered event `{:?}`, \
184-
while top of stack was `{:?}`. Ignoring.",
185-
current_event, current_top
186-
);
182+
// Data sources other than rustc will use their own event kinds so
183+
// just treat this like a GENERIC_ACTIVITY except that we don't
184+
// track cache misses since those may not apply to all data sources.
185+
data.self_time -= current_event_duration;
187186
}
188187
},
189188
);
@@ -216,11 +215,15 @@ pub fn perform_analysis(data: ProfilingData) -> Results {
216215
});
217216
}
218217

219-
unknown_event_kind => {
220-
eprintln!(
221-
"Ignoring event with unknown event kind `{}`",
222-
unknown_event_kind
223-
);
218+
_ => {
219+
// Data sources other than rustc will use their own event kinds so just
220+
// treat this like a GENERIC_ACTIVITY except that we don't track cache
221+
// misses since those may not apply to all data sources.
222+
record_event_data(&current_event.label, &|data| {
223+
data.self_time += current_event_duration;
224+
data.time += current_event_duration;
225+
data.invocation_count += 1;
226+
});
224227
}
225228
};
226229

0 commit comments

Comments
 (0)