runner.pm: run memanalyzer as a Perl module
To improve performance of torture tests.
Also on Windows, where this patch may make those viable for CI.
Linux !FTP 4m47 -> 4m24 (-shallow=25)
Linux FTP 2m30 -> 2m23 (-shallow=25)
macOS !FTP 14m30 -> 13m07 (-shallow=25)
macOS FTP 3m57 -> 3m59 (-shallow=25)
Windows !FTP >25m -> 4m47 to 14m45 (-shallow=5 to 25) (not in CI)
Linux
Before: https://github.com/curl/curl/actions/runs/20006771767/job/57370205514
After: https://github.com/curl/curl/actions/runs/20006783210/job/57370236911?pr=19863
macOS:
Before: https://github.com/curl/curl/actions/runs/20006771786/job/57370205769
After: https://github.com/curl/curl/actions/runs/20006783177/job/57370236995?pr=19863
Windows:
Before: https://github.com/curl/curl/actions/runs/19667198537/job/56326962912?pr=19675
After: https://github.com/curl/curl/actions/runs/20007175773/job/57371768734?pr=19863
After shallow=25: https://github.com/curl/curl/actions/runs/20008523913/job/57374427449?pr=19865
Ref: #19675
Follow-up to 472bc9032374f98f48f7a2df6c644cff91fe142c #19821
Closes #19863
diff --git a/tests/runner.pm b/tests/runner.pm
index b69bbf2..10be04b 100644
--- a/tests/runner.pm
+++ b/tests/runner.pm
@@ -107,6 +107,7 @@
subnewlines
);
use valgrind;
+use memanalyzer;
#######################################################################
@@ -449,7 +450,7 @@
# memanalyze -v is our friend, get the number of allocations made
my $count=0;
- my @out = `$memanalyze -v "$LOGDIR/$MEMDUMP"`;
+ my @out = memanalyze("$LOGDIR/$MEMDUMP", 1, 0, 0);
for(@out) {
if(/^Operations: (\d+)/) {
$count = $1;
@@ -549,7 +550,7 @@
$fail=1;
}
else {
- my @memdata=`$memanalyze "$LOGDIR/$MEMDUMP"`;
+ my @memdata = memanalyze("$LOGDIR/$MEMDUMP", 0, 0, 0);
my $leak=0;
for(@memdata) {
if($_ ne "") {
@@ -561,7 +562,7 @@
if($leak) {
logmsg "** MEMORY FAILURE\n";
logmsg @memdata;
- logmsg `$memanalyze -l "$LOGDIR/$MEMDUMP"`;
+ logmsg memanalyze("$LOGDIR/$MEMDUMP", 0, 0, 1);
$fail = 1;
}
}