From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3962 invoked by alias); 6 Dec 2006 19:51:47 -0000 Received: (qmail 3859 invoked by uid 22791); 6 Dec 2006 19:51:45 -0000 X-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 06 Dec 2006 19:51:40 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id kB6Jpca2021770 for ; Wed, 6 Dec 2006 14:51:38 -0500 Received: from lacrosse.corp.redhat.com (lacrosse.corp.redhat.com [172.16.52.154]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id kB6JpcwH020692 for ; Wed, 6 Dec 2006 14:51:38 -0500 Received: from [10.11.231.118] (dhcp231-118.rdu.redhat.com [10.11.231.118]) by lacrosse.corp.redhat.com (8.12.11.20060308/8.11.6) with ESMTP id kB6JpbBY031049 for ; Wed, 6 Dec 2006 14:51:37 -0500 Message-ID: <45771F49.1060000@redhat.com> Date: Wed, 06 Dec 2006 21:12:00 -0000 From: William Cohen User-Agent: Mozilla Thunderbird 1.0.8-1.1.fc4 (X11/20060501) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "systemtap@sourceware.org" Subject: A systemtap example on fedora-devel-list Content-Type: multipart/mixed; boundary="------------080705080504000002070005" X-Virus-Checked: Checked by ClamAV on sourceware.org X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2006-q4/txt/msg00615.txt.bz2 This is a multi-part message in MIME format. --------------080705080504000002070005 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 272 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 --------------080705080504000002070005 Content-Type: text/plain; name="cstop.stp" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="cstop.stp" Content-length: 563 #!/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 () } --------------080705080504000002070005--