]>
git.proxmox.com Git - mirror_zfs-debian.git/blob - include/sys/sdt.h
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
32 #define ZFS_PROBE(a) ((void) 0)
33 #define ZFS_PROBE1(a, c) ((void) 0)
34 #define ZFS_PROBE2(a, c, e) ((void) 0)
35 #define ZFS_PROBE3(a, c, e, g) ((void) 0)
36 #define ZFS_PROBE4(a, c, e, g, i) ((void) 0)
37 #define ZFS_SET_ERROR(err) ((void) 0)
41 #if defined(HAVE_DECLARE_EVENT_CLASS)
43 #include <sys/trace.h>
46 * The set-error SDT probe is extra static, in that we declare its fake
47 * function literally, rather than with the DTRACE_PROBE1() macro. This is
48 * necessary so that SET_ERROR() can evaluate to a value, which wouldn't
49 * be possible if it required multiple statements (to declare the function
52 * SET_ERROR() uses the comma operator so that it can be used without much
53 * additional code. For example, "return (EINVAL);" becomes
54 * "return (SET_ERROR(EINVAL));". Note that the argument will be evaluated
55 * twice, so it should not have side effects (e.g. something like:
56 * "return (SET_ERROR(log_error(EINVAL, info)));" would log the error twice).
58 #define SET_ERROR(err) \
59 (trace_zfs_set__error(__FILE__, __func__, __LINE__, err), err)
64 #define SET_ERROR(err) (err)
66 #endif /* HAVE_DECLARE_EVENT_CLASS */
70 #endif /* _SYS_SDT_H */