1#!/usr/sbin/dtrace -s 2/* 3 * intbycpu.d - interrupts by CPU. 4 * Written using DTrace (Solaris 10 3/05). 5 * 6 * 20-Apr-2006, ver 1.01 7 * 8 * USAGE: intbycpu.d # hit Ctrl-C to end sample 9 * 10 * FIELDS: 11 * CPU CPU number 12 * INTERRUPTS number of interrupts in sample 13 * 14 * This is based on a DTrace OneLiner from the DTraceToolkit. 15 * 16 * COPYRIGHT: Copyright (c) 2005, 2006 Brendan Gregg. 17 * 18 * CDDL HEADER START 19 * 20 * The contents of this file are subject to the terms of the 21 * Common Development and Distribution License, Version 1.0 only 22 * (the "License"). You may not use this file except in compliance 23 * with the License. 24 * 25 * You can obtain a copy of the license at Docs/cddl1.txt 26 * or http://www.opensolaris.org/os/licensing. 27 * See the License for the specific language governing permissions 28 * and limitations under the License. 29 * 30 * CDDL HEADER END 31 * 32 * 15-May-2005 Brendan Gregg Created this. 33 */ 34 35#pragma D option quiet 36 37dtrace:::BEGIN 38{ 39 printf("Tracing... Hit Ctrl-C to end.\n"); 40} 41 42sdt:::interrupt-start { @num[cpu] = count(); } 43 44dtrace:::END 45{ 46 printf("%-16s %16s\n", "CPU", "INTERRUPTS"); 47 printa("%-16d %@16d\n", @num); 48} 49