]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix bug 199338: callgrind_annotate sorting/thresholds are broken
authorJosef Weidendorfer <Josef.Weidendorfer@gmx.de>
Tue, 11 Aug 2009 14:45:03 +0000 (14:45 +0000)
committerJosef Weidendorfer <Josef.Weidendorfer@gmx.de>
Tue, 11 Aug 2009 14:45:03 +0000 (14:45 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10778

callgrind/callgrind_annotate.in

index 0a8c301285099b61f61f6f64e9a09c8e4bd38761..afa9e04bff4e7401886a0bfef532afe1e9474d17 100644 (file)
@@ -243,17 +243,21 @@ sub process_cmd_line()
             # --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\.]+)%?$/) {