public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* A systemtap example on fedora-devel-list
@ 2006-12-06 21:12 William Cohen
  0 siblings, 0 replies; only message in thread
From: William Cohen @ 2006-12-06 21:12 UTC (permalink / raw)
  To: systemtap

[-- Attachment #1: Type: text/plain, Size: 272 bytes --]

On a thread talking about identifying the cause of a performance problem with X 
Arjan mentioned a little script that he uses to see which processes end up 
returning from schedule in:

https://www.redhat.com/archives/fedora-devel-list/2006-December/msg00154.html


-Will

[-- Attachment #2: cstop.stp --]
[-- Type: text/plain, Size: 563 bytes --]

#!/usr/bin/env stap 
#
# This script continuously lists the top context switchers 
#

global processes

function print_top () {
	cnt=0
	log ("Process\t\t\t\tCount")
	printf("--------------------------------------\n")
	foreach ([name] in processes-) {
		printf("%-20s\t\t%5d\n",name, processes[name])
		if (cnt++ == 20)
			break
	}
	printf("--------------------------------------\n\n")
	delete processes
}

probe kernel.function("schedule").return {
	processes[execname()]++
}

# print top context switchers every 30 seconds
probe timer.ms(30000) {
	print_top ()
}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-12-06 19:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-06 21:12 A systemtap example on fedora-devel-list William Cohen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).