git: 329655d89d9f - stable/14 - Correct the data collection arguments. Add proper tempdirs.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 23 Feb 2026 13:33:46 UTC
The branch stable/14 has been updated by gnn:
URL: https://cgit.FreeBSD.org/src/commit/?id=329655d89d9fdb03eac1dc0fda0aae3de61c0b93
commit 329655d89d9fdb03eac1dc0fda0aae3de61c0b93
Author: George V. Neville-Neil <gnn@FreeBSD.org>
AuthorDate: 2026-01-06 08:17:38 +0000
Commit: George V. Neville-Neil <gnn@FreeBSD.org>
CommitDate: 2026-02-23 13:33:31 +0000
Correct the data collection arguments. Add proper tempdirs.
(cherry picked from commit e018fedef0a6389240322da9fa4b9fa9971f6e59)
---
tools/test/hwpmc/pmctest.py | 9 ++++++---
1 file 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]