schedgraph.py

From: Jeff Roberson <jroberson_at_chesapeake.net>
Date: Sat, 25 Dec 2004 19:31:19 -0500 (EST)
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 <jeff_at_FreeBSD.org>
To: src-committers_at_FreeBSD.org, cvs-src_at_FreeBSD.org, cvs-all_at_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)
Received on Sat Dec 25 2004 - 23:31:22 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:25 UTC