Discussion:
[Valgrind-developers] Valgrind: r16461 - in /trunk: NEWS perf/vg_perf.in
s***@valgrind.org
2017-07-22 05:10:16 UTC
Permalink
Author: iraisr
Date: Sat Jul 22 06:10:05 2017
New Revision: 16461

Log:
New command line option "--terse" for vg_perf.
Fixes BZ#382407.

Produces the following terse output:

-- bigcode1 --
vanilla : no: ----- me: ----- ca: ----- he: ----- ca: ----- dr: ----- ma: -----
ra3-005 : no: 0.0% me: -4.7% ca: 0.2% he: -1.1% ca: -1.5% dr: -0.6% ma: 0.0%
ra3-005-J : no: 0.0% me: 0.4% ca: 0.3% he: -0.5% ca: -0.9% dr: 0.0% ma: 0.6%
ra3-006 : no: 0.0% me: 0.4% ca: 0.2% he: -0.0% ca: -1.2% dr: 0.0% ma: 0.0%
ra3-007 : no: 0.0% me: 0.7% ca: 0.5% he: -0.5% ca: -0.6% dr: 0.0% ma: 1.2%

instead the full output (when the option is not used):
-- bigcode1 --
bigcode1 vanilla:0.09s no: 1.6s (18.0x, -----) me: 3.1s (35.0x, -----) ca:12.7s (140.8x, -----) he: 2.0s (22.8x, -----) ca: 3.7s (41.2x, -----) dr: 2.0s (22.2x, -----) ma: 1.9s (20.7x, -----)
bigcode1 ra3-005:0.09s no: 1.6s (17.8x, 1.2%) me: 3.0s (33.3x, 4.8%) ca:12.7s (140.7x, 0.1%) he: 2.0s (22.2x, 2.4%) ca: 3.6s (40.2x, 2.4%) dr: 1.9s (21.7x, 2.5%) ma: 1.9s (20.7x, 0.0%)


Modified:
trunk/NEWS
trunk/perf/vg_perf.in

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Sat Jul 22 06:10:05 2017
@@ -43,6 +43,7 @@
381769 Use ucontext_t instead of struct ucontext
381805 arm32 needs ld.so index hardwire for new glibc security fixes
382256 gz compiler flag test doesn't work for gold
+382407 vg_perf needs "--terse" command line option


Release 3.13.0 (15 June 2017)

Modified: trunk/perf/vg_perf.in
==============================================================================
--- trunk/perf/vg_perf.in (original)
+++ trunk/perf/vg_perf.in Sat Jul 22 06:10:05 2017
@@ -67,6 +67,8 @@
[Valgrind in the current directory, i.e. --vg=.]
Can be specified multiple times.
The "in-place" build is used.
+ --terse: terse output. Prints only program name and speedup's for specified
+ tools.

--outer-valgrind: run these Valgrind(s) under the given outer valgrind.
These Valgrind(s) must be configured with --enable-inner.
@@ -92,6 +94,7 @@
my $n_reps = 1; # Run each test $n_reps times and choose the best one.
my @vgdirs; # Dirs of the various Valgrinds being measured.
my @tools = ("none", "memcheck"); # tools being measured
+my $terse = 0; # Terse output.

# Outer valgrind to use, and args to use for it.
# If this is set, --valgrind should be set to the installed inner valgrind,
@@ -158,6 +161,8 @@
add_vgdir($1);
} elsif ($arg =~ /^--tools=(.+)$/) {
@tools = split(/,/, $1);
+ } elsif ($arg =~ /^--terse$/) {
+ $terse = 1;
} elsif ($arg =~ /^--outer-valgrind=(.*)$/) {
$outer_valgrind = $1;
} elsif ($arg =~ /^--outer-tool=(.*)$/) {
@@ -307,15 +312,19 @@

foreach my $vgdir (@vgdirs) {
# Benchmark name
- printf("%-8s ", $name);
+ if (!$terse) {
+ printf("%-8s ", $name);
+ }

# Print the Valgrind version if we are measuring more than one.
my $vgdirname = $vgdir;
chomp($vgdirname = `basename $vgdir`);
printf("%-10s:", $vgdirname);
-
+
# Native execution time
- printf("%4.2fs", $tNative);
+ if (!$terse) {
+ printf("%4.2fs", $tNative);
+ }

foreach my $tool (@tools) {
# First two chars of toolname for abbreviation
@@ -371,7 +380,9 @@
}
my $cmd = "$vgsetup $timecmd $vgcmd $prog $args";
my $tTool = time_prog($cmd, $n_reps);
- printf("%4.1fs (%4.1fx,", $tTool, $tTool/$tNative);
+ if (!$terse) {
+ printf("%4.1fs (%4.1fx,", $tTool, $tTool/$tNative);
+ }

# If it's the first timing for this tool on this benchmark,
# record the time so we can get the percentage speedup of the
@@ -379,10 +390,13 @@
# the speedup.
if (not defined $first_tTool{$tool}) {
$first_tTool{$tool} = $tTool;
- print(" -----)");
+ print(" -----");
} else {
my $speedup = 100 - (100 * $tTool / $first_tTool{$tool});
- printf("%5.1f%%)", $speedup);
+ printf("%5.1f%%", $speedup);
+ }
+ if (!$terse) {
+ print(")");
}

$num_timings_done++;

Loading...