xref: /freebsd/sys/compat/linux/linux_dtrace.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
119e252baSAlexander Leidinger /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
37f2d13d6SPedro F. Giffuni  *
419e252baSAlexander Leidinger  * Copyright (c) 2008-2012 Alexander Leidinger <netchild@FreeBSD.org>
519e252baSAlexander Leidinger  * All rights reserved.
619e252baSAlexander Leidinger  *
719e252baSAlexander Leidinger  * Redistribution and use in source and binary forms, with or without
819e252baSAlexander Leidinger  * modification, are permitted provided that the following conditions
919e252baSAlexander Leidinger  * are met:
1019e252baSAlexander Leidinger  * 1. Redistributions of source code must retain the above copyright
1119e252baSAlexander Leidinger  *    notice, this list of conditions and the following disclaimer
1219e252baSAlexander Leidinger  *    in this position and unchanged.
1319e252baSAlexander Leidinger  * 2. Redistributions in binary form must reproduce the above copyright
1419e252baSAlexander Leidinger  *    notice, this list of conditions and the following disclaimer in the
1519e252baSAlexander Leidinger  *    documentation and/or other materials provided with the distribution.
1619e252baSAlexander Leidinger  *
1719e252baSAlexander Leidinger  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1819e252baSAlexander Leidinger  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1919e252baSAlexander Leidinger  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2019e252baSAlexander Leidinger  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2119e252baSAlexander Leidinger  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2219e252baSAlexander Leidinger  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2319e252baSAlexander Leidinger  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2419e252baSAlexander Leidinger  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2519e252baSAlexander Leidinger  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2619e252baSAlexander Leidinger  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2719e252baSAlexander Leidinger  */
2819e252baSAlexander Leidinger 
2919e252baSAlexander Leidinger #ifndef _LINUX_DTRACE_H_
3019e252baSAlexander Leidinger #define _LINUX_DTRACE_H_
3119e252baSAlexander Leidinger 
3219e252baSAlexander Leidinger /**
3319e252baSAlexander Leidinger  * DTrace support macros for the linuxulator.
3419e252baSAlexander Leidinger  *
3519e252baSAlexander Leidinger  * Some wrapper macros to make it more easy to handle the linuxulator
3619e252baSAlexander Leidinger  * providers and to allow to make the name depend upon the bitsize.
3719e252baSAlexander Leidinger  *
3819e252baSAlexander Leidinger  * Basically this is the same as the normal SDT macros in sys/sdt.h. The
3919e252baSAlexander Leidinger  * difference is that the provider name is automatically inserted, and
4019e252baSAlexander Leidinger  * we do not use a different name for the probe-description.
4119e252baSAlexander Leidinger  */
4219e252baSAlexander Leidinger 
4319e252baSAlexander Leidinger #define	LIN_SDT_PROVIDER_DEFINE(x)	SDT_PROVIDER_DEFINE(x)
4419e252baSAlexander Leidinger #define LIN_SDT_PROVIDER_DECLARE(x)	SDT_PROVIDER_DECLARE(x)
4519e252baSAlexander Leidinger 
4619e252baSAlexander Leidinger #define	_LIN_SDT_PROBE_DECLARE(a, b, c, d)	SDT_PROBE_DECLARE(a, b, c, d)
4719e252baSAlexander Leidinger #define	LIN_SDT_PROBE_DECLARE(a, b, c)		_LIN_SDT_PROBE_DECLARE( \
4819e252baSAlexander Leidinger     LINUX_DTRACE, a, b, c)
4919e252baSAlexander Leidinger 
5019e252baSAlexander Leidinger #define	_LIN_SDT_PROBE_DEFINE0(a, b, c, d)		SDT_PROBE_DEFINE(a, \
51d9fae5abSAndriy Gapon     b, c, d)
5219e252baSAlexander Leidinger #define	LIN_SDT_PROBE_DEFINE0(a, b, c)			_LIN_SDT_PROBE_DEFINE0(\
5319e252baSAlexander Leidinger     LINUX_DTRACE, a, b, c)
5419e252baSAlexander Leidinger #define	_LIN_SDT_PROBE_DEFINE1(a, b, c, d, e)		SDT_PROBE_DEFINE1(a, \
55d9fae5abSAndriy Gapon     b, c, d, e)
5619e252baSAlexander Leidinger #define	LIN_SDT_PROBE_DEFINE1(a, b, c, d)		_LIN_SDT_PROBE_DEFINE1(\
5719e252baSAlexander Leidinger     LINUX_DTRACE, a, b, c, d)
5819e252baSAlexander Leidinger #define	_LIN_SDT_PROBE_DEFINE2(a, b, c, d, e, f)	SDT_PROBE_DEFINE2(a, \
59d9fae5abSAndriy Gapon     b, c, d, e, f)
6019e252baSAlexander Leidinger #define	LIN_SDT_PROBE_DEFINE2(a, b, c, d, e)		_LIN_SDT_PROBE_DEFINE2(\
6119e252baSAlexander Leidinger     LINUX_DTRACE, a, b, c, d, e)
6219e252baSAlexander Leidinger #define	_LIN_SDT_PROBE_DEFINE3(a, b, c, d, e, f, g)	SDT_PROBE_DEFINE3(a, \
63d9fae5abSAndriy Gapon     b, c, d, e, f, g)
6419e252baSAlexander Leidinger #define	LIN_SDT_PROBE_DEFINE3(a, b, c, d, e, f)		_LIN_SDT_PROBE_DEFINE3(\
6519e252baSAlexander Leidinger     LINUX_DTRACE, a, b, c, d, e, f)
6619e252baSAlexander Leidinger #define	_LIN_SDT_PROBE_DEFINE4(a, b, c, d, e, f, g, h)	SDT_PROBE_DEFINE4(a, \
67d9fae5abSAndriy Gapon     b, c, d, e, f, g, h)
6819e252baSAlexander Leidinger #define	LIN_SDT_PROBE_DEFINE4(a, b, c, d, e, f, g)	_LIN_SDT_PROBE_DEFINE4(\
6919e252baSAlexander Leidinger     LINUX_DTRACE, a, b, c, d, e, f, g)
7019e252baSAlexander Leidinger #define	_LIN_SDT_PROBE_DEFINE5(a, b, c, d, e, f, g, h, i) \
71d9fae5abSAndriy Gapon     SDT_PROBE_DEFINE5(a, b, c, d, e, f, g, h, i)
7219e252baSAlexander Leidinger #define	LIN_SDT_PROBE_DEFINE5(a, b, c, d, e, f, g, h)	_LIN_SDT_PROBE_DEFINE5(\
7319e252baSAlexander Leidinger     LINUX_DTRACE, a, b, c, d, e, f, g, h)
7419e252baSAlexander Leidinger 
7536160958SMark Johnston #define	LIN_SDT_PROBE0(a, b, c)			SDT_PROBE0(LINUX_DTRACE, a, b, \
7636160958SMark Johnston     c)
7719e252baSAlexander Leidinger #define	LIN_SDT_PROBE1(a, b, c, d)		SDT_PROBE1(LINUX_DTRACE, a, b, \
7819e252baSAlexander Leidinger     c, d)
7919e252baSAlexander Leidinger #define	LIN_SDT_PROBE2(a, b, c, d, e)		SDT_PROBE2(LINUX_DTRACE, a, b, \
8019e252baSAlexander Leidinger     c, d, e)
8119e252baSAlexander Leidinger #define	LIN_SDT_PROBE3(a, b, c, d, e, f)	SDT_PROBE3(LINUX_DTRACE, a, b, \
8219e252baSAlexander Leidinger     c, d, e, f)
8319e252baSAlexander Leidinger #define	LIN_SDT_PROBE4(a, b, c, d, e, f, g)	SDT_PROBE4(LINUX_DTRACE, a, b, \
8419e252baSAlexander Leidinger     c, d, e, f, g)
852f2f522bSAndriy Gapon #define	_LIN_SDT_PROBE5(a, b, c, d, e, f, g, h, i)	SDT_PROBE5(a, b, c, d, \
8619e252baSAlexander Leidinger     e, f, g, h, i)
8719e252baSAlexander Leidinger #define	LIN_SDT_PROBE5(a, b, c, d, e, f, g, h)	_LIN_SDT_PROBE5(LINUX_DTRACE, \
8819e252baSAlexander Leidinger     a, b, c, d, e, f, g, h)
8919e252baSAlexander Leidinger 
9019e252baSAlexander Leidinger #endif /* _LINUX_DTRACE_H_ */
91