From a70e9222b8e98a4a7a36978be845fc17eca512e8 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Sun, 9 May 2010 23:46:55 -0500 Subject: [PATCH] --- yaml --- r: 191338 b: refs/heads/master c: e366728d57cb8c708f76b282ae194c6044355b5f h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/tools/perf/scripts/perl/wakeup-latency.pl | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 4227207d72a4..36213335812d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e88a4bfbcda440b1c6b9d5a31a554a6ad9686182 +refs/heads/master: e366728d57cb8c708f76b282ae194c6044355b5f diff --git a/trunk/tools/perf/scripts/perl/wakeup-latency.pl b/trunk/tools/perf/scripts/perl/wakeup-latency.pl index ed58ef284e23..d9143dcec6c6 100644 --- a/trunk/tools/perf/scripts/perl/wakeup-latency.pl +++ b/trunk/tools/perf/scripts/perl/wakeup-latency.pl @@ -22,8 +22,8 @@ my $max_wakeup_latency; my $min_wakeup_latency; -my $total_wakeup_latency; -my $total_wakeups; +my $total_wakeup_latency = 0; +my $total_wakeups = 0; sub sched::sched_switch { @@ -67,8 +67,12 @@ sub trace_end { printf("wakeup_latency stats:\n\n"); print "total_wakeups: $total_wakeups\n"; - printf("avg_wakeup_latency (ns): %u\n", - avg($total_wakeup_latency, $total_wakeups)); + if ($total_wakeups) { + printf("avg_wakeup_latency (ns): %u\n", + avg($total_wakeup_latency, $total_wakeups)); + } else { + printf("avg_wakeup_latency (ns): N/A\n"); + } printf("min_wakeup_latency (ns): %u\n", $min_wakeup_latency); printf("max_wakeup_latency (ns): %u\n", $max_wakeup_latency);