- Fix the ktr header regexp so we match lines with very large indexes.

- Add support for messages where cpu load is added to a remote cpu.
 - print unmatched lines to stdout
This commit is contained in:
Jeff Roberson 2007-11-12 17:33:07 +00:00
parent 3b9982e59c
commit 2e2e6cc953
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=173568

View File

@ -515,7 +515,7 @@ class Yielding(StateEvent):
enabled = 1
def __init__(self, thread, cpu, timestamp, prio):
StateEvent.__init__(self, thread, cpu, timestamp)
self.skipnext = 1
self.skipnext = 0
self.prio = prio
self.textadd(("prio:", self.prio, 0))
@ -862,7 +862,7 @@ def parse(self, file):
print "Can't open", file
sys.exit(1)
ktrhdr = "\s+\d+\s+(\d+)\s+(\d+)\s+"
ktrhdr = "\s*\d+\s+(\d+)\s+(\d+)\s+"
tdname = "(\S+)\(([^)]*)\)"
crittdname = "(\S+)\s+\(\d+,\s+([^)]*)\)"
@ -901,12 +901,14 @@ def parse(self, file):
sched_prio_re = re.compile(ktrhdr + ktrstr)
cpuload_re = re.compile(ktrhdr + "load: (\d+)")
cpuload2_re = re.compile(ktrhdr + "cpu (\d+) load: (\d+)")
loadglobal_re = re.compile(ktrhdr + "global load: (\d+)")
ktrstr = "critical_\S+ by thread " + crittdname + " to (\d+)"
critsec_re = re.compile(ktrhdr + ktrstr)
parsers = [[cpuload_re, self.cpuload],
[cpuload2_re, self.cpuload2],
[loadglobal_re, self.loadglobal],
[switchin_re, self.switchin],
[switchout_re, self.switchout],
@ -932,8 +934,8 @@ def parse(self, file):
if (m != None):
p[1](*m.groups())
break
# if (m == None):
# print line,
if (m == None):
print line,
def synchstamp(self, lines):
status.startup("Rationalizing Timestamps")
@ -1122,6 +1124,19 @@ def cpuload(self, cpu, timestamp, count):
self.sources.insert(0, load)
Count(load, cpu, timestamp, count)
def cpuload2(self, cpu, timestamp, ncpu, count):
timestamp = self.checkstamp(cpu, timestamp)
if (timestamp == 0):
return
cpu = int(ncpu)
try:
load = self.load[cpu]
except:
load = Counter("cpu" + str(cpu) + " load")
self.load[cpu] = load
self.sources.insert(0, load)
Count(load, cpu, timestamp, count)
def loadglobal(self, cpu, timestamp, count):
timestamp = self.checkstamp(cpu, timestamp)
if (timestamp == 0):