- fixed a bug that was breaking the --threshold option.
vg_cachesim.c:
- fixed a bug that meant instructions that didn't have a line number in the
debug info were being written in cachegrind.out with whatever was the
last known line number. Now using 0.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@403
my $default_threshold = 99;
+my $single_threshold = $default_threshold;
+
# If on, automatically annotates all files that are involved in getting over
# all the threshold counts.
my $auto_annotate = 0;
# --threshold=X (tolerates a trailing '%')
} elsif ($arg =~ /^--threshold=([\d\.]+)%?$/) {
- $thresholds[0] = $1;
+ $single_threshold = $1;
($1 >= 0 && $1 <= 100) or die($usage);
# --auto=yes|no
push(@sort_order, $events{$sort_event});
}
- # If no --threshold args give, default to 99% for the primary sort event,
- # and 0% for the rest.
+ # If multiple threshold args weren't given via --sort, stick in the single
+ # threshold (either from --threshold if used, or the default otherwise) for
+ # the primary sort event, and 0% for the rest.
if (not @thresholds) {
foreach my $e (@sort_order) {
push(@thresholds, 0);
}
- $thresholds[0] = $default_threshold;
+ $thresholds[0] = $single_threshold;
}
my $curr_file;
no_debug_BBs++;
VG_(strcpy)(filename, "???");
VG_(strcpy)(fn_name, "???");
+ *line_num = 0;
} else if ( found1 && found2) {
full_debug_BBs++;
} else /*(!found1 && found2)*/ {
fn_name_debug_BBs++;
VG_(strcpy)(filename, "???");
+ *line_num = 0;
}
}
my $default_threshold = 99;
+my $single_threshold = $default_threshold;
+
# If on, automatically annotates all files that are involved in getting over
# all the threshold counts.
my $auto_annotate = 0;
# --threshold=X (tolerates a trailing '%')
} elsif ($arg =~ /^--threshold=([\d\.]+)%?$/) {
- $thresholds[0] = $1;
+ $single_threshold = $1;
($1 >= 0 && $1 <= 100) or die($usage);
# --auto=yes|no
push(@sort_order, $events{$sort_event});
}
- # If no --threshold args give, default to 99% for the primary sort event,
- # and 0% for the rest.
+ # If multiple threshold args weren't given via --sort, stick in the single
+ # threshold (either from --threshold if used, or the default otherwise) for
+ # the primary sort event, and 0% for the rest.
if (not @thresholds) {
foreach my $e (@sort_order) {
push(@thresholds, 0);
}
- $thresholds[0] = $default_threshold;
+ $thresholds[0] = $single_threshold;
}
my $curr_file;
no_debug_BBs++;
VG_(strcpy)(filename, "???");
VG_(strcpy)(fn_name, "???");
+ *line_num = 0;
} else if ( found1 && found2) {
full_debug_BBs++;
} else /*(!found1 && found2)*/ {
fn_name_debug_BBs++;
VG_(strcpy)(filename, "???");
+ *line_num = 0;
}
}