From owner-svn-src-all@FreeBSD.ORG Thu Jan 22 06:21:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FF471065686; Thu, 22 Jan 2009 06:21:30 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E7A48FC17; Thu, 22 Jan 2009 06:21:30 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0M6LUau002746; Thu, 22 Jan 2009 06:21:30 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0M6LU5v002745; Thu, 22 Jan 2009 06:21:30 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <200901220621.n0M6LU5v002745@svn.freebsd.org> From: Jeff Roberson Date: Thu, 22 Jan 2009 06:21:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187580 - head/tools/sched X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2009 06:21:31 -0000 Author: jeff Date: Thu Jan 22 06:21:30 2009 New Revision: 187580 URL: http://svn.freebsd.org/changeset/base/187580 Log: - Update my copyright. - Print human readable time as a float with two digits of precision. Use ns now as well since clock periods are well into the hundreds of picoseconds now. - Show the average duration in the stats frame. This is often more useful than total duration. Modified: head/tools/sched/schedgraph.py Modified: head/tools/sched/schedgraph.py ============================================================================== --- head/tools/sched/schedgraph.py Thu Jan 22 05:05:56 2009 (r187579) +++ head/tools/sched/schedgraph.py Thu Jan 22 06:21:30 2009 (r187580) @@ -1,6 +1,6 @@ #!/usr/local/bin/python -# Copyright (c) 2002-2003, Jeffrey Roberson +# Copyright (c) 2002-2003, 2009, Jeffrey Roberson # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -149,15 +149,19 @@ class Colormap: return (color) def ticks2sec(ticks): - us = ticksps / 1000000 - ticks /= us + ticks = float(ticks) + ns = float(ticksps) / 1000000000 + ticks /= ns if (ticks < 1000): - return (str(ticks) + "us") + return ("%.2fns" % ticks) ticks /= 1000 if (ticks < 1000): - return (str(ticks) + "ms") + return ("%.2fus" % ticks) ticks /= 1000 - return (str(ticks) + "s") + if (ticks < 1000): + return ("%.2fms" % ticks) + ticks /= 1000 + return ("%.2fs" % ticks) class Scaler(Frame): def __init__(self, master, target): @@ -443,7 +447,7 @@ class SourceStats(Toplevel): self.resizable(0, 0) self.title(source.name + " statistics") self.evframe = LabelFrame(self, - text="Event Frequency and Duration") + text="Event Count, Duration, Avg Duration") self.evframe.grid(row=0, column=0, sticky=E+W) eventtypes={} for event in self.source.events: @@ -466,15 +470,22 @@ class SourceStats(Toplevel): ypos = 0 for event in events: (name, c, d) = event - l = Label(self.evframe, text=name, bd=1, - relief=SUNKEN, anchor=W, width=30) - m = Label(self.evframe, text=str(c), bd=1, - relief=SUNKEN, anchor=W, width=10) - r = Label(self.evframe, text=ticks2sec(d), - bd=1, relief=SUNKEN, width=10) - l.grid(row=ypos, column=0, sticky=E+W) - m.grid(row=ypos, column=1, sticky=E+W) - r.grid(row=ypos, column=2, sticky=E+W) + Label(self.evframe, text=name, bd=1, + relief=SUNKEN, anchor=W, width=30).grid( + row=ypos, column=0, sticky=W+E) + Label(self.evframe, text=str(c), bd=1, + relief=SUNKEN, anchor=W, width=10).grid( + row=ypos, column=1, sticky=W+E) + Label(self.evframe, text=ticks2sec(d), + bd=1, relief=SUNKEN, width=10).grid( + row=ypos, column=2, sticky=W+E) + if (d and c): + d /= c + else: + d = 0 + Label(self.evframe, text=ticks2sec(d), + bd=1, relief=SUNKEN, width=10).grid( + row=ypos, column=3, sticky=W+E) ypos += 1