summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorsbruno <sbruno@FreeBSD.org>2015-02-13 19:06:22 +0000
committersbruno <sbruno@FreeBSD.org>2015-02-13 19:06:22 +0000
commitea2d6502704f771d4b741b98665f532edffaa742 (patch)
tree60a85cd1dd03dd3670daa0c7084a200bec287310 /tools
parent2da30ef0cef2592c2b91f6c174fddc3c2e49af7c (diff)
downloadFreeBSD-src-ea2d6502704f771d4b741b98665f532edffaa742.zip
FreeBSD-src-ea2d6502704f771d4b741b98665f532edffaa742.tar.gz
MFC 272315 272757 274091 274902
for real this time r272315 Explicitly return None for negative event indices. Prior to this, eventat(-1) would return the next-to-last event causing the back button to cycle back to the end of an event source instead of stopping at the start. r272757 Add schedgraph traces for callout handlers. Specifically, a callwheel logs a running event each time it executes a callout function. The event includes the function pointer, argument, and whether or not it was run from hardware interrupt context. The callwheel is marked idle when each handler completes. This effectively logs the duration of each callout routine in the graph. r274091 Bind Ctrl-Q as a global hotkey to exit. Bind Ctrl-W as a hotkey to close dialogs. r274902 Add a new thread state "spinning" to schedgraph and add tracepoints at the start and stop of spinning waits in lock primitives. Reviewed by: jhb
Diffstat (limited to 'tools')
-rw-r--r--tools/sched/schedgraph.py23
1 files changed, 19 insertions, 4 deletions
diff --git a/tools/sched/schedgraph.py b/tools/sched/schedgraph.py
index 4335574..f0552ca 100644
--- a/tools/sched/schedgraph.py
+++ b/tools/sched/schedgraph.py
@@ -70,6 +70,7 @@ eventcolors = [
("count", "red"),
("running", "green"),
("idle", "grey"),
+ ("spinning", "red"),
("yielding", "yellow"),
("swapped", "violet"),
("suspended", "purple"),
@@ -80,8 +81,6 @@ eventcolors = [
("runq rem", "yellow"),
("thread exit", "grey"),
("proc exit", "grey"),
- ("callwheel idle", "grey"),
- ("callout running", "green"),
("lock acquire", "blue"),
("lock contest", "purple"),
("failed lock try", "red"),
@@ -288,6 +287,10 @@ class ColorConfigure(Toplevel):
color = graph.getcolor(type[0])
if (color != ""):
self.additem(type[0], color)
+ self.bind("<Control-w>", self.destroycb)
+
+ def destroycb(self, event):
+ self.destroy()
def additem(self, name, color):
item = ColorConf(self.items, name, color)
@@ -373,6 +376,10 @@ class SourceConfigure(Toplevel):
self.addsource(source)
self.drawbuttons()
self.buttons.grid(row=1, column=0, sticky=W)
+ self.bind("<Control-w>", self.destroycb)
+
+ def destroycb(self, event):
+ self.destroy()
def addsource(self, source):
if (self.irow > 30):
@@ -487,6 +494,10 @@ class SourceStats(Toplevel):
bd=1, relief=SUNKEN, width=10).grid(
row=ypos, column=3, sticky=W+E)
ypos += 1
+ self.bind("<Control-w>", self.destroycb)
+
+ def destroycb(self, event):
+ self.destroy()
class SourceContext(Menu):
@@ -529,6 +540,7 @@ class EventView(Toplevel):
self.drawbuttons()
event.displayref(canvas)
self.bind("<Destroy>", self.destroycb)
+ self.bind("<Control-w>", self.destroycb)
def destroycb(self, event):
self.unbind("<Destroy>")
@@ -856,7 +868,7 @@ class EventSource:
return (Y_EVENTSOURCE)
def eventat(self, i):
- if (i >= len(self.events)):
+ if (i >= len(self.events) or i < 0):
return (None)
event = self.events[i]
return (event)
@@ -903,7 +915,6 @@ class KTRFile:
self.timestamp_f = None
self.timestamp_l = None
self.locks = {}
- self.callwheels = {}
self.ticks = {}
self.load = {}
self.crit = {}
@@ -1310,6 +1321,10 @@ class SchedGraph(Frame):
self.pack(expand=1, fill="both")
self.buildwidgets()
self.layout()
+ self.bind_all("<Control-q>", self.quitcb)
+
+ def quitcb(self, event):
+ self.quit()
def buildwidgets(self):
global status
OpenPOWER on IntegriCloud