Schedtop utility

From RTwiki
Revision as of 21:05, 25 May 2016 by Federico Reghenzani (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search



scheduler statistics visualization tool

This utility will process various scheduler related statistics (e.g. /proc/schedstat) such that the "busiest" stats (greatest delta) will bubble up to the top similar to the ubiquitous "top" utility. It can alternately be sorted by the stat's value, or by name. Stats can be inclusively or exclusively filtered based on reg-ex pattern matching.

How to obtain

Building from source


  • ) development version of boost installed (often called "boost-dev" package).
  • ) g++ compiler

Obtain the source code

GIT Tree

   git clone (Browse github)



Local Build

 ghaskins@dev:~> cd sandbox/git/schedtop/
 ghaskins@dev:~/sandbox/git/schedtop> make
 Compiling (C++) to obj/x86_64/schedtop.o
 g++ -g -O0  -c -o obj/x86_64/schedtop.o
 Linking obj/x86_64/schedtop
 g++ -g -O0  -o obj/x86_64/schedtop obj/x86_64/schedtop.o  -lboost_regex -lboost_program_options -lboost_filesystem -lncurses
 ghaskins@dev:~/sandbox/git/schedtop> ls -la obj/x86_64/schedtop
 -rwxr-xr-x 1 ghaskins users 1183285 2008-10-22 06:51 obj/x86_64/schedtop


Generate a .src.rpm

 ghaskins@dev:~> cd sandbox/git/schedtop/
 ghaskins@dev:~/sandbox/git/schedtop> make srcrpm
 tar -c --exclude=.git --exclude=*.spec --exclude=*~ --exclude=obj * | (cd obj/x86_64/schedtop-0.5; tar xf -)
 (cd obj/x86_64; tar cvz schedtop-0.5) > obj/x86_64/schedtop-0.5.tar.gz
 rpmbuild -ts obj/x86_64/schedtop-0.5.tar.gz
 Wrote: /usr/src/packages/SRPMS/schedtop-0.5-1.src.rpm

Generate a binary .rpm using the .src.rpm output from the previous example

 ghaskins@dev:~/sandbox/git/schedtop> rpmbuild --rebuild /usr/src/packages/SRPMS/schedtop-0.5-1.src.rpm
 Installing /usr/src/packages/SRPMS/schedtop-0.5-1.src.rpm
 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.39808
 + umask 022
 + cd /usr/src/packages/BUILD
 + cd /usr/src/packages/BUILD
 + rm -rf schedtop-0.5
 + /usr/bin/gzip -dc /usr/src/packages/SOURCES/schedtop-0.5.tar.gz
 Wrote: /usr/src/packages/RPMS/x86_64/schedtop-0.5-1.x86_64.rpm
 Wrote: /usr/src/packages/RPMS/x86_64/schedtop-debuginfo-0.5-1.x86_64.rpm
 Wrote: /usr/src/packages/RPMS/x86_64/schedtop-debugsource-0.5-1.x86_64.rpm
 Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.26872
 + umask 022
 + cd /usr/src/packages/BUILD
 + cd schedtop-0.5
 + make clean
 + exit 0
 Executing(--clean): /bin/sh -e /var/tmp/rpm-tmp.26872
 + umask 022
 + cd /usr/src/packages/BUILD
 + rm -rf schedtop-0.5
 + exit 0

Prebuilt RPMs

A variety of pre-built x86 platforms can be found available as RPMs in YUM repositories created by the OpenSUSE Build Service:

You can download the .rpm directly, or alternatively add the repository to your system to receive updates when new versions of schedtop are released automatically.

Direct links to a subset of the available repos:

OpenSUSE 11 x86_64 i586
OpenSUSE 10.3 x86_64 i586
SUSE Linux Enterprise 10 x86_64 i586
RHEL 5 x86_64 i586
Fedora 9 x86_64 i586
Mandriva-2008 x86_64 i586

How to use


  • ) A relatively modern kernel that supports v14 of the SCHEDSTATS
  • ) Enable CONFIG_SCHEDSTATS=y in your kernel .config.


schedtop <options>

 -h [ --help    ]         produces help message
 -p [ --period  ] arg     refresh period (default=1s)
 -i [ --include ] arg     reg-ex inclusive filter (default=".*")
 -x [ --exclude ] arg     reg-ex exclusive filter (default="^$")
 -s [ --sort    ] arg     sort-by: n=name, v=value, d=delta (default='d')

Press Cntrl-C to exit the utility


To filter out any stats with "sched_info" or "imbalance" in the name, use the exclude filter with an OR operator

schedtop -x 'sched_info|imbalance'

Reporting Problems/Fixes

Send all problems and/or patches to Greg Haskins <>

Personal tools