]>
Commit | Line | Data |
---|---|---|
70e083d2 TG |
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 | /* Do not include this file directly. Please use <sys/trace.h> instead. */ | |
23 | #ifndef _SYS_TRACE_DBGMSG_INDIRECT | |
24 | #error "trace_dbgmsg.h included directly" | |
25 | #endif | |
26 | ||
27 | /* | |
28 | * This file defines tracepoint events for use by the dbgmsg(), | |
29 | * dprintf(), and SET_ERROR() interfaces. These are grouped here because | |
30 | * they all provide a way to store simple messages in the debug log (as | |
31 | * opposed to events used by the DTRACE_PROBE interfaces which typically | |
32 | * dump structured data). | |
33 | * | |
34 | * This header is included inside the trace.h multiple inclusion guard, | |
35 | * and it is guarded above against direct inclusion, so it and need not | |
36 | * be guarded separately. | |
37 | */ | |
38 | ||
39 | /* | |
86e3c28a | 40 | * Generic support for one argument tracepoints of the form: |
70e083d2 | 41 | * |
86e3c28a | 42 | * DTRACE_PROBE1(..., |
70e083d2 TG |
43 | * const char *, ...); |
44 | */ | |
86e3c28a | 45 | /* BEGIN CSTYLED */ |
70e083d2 | 46 | DECLARE_EVENT_CLASS(zfs_dprintf_class, |
86e3c28a CIK |
47 | TP_PROTO(const char *msg), |
48 | TP_ARGS(msg), | |
70e083d2 | 49 | TP_STRUCT__entry( |
70e083d2 TG |
50 | __string(msg, msg) |
51 | ), | |
52 | TP_fast_assign( | |
70e083d2 TG |
53 | __assign_str(msg, msg); |
54 | ), | |
86e3c28a | 55 | TP_printk("%s", __get_str(msg)) |
70e083d2 | 56 | ); |
86e3c28a | 57 | /* END CSTYLED */ |
70e083d2 | 58 | |
86e3c28a | 59 | /* BEGIN CSTYLED */ |
70e083d2 TG |
60 | #define DEFINE_DPRINTF_EVENT(name) \ |
61 | DEFINE_EVENT(zfs_dprintf_class, name, \ | |
86e3c28a CIK |
62 | TP_PROTO(const char *msg), \ |
63 | TP_ARGS(msg)) | |
64 | /* END CSTYLED */ | |
70e083d2 | 65 | DEFINE_DPRINTF_EVENT(zfs_zfs__dprintf); |