From 61db4564e4d17c5cceadf02a50712544299daa3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Mon, 15 Jan 2024 15:29:10 +0100 Subject: [PATCH 01/13] allow to pass unespaced arg to bench cmd --- benchmark/shared.php | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/benchmark/shared.php b/benchmark/shared.php index 450101770b28b..6a6e6d2f62a62 100644 --- a/benchmark/shared.php +++ b/benchmark/shared.php @@ -1,14 +1,25 @@ arg + : escapeshellarg($v); + }, $args)); $pipes = null; - $result = new ProcessResult(); $descriptorSpec = [0 => ['pipe', 'r'], 1 => ['pipe', 'w'], 2 => ['pipe', 'w']]; fwrite(STDOUT, "> $cmd\n"); $processHandle = proc_open($cmd, $descriptorSpec, $pipes, $cwd ?? getcwd(), null); @@ -22,6 +33,8 @@ function runCommand(array $args, ?string $cwd = null): ProcessResult { stream_set_blocking($stdout, false); stream_set_blocking($stderr, false); + $stdoutStr = ''; + $stderrStr = ''; $stdoutEof = false; $stderrEof = false; @@ -35,9 +48,9 @@ function runCommand(array $args, ?string $cwd = null): ProcessResult { foreach ($read as $stream) { $chunk = fgets($stream); if ($stream === $stdout) { - $result->stdout .= $chunk; + $stdoutStr .= $chunk; } elseif ($stream === $stderr) { - $result->stderr .= $chunk; + $stderrStr .= $chunk; } } @@ -47,6 +60,8 @@ function runCommand(array $args, ?string $cwd = null): ProcessResult { fclose($stdout); fclose($stderr); + + $result = new ProcessResult($stdoutStr, $stderrStr); $statusCode = proc_close($processHandle); if ($statusCode !== 0) { From 6a47d3b6d632a71b4604cfd51473a8be32fba24d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Mon, 15 Jan 2024 15:31:33 +0100 Subject: [PATCH 02/13] allow to parse more than one/Ir callgrind metric --- benchmark/benchmark.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/benchmark/benchmark.php b/benchmark/benchmark.php index ec39e9f3310e5..6c54baf217dc0 100644 --- a/benchmark/benchmark.php +++ b/benchmark/benchmark.php @@ -123,16 +123,23 @@ function runValgrindPhpCgiCommand( '-d opcache.validate_timestamps=0', ...$args, ]); - $instructions = extractInstructionsFromValgrindOutput($process->stderr); + $valgrindMetrics = extractMetricsFromValgrindOutput($process->stderr); + $instructions = $valgrindMetrics['Ir']; if ($repeat > 1) { $instructions = gmp_strval(gmp_div_q($instructions, $repeat)); } return ['instructions' => $instructions]; } -function extractInstructionsFromValgrindOutput(string $output): string { - preg_match("(==[0-9]+== Events : Ir\n==[0-9]+== Collected : (?[0-9]+))", $output, $matches); - return $matches['instructions'] ?? throw new \Exception('Unexpected valgrind output'); +/** + * @return array + */ +function extractMetricsFromValgrindOutput(string $output): array { + if (!preg_match('/==\d+== Events *:((?: +\w+)+)\n==\d+== Collected :((?: +\d+)+)\n/', $output, $matches)) { + throw new \Exception('Unexpected valgrind output: ' . $output); + } + + return array_combine(explode(' ', ltrim($matches[1], ' ')), explode(' ', ltrim($matches[2], ' '))); } main(); From 48c105794531e496064c72bea9f21b7436db10f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Tue, 16 Jan 2024 18:38:59 +0100 Subject: [PATCH 03/13] measure startup, each bench run and shutdown separately --- benchmark/benchmark.php | 71 +++++++++++++++++++++++++++++++++-------- sapi/cgi/cgi_main.c | 31 ++++++++---------- 2 files changed, 70 insertions(+), 32 deletions(-) diff --git a/benchmark/benchmark.php b/benchmark/benchmark.php index 6c54baf217dc0..1a4c000c2f577 100644 --- a/benchmark/benchmark.php +++ b/benchmark/benchmark.php @@ -63,7 +63,8 @@ function runSymfonyDemo(bool $jit): array { cloneRepo($dir, 'https://github.com/php/benchmarking-symfony-demo-2.2.3.git'); runPhpCommand([$dir . '/bin/console', 'cache:clear']); runPhpCommand([$dir . '/bin/console', 'cache:warmup']); - return runValgrindPhpCgiCommand('symfony-demo', [$dir . '/public/index.php'], cwd: $dir, jit: $jit, warmup: 50, repeat: 50); + + return runValgrindPhpCgiCommand('symfony-demo', [$dir . '/public/index.php'], cwd: $dir, jit: $jit, repeat: 100); } function runWordpress(bool $jit): array { @@ -86,7 +87,8 @@ function runWordpress(bool $jit): array { // Warmup runPhpCommand([$dir . '/index.php'], $dir); - return runValgrindPhpCgiCommand('wordpress', [$dir . '/index.php'], cwd: $dir, jit: $jit, warmup: 50, repeat: 50); + + return runValgrindPhpCgiCommand('wordpress', [$dir . '/index.php'], cwd: $dir, jit: $jit, repeat: 100); } function runPhpCommand(array $args, ?string $cwd = null): ProcessResult { @@ -98,24 +100,25 @@ function runValgrindPhpCgiCommand( array $args, ?string $cwd = null, bool $jit = false, - int $warmup = 0, int $repeat = 1, ): array { global $phpCgi; - $profileOut = __DIR__ . "/profiles/callgrind.out.$name"; + $profileOut = __DIR__ . "/profiles/callgrind.$name"; if ($jit) { - $profileOut .= '.jit'; + $profileOut .= '-jit'; } $process = runCommand([ 'valgrind', '--tool=callgrind', '--dump-instr=yes', + '--collect-jumps=yes', "--callgrind-out-file=$profileOut", + '--verbose', '--', $phpCgi, - '-T' . ($warmup ? $warmup . ',' : '') . $repeat, + '-T' . $repeat, '-d max_execution_time=0', '-d opcache.enable=1', '-d opcache.jit=' . ($jit ? 'tracing' : 'disable'), @@ -123,20 +126,60 @@ function runValgrindPhpCgiCommand( '-d opcache.validate_timestamps=0', ...$args, ]); - $valgrindMetrics = extractMetricsFromValgrindOutput($process->stderr); - $instructions = $valgrindMetrics['Ir']; - if ($repeat > 1) { - $instructions = gmp_strval(gmp_div_q($instructions, $repeat)); + + // collect metrics for startup, each benchmark run and shutdown + $metricsArr = []; + foreach (['startup' => 1, ...range(2, $repeat + 1), 'shutdown' => ''] as $k => $kCallgrindOut) { + $profileOutSpecific = $profileOut . '.' . $k; + rename($profileOut . ($kCallgrindOut === '' ? '' : '.' . $kCallgrindOut), $profileOutSpecific); + + $metricsArr[$k] = extractMetricsFromCallgrindFile($profileOutSpecific); + } + + // print all collected metrics + print_r($metricsArr); + + // find the fastest benchmark run + $bestRunIndex = 0; + foreach (range(0, $repeat - 1) as $k) { + if ($metricsArr[$k]['Ir'] < $metricsArr[$bestRunIndex]['Ir']) { + $bestRunIndex = $k; + } } - return ['instructions' => $instructions]; + + // remove non-fastest profiles from artifacts + foreach (range(0, $repeat - 1) as $k) { + $profileOutSpecific = $profileOut . '.' . $k; + + if ($k !== $bestRunIndex) { + unlink($profileOutSpecific); + } + } + + // annotate profiles for artifacts + foreach (['startup', $bestRunIndex, 'shutdown'] as $k) { + $profileOutSpecific = $profileOut . '.' . $k; + + runCommand([ + 'callgrind_annotate', + '--threshold=100', + '--auto=yes', + '--show-percs=no', + $profileOutSpecific, + new UnescapedArg('>'), + "$profileOutSpecific.txt", + ]); + } + + return ['instructions' => $metricsArr[$bestRunIndex]['Ir']]; } /** * @return array */ -function extractMetricsFromValgrindOutput(string $output): array { - if (!preg_match('/==\d+== Events *:((?: +\w+)+)\n==\d+== Collected :((?: +\d+)+)\n/', $output, $matches)) { - throw new \Exception('Unexpected valgrind output: ' . $output); +function extractMetricsFromCallgrindFile(string $path): array { + if (!preg_match('/\nevents:((?: +\w+)+)\nsummary:((?: +\d+)+)\n/', file_get_contents($path, length: 10_000), $matches)) { + throw new \Exception('Unexpected callgrind data'); } return array_combine(explode(' ', ltrim($matches[1], ' ')), explode(' ', ltrim($matches[2], ' '))); diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 9d7e66ce2b5bc..586b5b97eff5f 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -2216,13 +2216,6 @@ consult the installation file that came with this distribution, or visit \n\ if (comma) { warmup_repeats = atoi(php_optarg); repeats = atoi(comma + 1); -#ifdef HAVE_VALGRIND - if (warmup_repeats > 0) { - CALLGRIND_STOP_INSTRUMENTATION; - /* We're not interested in measuring startup */ - CALLGRIND_ZERO_STATS; - } -#endif } else { repeats = atoi(php_optarg); } @@ -2264,6 +2257,13 @@ consult the installation file that came with this distribution, or visit \n\ } #endif while (!fastcgi || fcgi_accept_request(request) >= 0) { +#ifdef HAVE_VALGRIND + if (benchmark) { + /* measure startup and each benchmark run separately */ + CALLGRIND_DUMP_STATS; + } +#endif + SG(server_context) = fastcgi ? (void *)request : (void *) 1; init_request_info(request); @@ -2430,12 +2430,6 @@ consult the installation file that came with this distribution, or visit \n\ } } /* end !cgi && !fastcgi */ -#ifdef HAVE_VALGRIND - if (warmup_repeats == 0) { - CALLGRIND_START_INSTRUMENTATION; - } -#endif - /* request startup only after we've done all we can to * get path_translated */ if (php_request_startup() == FAILURE) { @@ -2554,11 +2548,6 @@ consult the installation file that came with this distribution, or visit \n\ SG(request_info).query_string = NULL; } -#ifdef HAVE_VALGRIND - /* We're not interested in measuring shutdown */ - CALLGRIND_STOP_INSTRUMENTATION; -#endif - if (!fastcgi) { if (benchmark) { if (warmup_repeats) { @@ -2586,6 +2575,12 @@ consult the installation file that came with this distribution, or visit \n\ script_file = NULL; goto do_repeat; } + +#ifdef HAVE_VALGRIND + /* measure shutdown separately */ + CALLGRIND_DUMP_STATS; +#endif + break; } From 66c27d703d01d6b21ed6080a376b2b5f82fbd383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Tue, 16 Jan 2024 19:18:08 +0100 Subject: [PATCH 04/13] make metrics dump more human readable --- benchmark/benchmark.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/benchmark.php b/benchmark/benchmark.php index 1a4c000c2f577..295921aa682c2 100644 --- a/benchmark/benchmark.php +++ b/benchmark/benchmark.php @@ -137,7 +137,7 @@ function runValgrindPhpCgiCommand( } // print all collected metrics - print_r($metricsArr); + print_r(array_map(fn ($metrics) => array_map(fn ($v) => number_format($v, 0, '.', '_'), $metrics), $metricsArr)); // find the fastest benchmark run $bestRunIndex = 0; From 5ac681250cfdc47f645900375d2cfbdcfd47203a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Tue, 16 Jan 2024 19:18:14 +0100 Subject: [PATCH 05/13] collect cache/branch misses --- benchmark/benchmark.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/benchmark/benchmark.php b/benchmark/benchmark.php index 295921aa682c2..7010ac8ade001 100644 --- a/benchmark/benchmark.php +++ b/benchmark/benchmark.php @@ -114,6 +114,8 @@ function runValgrindPhpCgiCommand( '--tool=callgrind', '--dump-instr=yes', '--collect-jumps=yes', + '--cache-sim=yes', + '--branch-sim=yes', "--callgrind-out-file=$profileOut", '--verbose', '--', From 74ae907b33f67db5f941ee765374d619920a8437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Fri, 19 Jan 2024 15:13:23 +0100 Subject: [PATCH 06/13] gmp ext is no longer needed for benchmarking --- .github/workflows/push.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index b914a2fa1b4d4..9671e633c6be6 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -231,7 +231,6 @@ jobs: sudo apt-get update sudo apt-get install \ bison \ - libgmp-dev \ libonig-dev \ libsqlite3-dev \ openssl \ @@ -255,7 +254,6 @@ jobs: --enable-werror \ --prefix=/usr \ --with-config-file-scan-dir=/etc/php.d \ - --with-gmp \ --with-mysqli=mysqlnd \ --with-openssl \ --with-pdo-sqlite \ From c92fa3ccfc835962db71d291917fa884a5741b65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Mon, 22 Jan 2024 11:24:18 +0100 Subject: [PATCH 07/13] Revert "collect cache/branch misses" --- benchmark/benchmark.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/benchmark/benchmark.php b/benchmark/benchmark.php index 7010ac8ade001..295921aa682c2 100644 --- a/benchmark/benchmark.php +++ b/benchmark/benchmark.php @@ -114,8 +114,6 @@ function runValgrindPhpCgiCommand( '--tool=callgrind', '--dump-instr=yes', '--collect-jumps=yes', - '--cache-sim=yes', - '--branch-sim=yes', "--callgrind-out-file=$profileOut", '--verbose', '--', From 3a718b3c0a34aa255aaadce7c1c063d232832068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Mon, 22 Jan 2024 11:40:15 +0100 Subject: [PATCH 08/13] use Ir median as main metrics --- benchmark/benchmark.php | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/benchmark/benchmark.php b/benchmark/benchmark.php index 295921aa682c2..5e388ca52ee4c 100644 --- a/benchmark/benchmark.php +++ b/benchmark/benchmark.php @@ -139,25 +139,24 @@ function runValgrindPhpCgiCommand( // print all collected metrics print_r(array_map(fn ($metrics) => array_map(fn ($v) => number_format($v, 0, '.', '_'), $metrics), $metricsArr)); - // find the fastest benchmark run - $bestRunIndex = 0; - foreach (range(0, $repeat - 1) as $k) { - if ($metricsArr[$k]['Ir'] < $metricsArr[$bestRunIndex]['Ir']) { - $bestRunIndex = $k; - } - } - - // remove non-fastest profiles from artifacts + // find median benchmark run + $metricsForMedianArr = $metricsArr; + unset($metricsForMedianArr['startup']); + unset($metricsForMedianArr['shutdown']); + uasort($metricsForMedianArr, fn ($a, $b) => $a['Ir'] <=> $b['Ir']); + $medianRunIndex = array_keys($metricsForMedianArr)[max(0, floor((count($metricsForMedianArr) - 3 /* -1 for count to index, -1 for first slow run due compliation, -1 for second run which is a little slower too */) / 2.0))]; + + // remove non-median profiles from artifacts foreach (range(0, $repeat - 1) as $k) { $profileOutSpecific = $profileOut . '.' . $k; - if ($k !== $bestRunIndex) { + if ($k !== $medianRunIndex) { unlink($profileOutSpecific); } } // annotate profiles for artifacts - foreach (['startup', $bestRunIndex, 'shutdown'] as $k) { + foreach (['startup', $medianRunIndex, 'shutdown'] as $k) { $profileOutSpecific = $profileOut . '.' . $k; runCommand([ @@ -171,7 +170,7 @@ function runValgrindPhpCgiCommand( ]); } - return ['instructions' => $metricsArr[$bestRunIndex]['Ir']]; + return ['instructions' => $metricsArr[$medianRunIndex]['Ir']]; } /** From 25f33f73ef6b81c1e7b92bb6308c799106150adf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Mon, 22 Jan 2024 12:52:22 +0100 Subject: [PATCH 09/13] match oriignal data --- benchmark/benchmark.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/benchmark/benchmark.php b/benchmark/benchmark.php index 5e388ca52ee4c..689dc9b9b76c9 100644 --- a/benchmark/benchmark.php +++ b/benchmark/benchmark.php @@ -170,7 +170,12 @@ function runValgrindPhpCgiCommand( ]); } - return ['instructions' => $metricsArr[$medianRunIndex]['Ir']]; + $instructions = $metricsArr[$medianRunIndex]['Ir']; + if ($repeat === 1) { // return the same data as before https://github.com/php/php-src/pull/13162 + $instructions += $metricsArr['startup']['Ir']; + } + + return ['instructions' => $instructions]; } /** From b338be10e547c792f4bfcac50734ccf696e3b832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Fri, 26 Jan 2024 18:29:44 +0100 Subject: [PATCH 10/13] dump profiles separately only if enabled by env var --- benchmark/benchmark.php | 2 +- benchmark/shared.php | 6 +++--- sapi/cgi/cgi_main.c | 14 ++++++++++++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/benchmark/benchmark.php b/benchmark/benchmark.php index 689dc9b9b76c9..9419838e1000f 100644 --- a/benchmark/benchmark.php +++ b/benchmark/benchmark.php @@ -125,7 +125,7 @@ function runValgrindPhpCgiCommand( '-d opcache.jit_buffer_size=128M', '-d opcache.validate_timestamps=0', ...$args, - ]); + ], null, array_merge(getenv(), ['BENCHMARK_DUMP_SEPARATE_PROFILES' => '1'])); // collect metrics for startup, each benchmark run and shutdown $metricsArr = []; diff --git a/benchmark/shared.php b/benchmark/shared.php index 6a6e6d2f62a62..c4779c2d9caf7 100644 --- a/benchmark/shared.php +++ b/benchmark/shared.php @@ -13,7 +13,7 @@ public function __construct( ) {} } -function runCommand(array $args, ?string $cwd = null): ProcessResult { +function runCommand(array $args, ?string $cwd = null, ?array $envVars = null): ProcessResult { $cmd = implode(' ', array_map(function (string|UnescapedArg $v): string { return $v instanceof UnescapedArg ? $v->arg @@ -22,7 +22,7 @@ function runCommand(array $args, ?string $cwd = null): ProcessResult { $pipes = null; $descriptorSpec = [0 => ['pipe', 'r'], 1 => ['pipe', 'w'], 2 => ['pipe', 'w']]; fwrite(STDOUT, "> $cmd\n"); - $processHandle = proc_open($cmd, $descriptorSpec, $pipes, $cwd ?? getcwd(), null); + $processHandle = proc_open($cmd, $descriptorSpec, $pipes, $cwd ?? getcwd(), $envVars); $stdin = $pipes[0]; $stdout = $pipes[1]; @@ -60,7 +60,7 @@ function runCommand(array $args, ?string $cwd = null): ProcessResult { fclose($stdout); fclose($stderr); - + $result = new ProcessResult($stdoutStr, $stderrStr); $statusCode = proc_close($processHandle); diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 586b5b97eff5f..ac70f592a4121 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -1696,6 +1696,16 @@ PHP_FUNCTION(apache_response_headers) /* {{{ */ } /* }}} */ +#ifdef HAVE_VALGRIND +static inline void callgrind_dump_stats(void) +{ + char *tmp = getenv("BENCHMARK_DUMP_SEPARATE_PROFILES"); + if (tmp && ZEND_ATOL(tmp)) { + CALLGRIND_DUMP_STATS; + } +} +#endif + static zend_module_entry cgi_module_entry = { STANDARD_MODULE_HEADER, "cgi-fcgi", @@ -2260,7 +2270,7 @@ consult the installation file that came with this distribution, or visit \n\ #ifdef HAVE_VALGRIND if (benchmark) { /* measure startup and each benchmark run separately */ - CALLGRIND_DUMP_STATS; + callgrind_dump_stats(); } #endif @@ -2578,7 +2588,7 @@ consult the installation file that came with this distribution, or visit \n\ #ifdef HAVE_VALGRIND /* measure shutdown separately */ - CALLGRIND_DUMP_STATS; + callgrind_dump_stats(); #endif break; From eff4cfbb782036cbc654aa4167a219f396253672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Fri, 26 Jan 2024 19:03:16 +0100 Subject: [PATCH 11/13] make sure children are traced (like parallel processing) --- benchmark/benchmark.php | 1 + 1 file changed, 1 insertion(+) diff --git a/benchmark/benchmark.php b/benchmark/benchmark.php index 9419838e1000f..aebd23136703b 100644 --- a/benchmark/benchmark.php +++ b/benchmark/benchmark.php @@ -114,6 +114,7 @@ function runValgrindPhpCgiCommand( '--tool=callgrind', '--dump-instr=yes', '--collect-jumps=yes', + '--trace-children=yes', "--callgrind-out-file=$profileOut", '--verbose', '--', From ba44c9fa98b27113120995cec640b3b961570b90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Fri, 26 Jan 2024 19:08:32 +0100 Subject: [PATCH 12/13] store also 1st profile in artifacts --- benchmark/benchmark.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmark/benchmark.php b/benchmark/benchmark.php index aebd23136703b..c240602fbd254 100644 --- a/benchmark/benchmark.php +++ b/benchmark/benchmark.php @@ -147,17 +147,17 @@ function runValgrindPhpCgiCommand( uasort($metricsForMedianArr, fn ($a, $b) => $a['Ir'] <=> $b['Ir']); $medianRunIndex = array_keys($metricsForMedianArr)[max(0, floor((count($metricsForMedianArr) - 3 /* -1 for count to index, -1 for first slow run due compliation, -1 for second run which is a little slower too */) / 2.0))]; - // remove non-median profiles from artifacts + // remove non-first-non-median profiles from artifacts foreach (range(0, $repeat - 1) as $k) { $profileOutSpecific = $profileOut . '.' . $k; - if ($k !== $medianRunIndex) { + if ($k !== 0 && $k !== $medianRunIndex) { unlink($profileOutSpecific); } } // annotate profiles for artifacts - foreach (['startup', $medianRunIndex, 'shutdown'] as $k) { + foreach (['startup', 0, $medianRunIndex, 'shutdown'] as $k) { $profileOutSpecific = $profileOut . '.' . $k; runCommand([ From eef30713a323e8b286d0126c1e738000f71dc21a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Fri, 26 Jan 2024 21:19:03 +0100 Subject: [PATCH 13/13] download benchmark dbgsym using debuginfod --- .github/workflows/push.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 9671e633c6be6..88ba750335268 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -235,7 +235,8 @@ jobs: libsqlite3-dev \ openssl \ re2c \ - valgrind + valgrind \ + debuginfod - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: @@ -285,7 +286,9 @@ jobs: ssh-key: ${{ secrets.BENCHMARKING_DATA_DEPLOY_KEY }} path: benchmark/repos/data - name: Benchmark - run: php benchmark/benchmark.php true + run: | + export DEBUGINFOD_URLS="https://debuginfod.ubuntu.com" + php benchmark/benchmark.php true - name: Store result if: github.event_name == 'push' run: |