summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2005-11-21 21:27:40 +0000
committerscottl <scottl@FreeBSD.org>2005-11-21 21:27:40 +0000
commit01fb37711b43edde1e0bf25117f0e1c3267541fc (patch)
tree4a29b7885c0a2d319111721737417425e5b81f9f /tools
parent80adaaedab59e8fc3b6b8e747670177d2f64cb2a (diff)
downloadFreeBSD-src-01fb37711b43edde1e0bf25117f0e1c3267541fc.zip
FreeBSD-src-01fb37711b43edde1e0bf25117f0e1c3267541fc.tar.gz
Teach schedgraph how to parse KTR_CRITICAL records. critical_enter/exit
events are now plotted as a counting graph, similar to CPU load, so that their duration and critnest values can be visualized.
Diffstat (limited to 'tools')
-rw-r--r--tools/sched/schedgraph.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/sched/schedgraph.py b/tools/sched/schedgraph.py
index 56e055b..c76372e 100644
--- a/tools/sched/schedgraph.py
+++ b/tools/sched/schedgraph.py
@@ -815,6 +815,7 @@ class KTRFile:
self.sources = []
self.ticks = {}
self.load = {}
+ self.crit = {}
self.parse(file)
self.fixup()
@@ -830,6 +831,7 @@ class KTRFile:
ktrhdr = "\s+\d+\s+(\d+)\s+(\d+)\s+"
tdname = "(\S+)\(([^)]*)\)"
+ crittdname = "(\S+)\s+\(\d+,\s+([^)]*)\)"
ktrstr = "mi_switch: " + tdname
ktrstr += " prio (\d+) inhibit (\d+) wmesg (\S+) lock (\S+)"
@@ -868,6 +870,9 @@ class KTRFile:
cpuload_re = re.compile(ktrhdr + "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],
[loadglobal_re, self.loadglobal],
[switchin_re, self.switchin],
@@ -879,6 +884,7 @@ class KTRFile:
[sched_rem_re, self.sched_rem],
[sched_exit_re, self.sched_exit],
[sched_clock_re, self.sched_clock],
+ [critsec_re, self.critsec],
[idled_re, self.idled]]
for line in ifp.readlines():
@@ -1024,6 +1030,18 @@ class KTRFile:
self.sources.insert(0, load)
Count(load, cpu, timestamp, count)
+ def critsec(self, cpu, timestamp, td, pcomm, to):
+ if (self.checkstamp(timestamp) == 0):
+ return
+ cpu = int(cpu)
+ try:
+ crit = self.crit[cpu]
+ except:
+ crit = Counter("Critical Section")
+ self.crit[cpu] = crit
+ self.sources.insert(0, crit)
+ Count(crit, cpu, timestamp, to)
+
def findtd(self, td, pcomm):
for thread in self.threads:
if (thread.str == td and thread.name == pcomm):
OpenPOWER on IntegriCloud