linux_dtrace.h revision 289798
1235063Snetchild/*- 2235063Snetchild * Copyright (c) 2008-2012 Alexander Leidinger <netchild@FreeBSD.org> 3235063Snetchild * All rights reserved. 4235063Snetchild * 5235063Snetchild * Redistribution and use in source and binary forms, with or without 6235063Snetchild * modification, are permitted provided that the following conditions 7235063Snetchild * are met: 8235063Snetchild * 1. Redistributions of source code must retain the above copyright 9235063Snetchild * notice, this list of conditions and the following disclaimer 10235063Snetchild * in this position and unchanged. 11235063Snetchild * 2. Redistributions in binary form must reproduce the above copyright 12235063Snetchild * notice, this list of conditions and the following disclaimer in the 13235063Snetchild * documentation and/or other materials provided with the distribution. 14235063Snetchild * 15235063Snetchild * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16235063Snetchild * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17235063Snetchild * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18235063Snetchild * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19235063Snetchild * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20235063Snetchild * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21235063Snetchild * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22235063Snetchild * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23235063Snetchild * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24235063Snetchild * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25235063Snetchild * 26235063Snetchild * $FreeBSD: stable/10/sys/compat/linux/linux_dtrace.h 289798 2015-10-23 07:40:43Z avg $ 27235063Snetchild */ 28235063Snetchild 29235063Snetchild#ifndef _LINUX_DTRACE_H_ 30235063Snetchild#define _LINUX_DTRACE_H_ 31235063Snetchild 32235063Snetchild/** 33235063Snetchild * DTrace support macros for the linuxulator. 34235063Snetchild * 35235063Snetchild * Some wrapper macros to make it more easy to handle the linuxulator 36235063Snetchild * providers and to allow to make the name depend upon the bitsize. 37235063Snetchild * 38235063Snetchild * Basically this is the same as the normal SDT macros in sys/sdt.h. The 39235063Snetchild * difference is that the provider name is automatically inserted, and 40235063Snetchild * we do not use a different name for the probe-description. 41235063Snetchild */ 42235063Snetchild 43235063Snetchild#define LIN_SDT_PROVIDER_DEFINE(x) SDT_PROVIDER_DEFINE(x) 44235063Snetchild#define LIN_SDT_PROVIDER_DECLARE(x) SDT_PROVIDER_DECLARE(x) 45235063Snetchild 46235063Snetchild#define _LIN_SDT_PROBE_DECLARE(a, b, c, d) SDT_PROBE_DECLARE(a, b, c, d) 47235063Snetchild#define LIN_SDT_PROBE_DECLARE(a, b, c) _LIN_SDT_PROBE_DECLARE( \ 48235063Snetchild LINUX_DTRACE, a, b, c) 49235063Snetchild 50235063Snetchild#define _LIN_SDT_PROBE_DEFINE0(a, b, c, d) SDT_PROBE_DEFINE(a, \ 51260817Savg b, c, d) 52235063Snetchild#define LIN_SDT_PROBE_DEFINE0(a, b, c) _LIN_SDT_PROBE_DEFINE0(\ 53235063Snetchild LINUX_DTRACE, a, b, c) 54235063Snetchild#define _LIN_SDT_PROBE_DEFINE1(a, b, c, d, e) SDT_PROBE_DEFINE1(a, \ 55260817Savg b, c, d, e) 56235063Snetchild#define LIN_SDT_PROBE_DEFINE1(a, b, c, d) _LIN_SDT_PROBE_DEFINE1(\ 57235063Snetchild LINUX_DTRACE, a, b, c, d) 58235063Snetchild#define _LIN_SDT_PROBE_DEFINE2(a, b, c, d, e, f) SDT_PROBE_DEFINE2(a, \ 59260817Savg b, c, d, e, f) 60235063Snetchild#define LIN_SDT_PROBE_DEFINE2(a, b, c, d, e) _LIN_SDT_PROBE_DEFINE2(\ 61235063Snetchild LINUX_DTRACE, a, b, c, d, e) 62235063Snetchild#define _LIN_SDT_PROBE_DEFINE3(a, b, c, d, e, f, g) SDT_PROBE_DEFINE3(a, \ 63260817Savg b, c, d, e, f, g) 64235063Snetchild#define LIN_SDT_PROBE_DEFINE3(a, b, c, d, e, f) _LIN_SDT_PROBE_DEFINE3(\ 65235063Snetchild LINUX_DTRACE, a, b, c, d, e, f) 66235063Snetchild#define _LIN_SDT_PROBE_DEFINE4(a, b, c, d, e, f, g, h) SDT_PROBE_DEFINE4(a, \ 67260817Savg b, c, d, e, f, g, h) 68235063Snetchild#define LIN_SDT_PROBE_DEFINE4(a, b, c, d, e, f, g) _LIN_SDT_PROBE_DEFINE4(\ 69235063Snetchild LINUX_DTRACE, a, b, c, d, e, f, g) 70235063Snetchild#define _LIN_SDT_PROBE_DEFINE5(a, b, c, d, e, f, g, h, i) \ 71260817Savg SDT_PROBE_DEFINE5(a, b, c, d, e, f, g, h, i) 72235063Snetchild#define LIN_SDT_PROBE_DEFINE5(a, b, c, d, e, f, g, h) _LIN_SDT_PROBE_DEFINE5(\ 73235063Snetchild LINUX_DTRACE, a, b, c, d, e, f, g, h) 74235063Snetchild 75235063Snetchild#define LIN_SDT_PROBE0(a, b, c) SDT_PROBE1(LINUX_DTRACE, a, b, \ 76235063Snetchild c, 0) 77235063Snetchild#define LIN_SDT_PROBE1(a, b, c, d) SDT_PROBE1(LINUX_DTRACE, a, b, \ 78235063Snetchild c, d) 79235063Snetchild#define LIN_SDT_PROBE2(a, b, c, d, e) SDT_PROBE2(LINUX_DTRACE, a, b, \ 80235063Snetchild c, d, e) 81235063Snetchild#define LIN_SDT_PROBE3(a, b, c, d, e, f) SDT_PROBE3(LINUX_DTRACE, a, b, \ 82235063Snetchild c, d, e, f) 83235063Snetchild#define LIN_SDT_PROBE4(a, b, c, d, e, f, g) SDT_PROBE4(LINUX_DTRACE, a, b, \ 84235063Snetchild c, d, e, f, g) 85289798Savg#define _LIN_SDT_PROBE5(a, b, c, d, e, f, g, h, i) SDT_PROBE5(a, b, c, d, \ 86235063Snetchild e, f, g, h, i) 87235063Snetchild#define LIN_SDT_PROBE5(a, b, c, d, e, f, g, h) _LIN_SDT_PROBE5(LINUX_DTRACE, \ 88235063Snetchild a, b, c, d, e, f, g, h) 89235063Snetchild 90235063Snetchild#endif /* _LINUX_DTRACE_H_ */ 91