aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge V. Neville-Neil <gnn@FreeBSD.org>2026-01-06 08:17:38 +0000
committerGeorge V. Neville-Neil <gnn@FreeBSD.org>2026-01-06 08:18:22 +0000
commite018fedef0a6389240322da9fa4b9fa9971f6e59 (patch)
tree5a64568e2fe8e12132da26fe3210c345aeda4e28
parentf384784289dba13b90138a89d3df3a8ea063aff9 (diff)
-rwxr-xr-xtools/test/hwpmc/pmctest.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/test/hwpmc/pmctest.py b/tools/test/hwpmc/pmctest.py
index f54541aeea1e..8accdf09e69a 100755
--- a/tools/test/hwpmc/pmctest.py
+++ b/tools/test/hwpmc/pmctest.py
@@ -20,10 +20,12 @@
# prompt would go to stdout you won't see it, just press return
# to continue or Ctrl-D to stop.
+import sys
import subprocess
from subprocess import PIPE
import argparse
import tempfile
+from pathlib import Path
def gather_counters():
"""Run program and return output as array of lines."""
@@ -50,8 +52,10 @@ def main():
print("no counters found")
sys.exit()
+ program = Path(args.program).name
+
if args.exercise == True:
- tmpdir = tempfile.mkdtemp()
+ tmpdir = tempfile.mkdtemp(prefix=program + "-", suffix="-pmc")
print("Exercising program ", args.program, " storing results data in ", tmpdir)
for counter in counters:
@@ -59,8 +63,7 @@ def main():
continue
if args.exercise == True:
p = subprocess.Popen(["pmcstat",
- "-O", tmpdir + "/" + args.program + "-" + counter + ".pmc",
- "-g",
+ "-O", tmpdir + "/" + program + "-" + counter + ".pmc",
"-P", counter, args.program],
text=True, stderr=PIPE)
result = p.communicate()[1]