pmctest.py (300675f6fc464ea902932e6ee4aa2ac98e3f3c34) pmctest.py (05864d89d10c54fe35fe510833c55e41b47170a0)
1#!/usr/bin/env python
2# Copyright (c) 2012, Neville-Neil Consulting
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met:
8#

--- 37 unchanged lines hidden (view full) ---

46# The default is to wait after each counter is tested. Since the
47# prompt would go to stdout you won't see it, just press return
48# to continue or Ctrl-D to stop.
49
50import sys
51import subprocess
52from subprocess import PIPE
53
1#!/usr/bin/env python
2# Copyright (c) 2012, Neville-Neil Consulting
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met:
8#

--- 37 unchanged lines hidden (view full) ---

46# The default is to wait after each counter is tested. Since the
47# prompt would go to stdout you won't see it, just press return
48# to continue or Ctrl-D to stop.
49
50import sys
51import subprocess
52from subprocess import PIPE
53
54# Use input() for Python version 3
55if sys.version_info[0] == 3:
56 raw_input = input
57
54# A list of strings that are not really counters, just
55# name tags that are output by pmccontrol -L
56notcounter = ["IAF", "IAP", "TSC", "UNC", "UCF", "UCP", "SOFT" ]
57
58def main():
59
60 from optparse import OptionParser
61

--- 20 unchanged lines hidden (view full) ---

82 if counter in notcounter:
83 continue
84 p = subprocess.Popen(["pmcstat", "-p", counter, options.program],
85 stdout=PIPE)
86 result = p.communicate()[0]
87 print(result)
88 if (options.wait == True):
89 try:
58# A list of strings that are not really counters, just
59# name tags that are output by pmccontrol -L
60notcounter = ["IAF", "IAP", "TSC", "UNC", "UCF", "UCP", "SOFT" ]
61
62def main():
63
64 from optparse import OptionParser
65

--- 20 unchanged lines hidden (view full) ---

86 if counter in notcounter:
87 continue
88 p = subprocess.Popen(["pmcstat", "-p", counter, options.program],
89 stdout=PIPE)
90 result = p.communicate()[0]
91 print(result)
92 if (options.wait == True):
93 try:
90 value = input("next?")
94 value = raw_input("next?")
91 except EOFError:
92 sys.exit()
93
94# The canonical way to make a python module into a script.
95# Remove if unnecessary.
96
97if __name__ == "__main__":
98 main()
95 except EOFError:
96 sys.exit()
97
98# The canonical way to make a python module into a script.
99# Remove if unnecessary.
100
101if __name__ == "__main__":
102 main()