automerged had issues with the options.XXXXX in stats.py

--HG--
extra : convert_revision : 44db6642c1fb46eb515acd5a6d8465859a40891a
This commit is contained in:
Ali Saidi 2005-01-14 00:05:49 -05:00
commit 3e5a3df24f
2 changed files with 12 additions and 5 deletions

View file

@ -152,7 +152,7 @@ class Statistic(object):
if attr == 'bins': if attr == 'bins':
if value is not None: if value is not None:
value = source.getBin(value) value = source.getBin(value)
elif attr == 'samples' and type(value) is str: elif attr == 'ticks' and type(value) is str:
value = [ int(x) for x in value.split() ] value = [ int(x) for x in value.split() ]
self.__dict__[attr] = value self.__dict__[attr] = value
@ -252,7 +252,7 @@ class FormulaStat(object):
class Scalar(Statistic,FormulaStat): class Scalar(Statistic,FormulaStat):
def getValue(self): def getValue(self):
return source.data(self, self.bins) return source.data(self, self.bins, self.ticks)
def display(self): def display(self):
import display import display

View file

@ -268,6 +268,10 @@ def commands(options, command, args):
if options.graph: if options.graph:
graphdata(runs, options, stat.name, stat.name, stat) graphdata(runs, options, stat.name, stat.name, stat)
else: else:
if options.ticks:
print 'only displaying sample %s' % options.ticks
stat.ticks = options.ticks
if options.binned: if options.binned:
print 'kernel ticks' print 'kernel ticks'
stat.bins = 'kernel' stat.bins = 'kernel'
@ -282,7 +286,7 @@ def commands(options, command, args):
printdata(runs, stat) printdata(runs, stat)
print 'interrupt ticks' print 'interrupt ticks'
stat.bins = 'user' stat.bins = 'interrupt'
printdata(runs, stat) printdata(runs, stat)
print 'total ticks' print 'total ticks'
@ -315,7 +319,7 @@ def commands(options, command, args):
printdata(runs, stat) printdata(runs, stat)
print 'interrupt ticks' print 'interrupt ticks'
stat.bins = 'user' stat.bins = 'interrupt'
printdata(runs, stat) printdata(runs, stat)
print 'total ticks' print 'total ticks'
@ -645,8 +649,9 @@ if __name__ == '__main__':
options.binned = False options.binned = False
options.graph = False options.graph = False
options.graph68 = False options.graph68 = False
options.ticks = False
opts, args = getopts(sys.argv[1:], '-6BEFGd:g:h:pr:s:u:') opts, args = getopts(sys.argv[1:], '-6BEFGd:g:h:pr:s:u:T:')
for o,a in opts: for o,a in opts:
if o == '-6': if o == '-6':
options.graph68 = True options.graph68 = True
@ -672,6 +677,8 @@ if __name__ == '__main__':
options.user = a options.user = a
if o == '-s': if o == '-s':
options.system = a options.system = a
if o == '-T':
options.ticks = a
if len(args) == 0: if len(args) == 0:
usage() usage()