diff options
Diffstat (limited to 'tools/perf/builtin-kvm.c')
-rw-r--r-- | tools/perf/builtin-kvm.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c index 5e2127e04f83..08fa88f62a24 100644 --- a/tools/perf/builtin-kvm.c +++ b/tools/perf/builtin-kvm.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <sys/timerfd.h> | 24 | #include <sys/timerfd.h> |
25 | #endif | 25 | #endif |
26 | 26 | ||
27 | #include <linux/time64.h> | ||
27 | #include <termios.h> | 28 | #include <termios.h> |
28 | #include <semaphore.h> | 29 | #include <semaphore.h> |
29 | #include <pthread.h> | 30 | #include <pthread.h> |
@@ -362,7 +363,7 @@ static bool handle_end_event(struct perf_kvm_stat *kvm, | |||
362 | if (!skip_event(decode)) { | 363 | if (!skip_event(decode)) { |
363 | pr_info("%" PRIu64 " VM %d, vcpu %d: %s event took %" PRIu64 "usec\n", | 364 | pr_info("%" PRIu64 " VM %d, vcpu %d: %s event took %" PRIu64 "usec\n", |
364 | sample->time, sample->pid, vcpu_record->vcpu_id, | 365 | sample->time, sample->pid, vcpu_record->vcpu_id, |
365 | decode, time_diff/1000); | 366 | decode, time_diff / NSEC_PER_USEC); |
366 | } | 367 | } |
367 | } | 368 | } |
368 | 369 | ||
@@ -608,15 +609,15 @@ static void print_result(struct perf_kvm_stat *kvm) | |||
608 | pr_info("%10llu ", (unsigned long long)ecount); | 609 | pr_info("%10llu ", (unsigned long long)ecount); |
609 | pr_info("%8.2f%% ", (double)ecount / kvm->total_count * 100); | 610 | pr_info("%8.2f%% ", (double)ecount / kvm->total_count * 100); |
610 | pr_info("%8.2f%% ", (double)etime / kvm->total_time * 100); | 611 | pr_info("%8.2f%% ", (double)etime / kvm->total_time * 100); |
611 | pr_info("%9.2fus ", (double)min / 1e3); | 612 | pr_info("%9.2fus ", (double)min / NSEC_PER_USEC); |
612 | pr_info("%9.2fus ", (double)max / 1e3); | 613 | pr_info("%9.2fus ", (double)max / NSEC_PER_USEC); |
613 | pr_info("%9.2fus ( +-%7.2f%% )", (double)etime / ecount/1e3, | 614 | pr_info("%9.2fus ( +-%7.2f%% )", (double)etime / ecount / NSEC_PER_USEC, |
614 | kvm_event_rel_stddev(vcpu, event)); | 615 | kvm_event_rel_stddev(vcpu, event)); |
615 | pr_info("\n"); | 616 | pr_info("\n"); |
616 | } | 617 | } |
617 | 618 | ||
618 | pr_info("\nTotal Samples:%" PRIu64 ", Total events handled time:%.2fus.\n\n", | 619 | pr_info("\nTotal Samples:%" PRIu64 ", Total events handled time:%.2fus.\n\n", |
619 | kvm->total_count, kvm->total_time / 1e3); | 620 | kvm->total_count, kvm->total_time / (double)NSEC_PER_USEC); |
620 | 621 | ||
621 | if (kvm->lost_events) | 622 | if (kvm->lost_events) |
622 | pr_info("\nLost events: %" PRIu64 "\n\n", kvm->lost_events); | 623 | pr_info("\nLost events: %" PRIu64 "\n\n", kvm->lost_events); |