xref: /linux/drivers/net/wireless/intel/iwlwifi/iwl-devtrace-msg.h (revision ee8287e068a3995b0f8001dd6931e221dfb7c530)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /******************************************************************************
3  *
4  * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
5  *****************************************************************************/
6 
7 #if !defined(__IWLWIFI_DEVICE_TRACE_MSG) || defined(TRACE_HEADER_MULTI_READ)
8 #define __IWLWIFI_DEVICE_TRACE_MSG
9 
10 #include <linux/tracepoint.h>
11 
12 #undef TRACE_SYSTEM
13 #define TRACE_SYSTEM iwlwifi_msg
14 
15 #define MAX_MSG_LEN	110
16 
17 DECLARE_EVENT_CLASS(iwlwifi_msg_event,
18 	TP_PROTO(struct va_format *vaf),
19 	TP_ARGS(vaf),
20 	TP_STRUCT__entry(
21 		__vstring(msg, vaf->fmt, vaf->va)
22 	),
23 	TP_fast_assign(
24 		__assign_vstr(msg, vaf->fmt, vaf->va);
25 	),
26 	TP_printk("%s", __get_str(msg))
27 );
28 
29 DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_err,
30 	TP_PROTO(struct va_format *vaf),
31 	TP_ARGS(vaf)
32 );
33 
34 DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_warn,
35 	TP_PROTO(struct va_format *vaf),
36 	TP_ARGS(vaf)
37 );
38 
39 DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_info,
40 	TP_PROTO(struct va_format *vaf),
41 	TP_ARGS(vaf)
42 );
43 
44 DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_crit,
45 	TP_PROTO(struct va_format *vaf),
46 	TP_ARGS(vaf)
47 );
48 
49 TRACE_EVENT(iwlwifi_dbg,
50 	TP_PROTO(u32 level, const char *function,
51 		 struct va_format *vaf),
52 	TP_ARGS(level, function, vaf),
53 	TP_STRUCT__entry(
54 		__field(u32, level)
55 		__string(function, function)
56 		__vstring(msg, vaf->fmt, vaf->va)
57 	),
58 	TP_fast_assign(
59 		__entry->level = level;
60 		__assign_str(function);
61 		__assign_vstr(msg, vaf->fmt, vaf->va);
62 	),
63 	TP_printk("%s", __get_str(msg))
64 );
65 #endif /* __IWLWIFI_DEVICE_TRACE_MSG */
66 
67 #undef TRACE_INCLUDE_PATH
68 #define TRACE_INCLUDE_PATH .
69 #undef TRACE_INCLUDE_FILE
70 #define TRACE_INCLUDE_FILE iwl-devtrace-msg
71 #include <trace/define_trace.h>
72