10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 53490Seschrock * Common Development and Distribution License (the "License"). 63490Seschrock * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate /* 22*9578SSam.Cramer@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 230Sstevel@tonic-gate * Use is subject to license terms. 240Sstevel@tonic-gate */ 250Sstevel@tonic-gate 260Sstevel@tonic-gate #ifndef _SYS_SDT_H 270Sstevel@tonic-gate #define _SYS_SDT_H 280Sstevel@tonic-gate 290Sstevel@tonic-gate #ifdef __cplusplus 300Sstevel@tonic-gate extern "C" { 310Sstevel@tonic-gate #endif 320Sstevel@tonic-gate 330Sstevel@tonic-gate #ifndef _KERNEL 340Sstevel@tonic-gate 350Sstevel@tonic-gate #define DTRACE_PROBE(provider, name) { \ 360Sstevel@tonic-gate extern void __dtrace_##provider##___##name(void); \ 370Sstevel@tonic-gate __dtrace_##provider##___##name(); \ 380Sstevel@tonic-gate } 390Sstevel@tonic-gate 400Sstevel@tonic-gate #define DTRACE_PROBE1(provider, name, arg1) { \ 410Sstevel@tonic-gate extern void __dtrace_##provider##___##name(unsigned long); \ 420Sstevel@tonic-gate __dtrace_##provider##___##name((unsigned long)arg1); \ 430Sstevel@tonic-gate } 440Sstevel@tonic-gate 450Sstevel@tonic-gate #define DTRACE_PROBE2(provider, name, arg1, arg2) { \ 460Sstevel@tonic-gate extern void __dtrace_##provider##___##name(unsigned long, \ 470Sstevel@tonic-gate unsigned long); \ 480Sstevel@tonic-gate __dtrace_##provider##___##name((unsigned long)arg1, \ 490Sstevel@tonic-gate (unsigned long)arg2); \ 500Sstevel@tonic-gate } 510Sstevel@tonic-gate 520Sstevel@tonic-gate #define DTRACE_PROBE3(provider, name, arg1, arg2, arg3) { \ 530Sstevel@tonic-gate extern void __dtrace_##provider##___##name(unsigned long, \ 540Sstevel@tonic-gate unsigned long, unsigned long); \ 550Sstevel@tonic-gate __dtrace_##provider##___##name((unsigned long)arg1, \ 560Sstevel@tonic-gate (unsigned long)arg2, (unsigned long)arg3); \ 570Sstevel@tonic-gate } 580Sstevel@tonic-gate 590Sstevel@tonic-gate #define DTRACE_PROBE4(provider, name, arg1, arg2, arg3, arg4) { \ 600Sstevel@tonic-gate extern void __dtrace_##provider##___##name(unsigned long, \ 610Sstevel@tonic-gate unsigned long, unsigned long, unsigned long); \ 620Sstevel@tonic-gate __dtrace_##provider##___##name((unsigned long)arg1, \ 630Sstevel@tonic-gate (unsigned long)arg2, (unsigned long)arg3, \ 640Sstevel@tonic-gate (unsigned long)arg4); \ 650Sstevel@tonic-gate } 660Sstevel@tonic-gate 670Sstevel@tonic-gate #define DTRACE_PROBE5(provider, name, arg1, arg2, arg3, arg4, arg5) { \ 680Sstevel@tonic-gate extern void __dtrace_##provider##___##name(unsigned long, \ 690Sstevel@tonic-gate unsigned long, unsigned long, unsigned long, unsigned long);\ 700Sstevel@tonic-gate __dtrace_##provider##___##name((unsigned long)arg1, \ 710Sstevel@tonic-gate (unsigned long)arg2, (unsigned long)arg3, \ 720Sstevel@tonic-gate (unsigned long)arg4, (unsigned long)arg5); \ 730Sstevel@tonic-gate } 740Sstevel@tonic-gate 750Sstevel@tonic-gate #else /* _KERNEL */ 760Sstevel@tonic-gate 770Sstevel@tonic-gate #define DTRACE_PROBE(name) { \ 780Sstevel@tonic-gate extern void __dtrace_probe_##name(void); \ 790Sstevel@tonic-gate __dtrace_probe_##name(); \ 800Sstevel@tonic-gate } 810Sstevel@tonic-gate 820Sstevel@tonic-gate #define DTRACE_PROBE1(name, type1, arg1) { \ 830Sstevel@tonic-gate extern void __dtrace_probe_##name(uintptr_t); \ 840Sstevel@tonic-gate __dtrace_probe_##name((uintptr_t)(arg1)); \ 850Sstevel@tonic-gate } 860Sstevel@tonic-gate 870Sstevel@tonic-gate #define DTRACE_PROBE2(name, type1, arg1, type2, arg2) { \ 880Sstevel@tonic-gate extern void __dtrace_probe_##name(uintptr_t, uintptr_t); \ 890Sstevel@tonic-gate __dtrace_probe_##name((uintptr_t)(arg1), (uintptr_t)(arg2)); \ 900Sstevel@tonic-gate } 910Sstevel@tonic-gate 920Sstevel@tonic-gate #define DTRACE_PROBE3(name, type1, arg1, type2, arg2, type3, arg3) { \ 930Sstevel@tonic-gate extern void __dtrace_probe_##name(uintptr_t, uintptr_t, uintptr_t); \ 940Sstevel@tonic-gate __dtrace_probe_##name((uintptr_t)(arg1), (uintptr_t)(arg2), \ 950Sstevel@tonic-gate (uintptr_t)(arg3)); \ 960Sstevel@tonic-gate } 970Sstevel@tonic-gate 980Sstevel@tonic-gate #define DTRACE_PROBE4(name, type1, arg1, type2, arg2, \ 990Sstevel@tonic-gate type3, arg3, type4, arg4) { \ 1000Sstevel@tonic-gate extern void __dtrace_probe_##name(uintptr_t, uintptr_t, \ 1010Sstevel@tonic-gate uintptr_t, uintptr_t); \ 1020Sstevel@tonic-gate __dtrace_probe_##name((uintptr_t)(arg1), (uintptr_t)(arg2), \ 1030Sstevel@tonic-gate (uintptr_t)(arg3), (uintptr_t)(arg4)); \ 1040Sstevel@tonic-gate } 1050Sstevel@tonic-gate 1066878Sbrendan #define DTRACE_PROBE5(name, type1, arg1, type2, arg2, \ 1076878Sbrendan type3, arg3, type4, arg4, type5, arg5) { \ 1086878Sbrendan extern void __dtrace_probe_##name(uintptr_t, uintptr_t, \ 1096878Sbrendan uintptr_t, uintptr_t, uintptr_t); \ 1106878Sbrendan __dtrace_probe_##name((uintptr_t)(arg1), (uintptr_t)(arg2), \ 1116878Sbrendan (uintptr_t)(arg3), (uintptr_t)(arg4), (uintptr_t)(arg5)); \ 1126878Sbrendan } 1136878Sbrendan 1146878Sbrendan #define DTRACE_PROBE6(name, type1, arg1, type2, arg2, \ 1156878Sbrendan type3, arg3, type4, arg4, type5, arg5, type6, arg6) { \ 1166878Sbrendan extern void __dtrace_probe_##name(uintptr_t, uintptr_t, \ 1176878Sbrendan uintptr_t, uintptr_t, uintptr_t, uintptr_t); \ 1186878Sbrendan __dtrace_probe_##name((uintptr_t)(arg1), (uintptr_t)(arg2), \ 1196878Sbrendan (uintptr_t)(arg3), (uintptr_t)(arg4), (uintptr_t)(arg5), \ 1206878Sbrendan (uintptr_t)(arg6)); \ 1216878Sbrendan } 1226878Sbrendan 1236878Sbrendan #define DTRACE_PROBE7(name, type1, arg1, type2, arg2, type3, arg3, \ 1246878Sbrendan type4, arg4, type5, arg5, type6, arg6, type7, arg7) { \ 1256878Sbrendan extern void __dtrace_probe_##name(uintptr_t, uintptr_t, \ 1266878Sbrendan uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); \ 1276878Sbrendan __dtrace_probe_##name((uintptr_t)(arg1), (uintptr_t)(arg2), \ 1286878Sbrendan (uintptr_t)(arg3), (uintptr_t)(arg4), (uintptr_t)(arg5), \ 1296878Sbrendan (uintptr_t)(arg6), (uintptr_t)(arg7)); \ 1306878Sbrendan } 1316878Sbrendan 1320Sstevel@tonic-gate #define DTRACE_SCHED(name) \ 1330Sstevel@tonic-gate DTRACE_PROBE(__sched_##name); 1340Sstevel@tonic-gate 1350Sstevel@tonic-gate #define DTRACE_SCHED1(name, type1, arg1) \ 1360Sstevel@tonic-gate DTRACE_PROBE1(__sched_##name, type1, arg1); 1370Sstevel@tonic-gate 1380Sstevel@tonic-gate #define DTRACE_SCHED2(name, type1, arg1, type2, arg2) \ 1390Sstevel@tonic-gate DTRACE_PROBE2(__sched_##name, type1, arg1, type2, arg2); 1400Sstevel@tonic-gate 1410Sstevel@tonic-gate #define DTRACE_SCHED3(name, type1, arg1, type2, arg2, type3, arg3) \ 1420Sstevel@tonic-gate DTRACE_PROBE3(__sched_##name, type1, arg1, type2, arg2, type3, arg3); 1430Sstevel@tonic-gate 1440Sstevel@tonic-gate #define DTRACE_SCHED4(name, type1, arg1, type2, arg2, \ 1450Sstevel@tonic-gate type3, arg3, type4, arg4) \ 1460Sstevel@tonic-gate DTRACE_PROBE4(__sched_##name, type1, arg1, type2, arg2, \ 1470Sstevel@tonic-gate type3, arg3, type4, arg4); 1480Sstevel@tonic-gate 1490Sstevel@tonic-gate #define DTRACE_PROC(name) \ 1500Sstevel@tonic-gate DTRACE_PROBE(__proc_##name); 1510Sstevel@tonic-gate 1520Sstevel@tonic-gate #define DTRACE_PROC1(name, type1, arg1) \ 1530Sstevel@tonic-gate DTRACE_PROBE1(__proc_##name, type1, arg1); 1540Sstevel@tonic-gate 1550Sstevel@tonic-gate #define DTRACE_PROC2(name, type1, arg1, type2, arg2) \ 1560Sstevel@tonic-gate DTRACE_PROBE2(__proc_##name, type1, arg1, type2, arg2); 1570Sstevel@tonic-gate 1580Sstevel@tonic-gate #define DTRACE_PROC3(name, type1, arg1, type2, arg2, type3, arg3) \ 1590Sstevel@tonic-gate DTRACE_PROBE3(__proc_##name, type1, arg1, type2, arg2, type3, arg3); 1600Sstevel@tonic-gate 1610Sstevel@tonic-gate #define DTRACE_PROC4(name, type1, arg1, type2, arg2, \ 1620Sstevel@tonic-gate type3, arg3, type4, arg4) \ 1630Sstevel@tonic-gate DTRACE_PROBE4(__proc_##name, type1, arg1, type2, arg2, \ 1640Sstevel@tonic-gate type3, arg3, type4, arg4); 1650Sstevel@tonic-gate 1660Sstevel@tonic-gate #define DTRACE_IO(name) \ 1670Sstevel@tonic-gate DTRACE_PROBE(__io_##name); 1680Sstevel@tonic-gate 1690Sstevel@tonic-gate #define DTRACE_IO1(name, type1, arg1) \ 1700Sstevel@tonic-gate DTRACE_PROBE1(__io_##name, type1, arg1); 1710Sstevel@tonic-gate 1720Sstevel@tonic-gate #define DTRACE_IO2(name, type1, arg1, type2, arg2) \ 1730Sstevel@tonic-gate DTRACE_PROBE2(__io_##name, type1, arg1, type2, arg2); 1740Sstevel@tonic-gate 1750Sstevel@tonic-gate #define DTRACE_IO3(name, type1, arg1, type2, arg2, type3, arg3) \ 1760Sstevel@tonic-gate DTRACE_PROBE3(__io_##name, type1, arg1, type2, arg2, type3, arg3); 1770Sstevel@tonic-gate 1780Sstevel@tonic-gate #define DTRACE_IO4(name, type1, arg1, type2, arg2, \ 1790Sstevel@tonic-gate type3, arg3, type4, arg4) \ 1800Sstevel@tonic-gate DTRACE_PROBE4(__io_##name, type1, arg1, type2, arg2, \ 1810Sstevel@tonic-gate type3, arg3, type4, arg4); 1820Sstevel@tonic-gate 1835982Sahl #define DTRACE_NFSV3_3(name, type1, arg1, type2, arg2, \ 1845982Sahl type3, arg3) \ 1855982Sahl DTRACE_PROBE3(__nfsv3_##name, type1, arg1, type2, arg2, \ 1865982Sahl type3, arg3); 1875982Sahl #define DTRACE_NFSV3_4(name, type1, arg1, type2, arg2, \ 1885982Sahl type3, arg3, type4, arg4) \ 1895982Sahl DTRACE_PROBE4(__nfsv3_##name, type1, arg1, type2, arg2, \ 1905982Sahl type3, arg3, type4, arg4); 1915982Sahl 1925647Ssamf #define DTRACE_NFSV4_1(name, type1, arg1) \ 1935647Ssamf DTRACE_PROBE1(__nfsv4_##name, type1, arg1); 1945647Ssamf 1955647Ssamf #define DTRACE_NFSV4_2(name, type1, arg1, type2, arg2) \ 1965647Ssamf DTRACE_PROBE2(__nfsv4_##name, type1, arg1, type2, arg2); 1975647Ssamf 1985647Ssamf #define DTRACE_NFSV4_3(name, type1, arg1, type2, arg2, type3, arg3) \ 1995647Ssamf DTRACE_PROBE3(__nfsv4_##name, type1, arg1, type2, arg2, type3, arg3); 2005647Ssamf 2016139Sjb150015 #define DTRACE_SMB_1(name, type1, arg1) \ 2026139Sjb150015 DTRACE_PROBE1(__smb_##name, type1, arg1); 2036139Sjb150015 2046139Sjb150015 #define DTRACE_SMB_2(name, type1, arg1, type2, arg2) \ 2056139Sjb150015 DTRACE_PROBE2(__smb_##name, type1, arg1, type2, arg2); 2066139Sjb150015 2076878Sbrendan #define DTRACE_IP(name) \ 2086878Sbrendan DTRACE_PROBE(__ip_##name); 2096878Sbrendan 2106878Sbrendan #define DTRACE_IP1(name, type1, arg1) \ 2116878Sbrendan DTRACE_PROBE1(__ip_##name, type1, arg1); 2126878Sbrendan 2136878Sbrendan #define DTRACE_IP2(name, type1, arg1, type2, arg2) \ 2146878Sbrendan DTRACE_PROBE2(__ip_##name, type1, arg1, type2, arg2); 2156878Sbrendan 2166878Sbrendan #define DTRACE_IP3(name, type1, arg1, type2, arg2, type3, arg3) \ 2176878Sbrendan DTRACE_PROBE3(__ip_##name, type1, arg1, type2, arg2, type3, arg3); 2186878Sbrendan 2196878Sbrendan #define DTRACE_IP4(name, type1, arg1, type2, arg2, \ 2206878Sbrendan type3, arg3, type4, arg4) \ 2216878Sbrendan DTRACE_PROBE4(__ip_##name, type1, arg1, type2, arg2, \ 2226878Sbrendan type3, arg3, type4, arg4); 2236878Sbrendan 2246878Sbrendan #define DTRACE_IP5(name, type1, arg1, type2, arg2, \ 2256878Sbrendan type3, arg3, type4, arg4, type5, arg5) \ 2266878Sbrendan DTRACE_PROBE5(__ip_##name, type1, arg1, type2, arg2, \ 2276878Sbrendan type3, arg3, type4, arg4, type5, arg5); 2286878Sbrendan 2296878Sbrendan #define DTRACE_IP6(name, type1, arg1, type2, arg2, \ 2306878Sbrendan type3, arg3, type4, arg4, type5, arg5, type6, arg6) \ 2316878Sbrendan DTRACE_PROBE6(__ip_##name, type1, arg1, type2, arg2, \ 2326878Sbrendan type3, arg3, type4, arg4, type5, arg5, type6, arg6); 2336878Sbrendan 2346878Sbrendan #define DTRACE_IP7(name, type1, arg1, type2, arg2, type3, arg3, \ 2356878Sbrendan type4, arg4, type5, arg5, type6, arg6, type7, arg7) \ 2366878Sbrendan DTRACE_PROBE7(__ip_##name, type1, arg1, type2, arg2, \ 2376878Sbrendan type3, arg3, type4, arg4, type5, arg5, type6, arg6, \ 2386878Sbrendan type7, arg7); 2396878Sbrendan 2403490Seschrock #define DTRACE_SYSEVENT2(name, type1, arg1, type2, arg2) \ 2413490Seschrock DTRACE_PROBE2(__sysevent_##name, type1, arg1, type2, arg2); 2423490Seschrock 2435084Sjohnlev #define DTRACE_XPV(name) \ 2445084Sjohnlev DTRACE_PROBE(__xpv_##name); 2455084Sjohnlev 2465084Sjohnlev #define DTRACE_XPV1(name, type1, arg1) \ 2475084Sjohnlev DTRACE_PROBE1(__xpv_##name, type1, arg1); 2485084Sjohnlev 2495084Sjohnlev #define DTRACE_XPV2(name, type1, arg1, type2, arg2) \ 2505084Sjohnlev DTRACE_PROBE2(__xpv_##name, type1, arg1, type2, arg2); 2515084Sjohnlev 2525084Sjohnlev #define DTRACE_XPV3(name, type1, arg1, type2, arg2, type3, arg3) \ 2535084Sjohnlev DTRACE_PROBE3(__xpv_##name, type1, arg1, type2, arg2, type3, arg3); 2545084Sjohnlev 2555084Sjohnlev #define DTRACE_XPV4(name, type1, arg1, type2, arg2, type3, arg3, \ 2565084Sjohnlev type4, arg4) \ 2575084Sjohnlev DTRACE_PROBE4(__xpv_##name, type1, arg1, type2, arg2, \ 2585084Sjohnlev type3, arg3, type4, arg4); 2595084Sjohnlev 260*9578SSam.Cramer@Sun.COM #define DTRACE_FC_1(name, type1, arg1) \ 261*9578SSam.Cramer@Sun.COM DTRACE_PROBE1(__fc_##name, type1, arg1); 262*9578SSam.Cramer@Sun.COM 263*9578SSam.Cramer@Sun.COM #define DTRACE_FC_2(name, type1, arg1, type2, arg2) \ 264*9578SSam.Cramer@Sun.COM DTRACE_PROBE2(__fc_##name, type1, arg1, type2, arg2); 265*9578SSam.Cramer@Sun.COM 266*9578SSam.Cramer@Sun.COM #define DTRACE_FC_3(name, type1, arg1, type2, arg2, type3, arg3) \ 267*9578SSam.Cramer@Sun.COM DTRACE_PROBE3(__fc_##name, type1, arg1, type2, arg2, type3, arg3); 268*9578SSam.Cramer@Sun.COM 269*9578SSam.Cramer@Sun.COM #define DTRACE_FC_4(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4) \ 270*9578SSam.Cramer@Sun.COM DTRACE_PROBE4(__fc_##name, type1, arg1, type2, arg2, type3, arg3, \ 271*9578SSam.Cramer@Sun.COM type4, arg4); 272*9578SSam.Cramer@Sun.COM 273*9578SSam.Cramer@Sun.COM #define DTRACE_FC_5(name, type1, arg1, type2, arg2, type3, arg3, \ 274*9578SSam.Cramer@Sun.COM type4, arg4, type5, arg5) \ 275*9578SSam.Cramer@Sun.COM DTRACE_PROBE5(__fc_##name, type1, arg1, type2, arg2, type3, arg3, \ 276*9578SSam.Cramer@Sun.COM type4, arg4, type5, arg5); 277*9578SSam.Cramer@Sun.COM 278*9578SSam.Cramer@Sun.COM 279*9578SSam.Cramer@Sun.COM 2800Sstevel@tonic-gate #endif /* _KERNEL */ 2810Sstevel@tonic-gate 2820Sstevel@tonic-gate extern const char *sdt_prefix; 2830Sstevel@tonic-gate 2840Sstevel@tonic-gate typedef struct sdt_probedesc { 2850Sstevel@tonic-gate char *sdpd_name; /* name of this probe */ 2860Sstevel@tonic-gate unsigned long sdpd_offset; /* offset of call in text */ 2870Sstevel@tonic-gate struct sdt_probedesc *sdpd_next; /* next static probe */ 2880Sstevel@tonic-gate } sdt_probedesc_t; 2890Sstevel@tonic-gate 2900Sstevel@tonic-gate #ifdef __cplusplus 2910Sstevel@tonic-gate } 2920Sstevel@tonic-gate #endif 2930Sstevel@tonic-gate 2940Sstevel@tonic-gate #endif /* _SYS_SDT_H */ 295