From: Frank Ch. Eigler Date: Mon, 16 Feb 2015 22:54:14 +0000 (-0500) Subject: sample interrupts-by-dev: unbreak accidental .txt/.stp overwrite X-Git-Tag: release-2.7~8 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=824a9f0e14a2e9380cd7950f045a04a48daa1481;p=systemtap.git sample interrupts-by-dev: unbreak accidental .txt/.stp overwrite --- diff --git a/testsuite/systemtap.examples/index.html b/testsuite/systemtap.examples/index.html index e80cc6cfc..d24f12885 100644 --- a/testsuite/systemtap.examples/index.html +++ b/testsuite/systemtap.examples/index.html @@ -115,7 +115,7 @@ keywords: WATCHDOG interrupt/interrupts-by-dev.stp - Record Interrupts on a Per-Device Basis
keywords: INTERRUPT
-

The interrupts-by-dev.stp script profiles interrupts received by each device per 100 ms.

# stap interrupts-by-dev.stp -c "sleep 1"

+

The interrupts-by-dev.stp script profiles interrupts received by each device per 100 ms.

sample usage in interrupt/interrupts-by-dev.txt

  • interrupt/scf.stp - Tally Backtraces for Inter-Processor Interrupt
    keywords: INTERRUPT BACKTRACE

    The Linux kernel function smp_call_function causes expensive inter-processor interrupts (IPIs). The scf.stp script tallies the processes and backtraces causing the interprocessor interrupts to identify the cause of the expensive IPI. On exit the script prints the tallies in descending frequency.

    # stap scf.stp -c "sleep 1"

    diff --git a/testsuite/systemtap.examples/interrupt/interrupts-by-dev.stp b/testsuite/systemtap.examples/interrupt/interrupts-by-dev.stp old mode 100755 new mode 100644 index 8d607b732..561295c27 --- a/testsuite/systemtap.examples/interrupt/interrupts-by-dev.stp +++ b/testsuite/systemtap.examples/interrupt/interrupts-by-dev.stp @@ -1,17 +1,34 @@ -This script reports every 100ms, so we limit it to 10 reports. +#! /usr/bin/env stap +/* + * Copyright (C) 2009 IBM Corp. + * This file is part of systemtap, and is free software. You can + * redistribute it and/or modify it under the terms of the GNU General + * Public License (GPL); either version 2, or (at your option) any + * later version. + * + * Version 1.0 prerna@linux.vnet.ibm.com 2009-10-28 + * + * Name: + * interrupts-by-dev.stp + * + * Description: + * Script to profile interrupts received by each device per 100 ms. + * + * + */ -# stap interrupts-by-dev.stp -c 'sleep 1' +global devices - DEVICE NUMBER OF INTERRUPTS - p2p1 : 4 - p2p1 : 5 - p2p1 : 12 - p2p1 : 8 - p2p1 : 5 - p2p1 : 6 - p2p1 : 4 - xhci_hcd : 20 - p2p1 : 5 - p2p1 : 6 - p2p1 : 4 - nvidia : 1 +probe begin { + printf("\t DEVICE \t NUMBER OF INTERRUPTS \n"); +} + +probe irq_handler.entry { + devices[dev_name]++; +} + +probe timer.ms(100) { + foreach ( devname in devices ) + printf(" %20s : %5d\n",kernel_string(devname),devices[devname]); + delete devices +} diff --git a/testsuite/systemtap.examples/interrupt/interrupts-by-dev.txt b/testsuite/systemtap.examples/interrupt/interrupts-by-dev.txt new file mode 100755 index 000000000..8d607b732 --- /dev/null +++ b/testsuite/systemtap.examples/interrupt/interrupts-by-dev.txt @@ -0,0 +1,17 @@ +This script reports every 100ms, so we limit it to 10 reports. + +# stap interrupts-by-dev.stp -c 'sleep 1' + + DEVICE NUMBER OF INTERRUPTS + p2p1 : 4 + p2p1 : 5 + p2p1 : 12 + p2p1 : 8 + p2p1 : 5 + p2p1 : 6 + p2p1 : 4 + xhci_hcd : 20 + p2p1 : 5 + p2p1 : 6 + p2p1 : 4 + nvidia : 1 diff --git a/testsuite/systemtap.examples/keyword-index.html b/testsuite/systemtap.examples/keyword-index.html index d8b7d928f..1602e34aa 100644 --- a/testsuite/systemtap.examples/keyword-index.html +++ b/testsuite/systemtap.examples/keyword-index.html @@ -259,7 +259,7 @@ keywords: THREAD interrupt/interrupts-by-dev.stp - Record Interrupts on a Per-Device Basis
    keywords: INTERRUPT
    -

    The interrupts-by-dev.stp script profiles interrupts received by each device per 100 ms.

    # stap interrupts-by-dev.stp -c "sleep 1"

    +

    The interrupts-by-dev.stp script profiles interrupts received by each device per 100 ms.

    sample usage in interrupt/interrupts-by-dev.txt

  • interrupt/scf.stp - Tally Backtraces for Inter-Processor Interrupt
    keywords: INTERRUPT BACKTRACE

    The Linux kernel function smp_call_function causes expensive inter-processor interrupts (IPIs). The scf.stp script tallies the processes and backtraces causing the interprocessor interrupts to identify the cause of the expensive IPI. On exit the script prints the tallies in descending frequency.

    # stap scf.stp -c "sleep 1"