perf tests: add "bindir" prefix to git tree test results

Change the output file names in test-results/ to be "test-results/bindir_<munged dir>" rather than just "test-results/<munged dir>". This is for consistency with the "build_" directories we have for built revisions, i.e. "test-results/build_<SHA-1>". There's no user-visible functional changes here, it just makes it easier to see at a glance what "test-results" files are of what "type" as they're all explicitly grouped together now, and to grep this code to find both the run_dirs_helper() implementation and its corresponding aggregate.perl code. Note that we already guarantee that the rest of the PERF_RESULTS_PREFIX is an absolute path, and since it'll start with e.g. "/" which we munge to "_" we'll up with a readable string like "bindir_home_avar[...]". Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>

Ævar Arnfjörð Bjarmason committed May 7, 2019 at 12:54 UTC fab80ee79ddf59a5d00812005bef0fa3acf5b6bf
2 files changed +4 -2
t/perf/aggregate.perl
+3 -1
@@ -100,6 +100,7 @@ usage() unless $rc;
100 while (scalar @ARGV) {
101 my $arg = $ARGV[0];
102 my $dir;
103 + my $prefix = '';
104 last if -f $arg or $arg eq "--";
105 if (! -d $arg) {
106 my $rev = Git::command_oneline(qw(rev-parse --verify), $arg);
@@ -109,10 +110,11 @@ while (scalar @ARGV) {
110 } else {
111 $dir = realpath($arg);
112 $dirnames{$dir} = $dir;
113 + $prefix .= 'bindir';
114 }
115 push @dirs, $dir;
116 $dirnames{$dir} ||= $arg;
115 - my $prefix = $dir;
117 + $prefix .= $dir;
118 $prefix =~ tr/^a-zA-Z0-9/_/c;
119 $prefixes{$dir} = $prefix . '.';
120 shift @ARGV;
t/perf/run
+1 -1
@@ -102,7 +102,7 @@ run_dirs_helper () {
102 unset GIT_TEST_INSTALLED
103 elif test -d "$mydir"
104 then
105 - PERF_RESULTS_PREFIX=$(cd $mydir && printf "%s" "$(pwd)" | tr -c "[a-zA-Z0-9]" "_").
105 + PERF_RESULTS_PREFIX=bindir$(cd $mydir && printf "%s" "$(pwd)" | tr -c "[a-zA-Z0-9]" "_").
106 set_git_test_installed "$mydir"
107 else
108 rev=$(git rev-parse --verify "$mydir" 2>/dev/null) ||