pmctest.py (6a068746777241722b2b32c5d0bc443a2a64d80b) | pmctest.py (d2c10b2a70e08c3d2a51c65de4b4510b9bb5921b) |
---|---|
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# --- 53 unchanged lines hidden (view full) --- 62 parser = OptionParser() 63 parser.add_option("-p", "--program", dest="program", 64 help="program to execute") 65 parser.add_option("-w", "--wait", action="store_true", dest="wait", 66 default=True, help="wait after each execution") 67 68 (options, args) = parser.parse_args() 69 | 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# --- 53 unchanged lines hidden (view full) --- 62 parser = OptionParser() 63 parser.add_option("-p", "--program", dest="program", 64 help="program to execute") 65 parser.add_option("-w", "--wait", action="store_true", dest="wait", 66 default=True, help="wait after each execution") 67 68 (options, args) = parser.parse_args() 69 |
70 if (options.program == None): 71 print "specify program, such as ls, with -p/--program" 72 sys.exit() 73 |
|
70 p = subprocess.Popen(["pmccontrol", "-L"], stdout=PIPE) 71 counters = p.communicate()[0] 72 73 if len(counters) <= 0: 74 print "no counters found" 75 sys.exit() 76 77 for counter in counters.split(): --- 17 unchanged lines hidden --- | 74 p = subprocess.Popen(["pmccontrol", "-L"], stdout=PIPE) 75 counters = p.communicate()[0] 76 77 if len(counters) <= 0: 78 print "no counters found" 79 sys.exit() 80 81 for counter in counters.split(): --- 17 unchanged lines hidden --- |