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 472bc90323 #19821
Closes #19863
This commit is contained in:
Viktor Szakats 2025-12-07 16:58:34 +01:00
parent cc5c1553fb
commit f08417c425
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201

View File

@ -107,6 +107,7 @@ use testutil qw(
subnewlines
);
use valgrind;
use memanalyzer;
#######################################################################
@ -449,7 +450,7 @@ sub torture {
# 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 @@ sub torture {
$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 @@ sub torture {
if($leak) {
logmsg "** MEMORY FAILURE\n";
logmsg @memdata;
logmsg `$memanalyze -l "$LOGDIR/$MEMDUMP"`;
logmsg memanalyze("$LOGDIR/$MEMDUMP", 0, 0, 1);
$fail = 1;
}
}