|
From: <sv...@va...> - 2009-08-11 14:45:11
|
Author: weidendo
Date: 2009-08-11 15:45:03 +0100 (Tue, 11 Aug 2009)
New Revision: 10778
Log:
Fix bug 199338: callgrind_annotate sorting/thresholds are broken
Modified:
trunk/callgrind/callgrind_annotate.in
Modified: trunk/callgrind/callgrind_annotate.in
===================================================================
--- trunk/callgrind/callgrind_annotate.in 2009-08-11 14:45:00 UTC (rev 10777)
+++ trunk/callgrind/callgrind_annotate.in 2009-08-11 14:45:03 UTC (rev 10778)
@@ -243,17 +243,21 @@
# --sort=A,B,C
} elsif ($arg =~ /^--sort=(.*)$/) {
@sort_events = split(/,/, $1);
+ my $th_specified = 0;
foreach my $i (0 .. scalar @sort_events - 1) {
- if ($sort_events[$i] =~#/.*:(\d+)$/) {
- /.*:([\d\.]+)%?$/) {
+ if ($sort_events[$i] =~ /.*:([\d\.]+)%?$/) {
my $th = $1;
($th >= 0 && $th <= 100) or die($usage);
$sort_events[$i] =~ s/:.*//;
$thresholds[$i] = $th;
+ $th_specified = 1;
} else {
$thresholds[$i] = 0;
}
}
+ if (not $th_specified) {
+ @thresholds = ();
+ }
# --threshold=X (tolerates a trailing '%')
} elsif ($arg =~ /^--threshold=([\d\.]+)%?$/) {
|