]> git.proxmox.com Git - mirror_zfs-debian.git/blame - include/sys/trace_zrlock.h
New upstream version 0.7.2
[mirror_zfs-debian.git] / include / sys / trace_zrlock.h
CommitLineData
ea04106b
AX
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22#if defined(_KERNEL) && defined(HAVE_DECLARE_EVENT_CLASS)
23
24#undef TRACE_SYSTEM
25#define TRACE_SYSTEM zfs
26
e10b0808
AX
27#undef TRACE_SYSTEM_VAR
28#define TRACE_SYSTEM_VAR zfs_zrlock
29
ea04106b
AX
30#if !defined(_TRACE_ZRLOCK_H) || defined(TRACE_HEADER_MULTI_READ)
31#define _TRACE_ZRLOCK_H
32
33#include <linux/tracepoint.h>
34#include <sys/types.h>
35
36/*
37 * Generic support for two argument tracepoints of the form:
38 *
39 * DTRACE_PROBE2(...,
40 * zrlock_t *, ...,
41 * uint32_t, ...);
42 */
cae5b340 43/* BEGIN CSTYLED */
ea04106b
AX
44DECLARE_EVENT_CLASS(zfs_zrlock_class,
45 TP_PROTO(zrlock_t *zrl, uint32_t n),
46 TP_ARGS(zrl, n),
47 TP_STRUCT__entry(
48 __field(int32_t, refcount)
49#ifdef ZFS_DEBUG
50 __field(pid_t, owner_pid)
cae5b340 51 __string(caller, zrl->zr_caller)
ea04106b
AX
52#endif
53 __field(uint32_t, n)
54 ),
55 TP_fast_assign(
56 __entry->refcount = zrl->zr_refcount;
57#ifdef ZFS_DEBUG
58 __entry->owner_pid = zrl->zr_owner ? zrl->zr_owner->pid : 0;
cae5b340 59 __assign_str(caller, zrl->zr_caller);
ea04106b
AX
60#endif
61 __entry->n = n;
62 ),
63#ifdef ZFS_DEBUG
64 TP_printk("zrl { refcount %d owner_pid %d caller %s } n %u",
cae5b340 65 __entry->refcount, __entry->owner_pid, __get_str(caller),
ea04106b
AX
66 __entry->n)
67#else
68 TP_printk("zrl { refcount %d } n %u",
69 __entry->refcount, __entry->n)
70#endif
71);
cae5b340 72/* END_CSTYLED */
ea04106b
AX
73
74#define DEFINE_ZRLOCK_EVENT(name) \
75DEFINE_EVENT(zfs_zrlock_class, name, \
76 TP_PROTO(zrlock_t *zrl, uint32_t n), \
77 TP_ARGS(zrl, n))
78DEFINE_ZRLOCK_EVENT(zfs_zrlock__reentry);
79
80#endif /* _TRACE_ZRLOCK_H */
81
82#undef TRACE_INCLUDE_PATH
83#undef TRACE_INCLUDE_FILE
84#define TRACE_INCLUDE_PATH sys
85#define TRACE_INCLUDE_FILE trace_zrlock
86#include <trace/define_trace.h>
87
88#endif /* _KERNEL && HAVE_DECLARE_EVENT_CLASS */