Lines Matching +full:event +full:- +full:name
3 # Copyright (c) 2002-2003, 2009, Jeffrey Roberson <jeff@freebsd.org>
19 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
37 # - Install the ports/x11-toolkits/py-tkinter package; e.g.
38 # pkg install x11-toolkits/py-tkinter
39 # - Add KTR_SCHED to KTR_COMPILE and KTR_MASK in your KERNCONF; e.g.
44 # - It is encouraged to increase KTR_ENTRIES size to gather enough
49 # - Rebuild kernel with proper changes to KERNCONF and boot new kernel.
50 # - Run your workload to be profiled.
51 # - While the workload is continuing (i.e. before it finishes), disable
58 # - Dump the trace to a file: 'ktrdump -ct > ktr.out'
59 # - Alternatively, use schedgraph.d script in this directory for getting
61 # - Run the python script: 'python schedgraph.py ktr.out' optionally provide
65 # Add a per-source summary display
67 # Mouse-over popup of full thread/event/row label (currently truncated)
68 # More visible anchors for popup event windows
71 # colours to represent them ;-)
129 lineno = -1
144 def lookup(self, name): argument
146 color = self.map[name]
149 print("Picking random color", color, "for", name)
150 self.map[name] = color
151 self.table.append((name, color))
217 def __init__(self, master, name, color): argument
219 if (graph.getstate(name) == "hidden"):
223 self.name = name
235 self.label = Label(self, text=self.name, anchor=W)
266 graph.setcolor(self.name, self.color_current)
268 graph.hide(self.name)
271 graph.setcolor(self.name, self.color_current)
278 def __init__(self, table, name): argument
281 self.title(name)
294 self.bind("<Control-w>", self.destroycb)
296 def destroycb(self, event): argument
299 def additem(self, name, color): argument
300 item = ColorConf(self.items, name, color)
331 self.name = source.name
339 self.label = Label(self, text=self.name, anchor=W)
383 self.bind("<Control-w>", self.destroycb)
385 def destroycb(self, event): argument
455 self.title(source.name + " statistics")
457 text="Event Count, Duration, Avg Duration")
460 for event in self.source.events:
461 if (event.type == "pad"):
463 duration = event.duration
464 if (event.name in eventtypes):
465 (c, d) = eventtypes[event.name]
468 eventtypes[event.name] = (c, d)
470 eventtypes[event.name] = (1, duration)
478 for event in events:
479 (name, c, d) = event
480 Label(self.evframe, text=name, bd=1,
497 self.bind("<Control-w>", self.destroycb)
499 def destroycb(self, event): argument
504 def __init__(self, event, source): argument
510 self.tk_popup(event.x_root-3, event.y_root+3)
529 def __init__(self, event, canvas): argument
532 self.title("Event")
533 self.event = event
541 event.displayref(canvas)
543 self.bind("<Control-w>", self.destroycb)
545 def destroycb(self, event): argument
547 if (self.event != None):
548 self.event.displayunref(self.canvas)
549 self.event = None
558 labels = self.event.labels()
562 name, value = label
564 if (name == "linkedto"):
566 l = Label(self.frame, text=name, bd=1, width=15,
577 r.bind("<Button-1>", self.linkpress)
590 def newevent(self, event): argument
591 self.event.displayunref(self.canvas)
593 self.event = event
594 self.event.displayref(self.canvas)
598 EventView(self.event, self.canvas)
601 prev = self.event.prev()
611 next = self.event.next()
621 event = self.event.getlinked()
622 if (event != None):
623 self.newevent(event)
625 class Event: class
626 def __init__(self, source, name, cpu, timestamp, attrs): argument
628 self.name = name
639 statstr = self.name + " " + self.source.name
646 if (i != len(self.attrs) - 1):
651 return [("Source", self.source.name),
652 ("Event", self.name),
689 return self.source.eventat(self.idx - 1)
697 self.dispcnt -= 1
710 class PointEvent(Event):
712 def __init__(self, source, name, cpu, timestamp, attrs): argument
713 Event.__init__(self, source, name, cpu, timestamp, attrs)
716 color = colormap.lookup(self.name)
717 l = canvas.create_oval(xpos - XY_POINT, ypos,
718 xpos + XY_POINT, ypos - (XY_POINT * 2),
720 tags=("event", self.type, self.name, self.source.tag))
721 Event.draw(self, canvas, xpos, ypos, l)
725 class StateEvent(Event):
727 def __init__(self, source, name, cpu, timestamp, attrs): argument
728 Event.__init__(self, source, name, cpu, timestamp, attrs)
734 self.duration = duration = next.timestamp - self.timestamp
736 color = colormap.lookup(self.name)
744 xpos + delta, ypos - 10, fill=color, width=0,
745 tags=("event", self.type, self.name, self.source.tag))
746 Event.draw(self, canvas, xpos, ypos, l)
750 class CountEvent(Event):
755 Event.__init__(self, source, "count", cpu, timestamp, attrs)
762 self.duration = duration = next.timestamp - self.timestamp
772 l = canvas.create_rectangle(xpos, ypos - yhight,
774 tags=("event", self.type, self.name, self.source.tag))
775 Event.draw(self, canvas, xpos, ypos, l)
782 cpu = source.events[len(source.events) -1].cpu
790 duration = next.timestamp - self.timestamp
792 Event.draw(self, canvas, xpos, ypos, None)
799 self.name = id
812 self.group == other.group and self.name < other.name)
817 return self.group == other.group and self.name == other.name
825 def addevent(self, event): argument
826 self.events.append(event)
828 def addlastevent(self, event): argument
829 self.events.insert(0, event)
837 for event in self.events:
838 if (event.cpu != cpu and event.cpu != -1):
841 cpu = event.cpu
842 xpos = event.draw(canvas, xpos, ypos)
847 ypos = ypos - (self.ysize() / 2)
849 text=self.name)
857 ypos - self.ysize() - canvas.bdheight,
875 event = self.events[i]
876 return (event)
879 for event in self.events:
880 if (event.timestamp >= timestamp and event.type != "pad"):
881 return (event)
898 for event in self.events:
899 if (event.type != "count"):
901 count = int(event.count)
938 titlestr += str(len(sources)) + " event sources, "
1012 # Name may or may not be quoted.
1022 (name, name1, val, val1, attrstring, end, end1) = m.groups();
1023 if (name == None):
1024 name = name1
1031 if (name == "stathz"):
1033 attrs.append((name, val))
1067 timestamp -2048> self.timestamp_l):
1086 if (source.name == id):
1091 return (self.timestamp_f - self.timestamp_l);
1110 e = PadEvent(source, -1, self.timestamp_l)
1112 e = PadEvent(source, -1, self.timestamp_f, last=1)
1154 self.bind("<Button-1>", self.master.mousepress);
1155 self.bind("<Button-3>", self.master.mousepressright);
1156 self.bind("<ButtonRelease-1>", self.master.mouserelease);
1157 self.bind("<B1-Motion>", self.master.mousemotion);
1180 self.ratio = (ktrfile.timespan() - 1) / 2**31 + 1
1186 status.startup("Drawing " + source.name)
1198 self.tag_bind("event", "<Enter>", self.mouseenter)
1199 self.tag_bind("event", "<Leave>", self.mouseexit)
1200 self.bind("<Button-1>", self.mousepress)
1201 self.bind("<Button-3>", self.master.mousepressright);
1202 self.bind("<Button-4>", self.wheelup)
1203 self.bind("<Button-5>", self.wheeldown)
1204 self.bind("<ButtonRelease-1>", self.master.mouserelease);
1205 self.bind("<B1-Motion>", self.master.mousemotion);
1215 def mouseenter(self, event): argument
1219 def mouseexit(self, event): argument
1223 def mousepress(self, event): argument
1227 self.master.mousepress(event)
1229 # Only grab mouse presses for things with event tags.
1233 if (tag == "event"):
1237 self.master.mousepress(event)
1239 def wheeldown(self, event): argument
1242 def wheelup(self, event): argument
1243 self.parent.display_yview("scroll", -1, "units")
1261 midpoint = xstart + ((xend - xstart) / 2)
1268 xsize = (xend - xstart) / 2
1269 self.xview_moveto(midpoint - xsize)
1294 self.confmenu.add_command(label="Event Colors",
1304 ColorConfigure(eventcolors, "Event Display Configuration")
1326 self.bind_all("<Control-q>", self.quitcb)
1328 def quitcb(self, event): argument
1369 self.constwidth = width - int(self.display["width"])
1375 def mousepress(self, event): argument
1376 self.clicksource = self.sourceat(event.y)
1378 def mousepressright(self, event): argument
1379 source = self.sourceat(event.y)
1382 SourceContext(event, source)
1384 def mouserelease(self, event): argument
1387 newsource = self.sourceat(event.y)
1393 def mousemotion(self, event): argument
1396 newsource = self.sourceat(event.y)
1401 # user can't mouseover a non-contiguous area.
1415 return source.y - self.bdheight - source.ysize()
1442 diff = source2.ysize() - source1.ysize()
1445 source1.move(self.display, 0, y1targ - y1)
1446 source2.move(self.display, 0, y2targ - y2)
1447 source1.movename(self.names, 0, y1targ - y1)
1448 source2.movename(self.names, 0, y2targ - y2)
1471 off = newy - self.sourcestart(source)
1472 self.sourceshiftall(newy-1, self.sourcesize(source))
1506 off = (newy + size) - self.sourcestart(source)
1553 self.sourceshift(source, -size)
1564 self.sourceshiftall(start, -self.sourcesize(source))
1609 scalemax = ktrfile.timespan() / (width - self.constwidth)