]> git.proxmox.com Git - mirror_zfs.git/blame - include/sys/trace_zrlock.h
Align thread priority with Linux defaults
[mirror_zfs.git] / include / sys / trace_zrlock.h
CommitLineData
49ee64e5
NB
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
27#if !defined(_TRACE_ZRLOCK_H) || defined(TRACE_HEADER_MULTI_READ)
28#define _TRACE_ZRLOCK_H
29
30#include <linux/tracepoint.h>
31#include <sys/types.h>
32
33/*
34 * Generic support for two argument tracepoints of the form:
35 *
36 * DTRACE_PROBE2(...,
37 * zrlock_t *, ...,
38 * uint32_t, ...);
39 */
40
41DECLARE_EVENT_CLASS(zfs_zrlock_class,
42 TP_PROTO(zrlock_t *zrl, uint32_t n),
43 TP_ARGS(zrl, n),
44 TP_STRUCT__entry(
95a6990d 45 __field(int32_t, refcount)
49ee64e5 46#ifdef ZFS_DEBUG
95a6990d
NB
47 __field(pid_t, owner_pid)
48 __field(const char *, caller)
49ee64e5
NB
49#endif
50 __field(uint32_t, n)
51 ),
52 TP_fast_assign(
95a6990d 53 __entry->refcount = zrl->zr_refcount;
49ee64e5 54#ifdef ZFS_DEBUG
95a6990d
NB
55 __entry->owner_pid = zrl->zr_owner ? zrl->zr_owner->pid : 0;
56 __entry->caller = zrl->zr_caller;
49ee64e5 57#endif
95a6990d 58 __entry->n = n;
49ee64e5
NB
59 ),
60#ifdef ZFS_DEBUG
61 TP_printk("zrl { refcount %d owner_pid %d caller %s } n %u",
95a6990d 62 __entry->refcount, __entry->owner_pid, __entry->caller,
49ee64e5
NB
63 __entry->n)
64#else
65 TP_printk("zrl { refcount %d } n %u",
95a6990d 66 __entry->refcount, __entry->n)
49ee64e5
NB
67#endif
68);
69
70#define DEFINE_ZRLOCK_EVENT(name) \
71DEFINE_EVENT(zfs_zrlock_class, name, \
72 TP_PROTO(zrlock_t *zrl, uint32_t n), \
73 TP_ARGS(zrl, n))
74DEFINE_ZRLOCK_EVENT(zfs_zrlock__reentry);
75
76#endif /* _TRACE_ZRLOCK_H */
77
78#undef TRACE_INCLUDE_PATH
79#undef TRACE_INCLUDE_FILE
80#define TRACE_INCLUDE_PATH sys
81#define TRACE_INCLUDE_FILE trace_zrlock
82#include <trace/define_trace.h>
83
84#endif /* _KERNEL && HAVE_DECLARE_EVENT_CLASS */