Lines Matching +full:python +full:- +full:dev
1 #!/usr/bin/env python
2 # SPDX-License-Identifier: BSD-3-Clause
4 # Copyright (c) 2012, Neville-Neil Consulting
5 # Copyright (c) 2026, George V. Neville-Neil
14 # pmctest.py -p ls > /dev/null
21 # to continue or Ctrl-D to stop.
34 result = subprocess.run("pmccontrol -L", shell=True, capture_output=True, text=True)
39 # name tags that are output by pmccontrol -L
45 parser.add_argument('--program', type=str, required=True, help='target program')
46 parser.add_argument('--wait', action='store_true', help='Wait after each counter.')
47 …parser.add_argument('--count', action='store_true', help='Exercise the program being studied using…
48 …parser.add_argument('--sample', action='store_true', help='Exercise the program being studied usin…
59 print("Choose one of --count OR --sample.")
67 tmpdir = tempfile.mkdtemp(prefix=program + "-", suffix="-counting-pmc")
71 tmpdir = tempfile.mkdtemp(prefix=program + "-", suffix="-sampling-pmc")
78 with open(tmpdir + "/" + program + "-" + counter + ".txt", 'w') as file:
79 p = subprocess.Popen(["pmcstat", "-p", counter] + program_parts,
84 pmcout = tmpdir + "/" + program + "-" + counter + ".pmc"
86 "-O", pmcout,
87 "-P", counter] + program_parts,
90 resdir = tmpdir + "/" + program + "-" + counter + ".results"
93 "-R", pmcout,
94 "-g"],
114 p = subprocess.Popen(["pmcstat", "-p", counter] + program_parts,
124 # The canonical way to make a python module into a script.