From owner-freebsd-current@FreeBSD.ORG Sun Dec 26 00:31:22 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D19F416A4CE for ; Sun, 26 Dec 2004 00:31:22 +0000 (GMT) Received: from mail.chesapeake.net (chesapeake.net [208.142.252.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 333F243D45 for ; Sun, 26 Dec 2004 00:31:22 +0000 (GMT) (envelope-from jroberson@chesapeake.net) Received: from mail.chesapeake.net (localhost [127.0.0.1]) by mail.chesapeake.net (8.12.10/8.12.10) with ESMTP id iBQ0VLOx015371 for ; Sat, 25 Dec 2004 19:31:21 -0500 (EST) (envelope-from jroberson@chesapeake.net) Received: from localhost (jroberson@localhost)iBQ0VKr1015349 for ; Sat, 25 Dec 2004 19:31:20 -0500 (EST) (envelope-from jroberson@chesapeake.net) X-Authentication-Warning: mail.chesapeake.net: jroberson owned process doing -bs Date: Sat, 25 Dec 2004 19:31:19 -0500 (EST) From: Jeff Roberson To: current@freebsd.org Message-ID: <20041225191637.K60504@mail.chesapeake.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: schedgraph.py X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Dec 2004 00:31:23 -0000 I took a break from working on VFS to implement a tool that will help me further refine the ULE scheduler. This may also be interesting in understanding application behavior under load, analyzing lock contention and preemption in the kernel, etc. To use the tool, you will need to define KTR_SCHED in KTR_COMPILE and KTR_MASK. I'd also bump entires up to 32768 or larger so you can grab a few seconds of data. Run your workload, and then capture the data with 'ktrdump -ct > ktr.out'. Then you simply run python schedgraph.py ktr.out. This requires a recent version of python and ports/x11-toolkits/py-tkinter. Here's a screenshot from a recent run: http://www.chesapeake.net/~jroberson/schedgraph.jpg I also have some sample data at http://www.chesapeake.net/~jroberson/smp.out.gz if you want to play with the tool without capturing data. The configuration page acts as a legend so you can understand the colors. The least obvious feature of the display is that the background color changes according to the cpu that the thread is executing on. In the screenshot I posted, light grey is cpu 0 and dark grey is cpu 1. You can also click on any event for greater detail. For events that exist on two threads, you may click on the corrisponding thread's name in the event popup to change to that event. Feedback welcome, patches for new features are even more welcome. Cheers, Jeff ---------- Forwarded message ---------- Date: Sun, 26 Dec 2004 00:13:07 +0000 (UTC) From: Jeff Roberson To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/tools/sched schedgraph.py jeff 2004-12-26 00:13:07 UTC FreeBSD src repository Added files: tools/sched schedgraph.py Log: - Add 'schedgraph' a scheduler trace visualization tool written with python and tkinter. Schedgraph takes input from files produces by ktrdump -ct when KTR_SCHED is compiled into the kernel. The output represents the states of each thread with colored line segments as well as colored points for non-state scheduler events. Each line segment and point is clickable to obtain extra detail. Revision Changes Path 1.1 +1209 -0 src/tools/sched/schedgraph.py (new)