profile: better time breakdown and exclusion of idle cycles

This commit is contained in:
Balazs Gerofi
2017-07-20 17:36:34 +09:00
parent 64c2e437c6
commit 992a292c08
5 changed files with 160 additions and 30 deletions

View File

@ -2966,6 +2966,19 @@ redo:
perf_start(next->proc->monitoring_event);
}
}
#ifdef PROFILE_ENABLE
if (prev->profile && prev->profile_start_ts != 0) {
prev->profile_elapsed_ts +=
(rdtsc() - prev->profile_start_ts);
prev->profile_start_ts = 0;
}
if (next->profile && next->profile_start_ts == 0) {
next->profile_start_ts = rdtsc();
}
#endif
if (prev) {
last = ihk_mc_switch_context(&prev->ctx, &next->ctx, prev);
}