1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /******************************************************************************
4 * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
7 * Intel Linux Wireless <linuxwifi@intel.com>
8 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
10 *****************************************************************************/
12 #if !defined(__IWLWIFI_DEVICE_TRACE_MSG) || defined(TRACE_HEADER_MULTI_READ)
13 #define __IWLWIFI_DEVICE_TRACE_MSG
15 #include <linux/tracepoint.h>
18 #define TRACE_SYSTEM iwlwifi_msg
20 #define MAX_MSG_LEN 110
22 DECLARE_EVENT_CLASS(iwlwifi_msg_event
,
23 TP_PROTO(struct va_format
*vaf
),
26 __dynamic_array(char, msg
, MAX_MSG_LEN
)
29 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg
),
30 MAX_MSG_LEN
, vaf
->fmt
,
31 *vaf
->va
) >= MAX_MSG_LEN
);
33 TP_printk("%s", __get_str(msg
))
36 DEFINE_EVENT(iwlwifi_msg_event
, iwlwifi_err
,
37 TP_PROTO(struct va_format
*vaf
),
41 DEFINE_EVENT(iwlwifi_msg_event
, iwlwifi_warn
,
42 TP_PROTO(struct va_format
*vaf
),
46 DEFINE_EVENT(iwlwifi_msg_event
, iwlwifi_info
,
47 TP_PROTO(struct va_format
*vaf
),
51 DEFINE_EVENT(iwlwifi_msg_event
, iwlwifi_crit
,
52 TP_PROTO(struct va_format
*vaf
),
56 TRACE_EVENT(iwlwifi_dbg
,
57 TP_PROTO(u32 level
, bool in_interrupt
, const char *function
,
58 struct va_format
*vaf
),
59 TP_ARGS(level
, in_interrupt
, function
, vaf
),
62 __field(u8
, in_interrupt
)
63 __string(function
, function
)
64 __dynamic_array(char, msg
, MAX_MSG_LEN
)
67 __entry
->level
= level
;
68 __entry
->in_interrupt
= in_interrupt
;
69 __assign_str(function
, function
);
70 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg
),
71 MAX_MSG_LEN
, vaf
->fmt
,
72 *vaf
->va
) >= MAX_MSG_LEN
);
74 TP_printk("%s", __get_str(msg
))
76 #endif /* __IWLWIFI_DEVICE_TRACE_MSG */
78 #undef TRACE_INCLUDE_PATH
79 #define TRACE_INCLUDE_PATH .
80 #undef TRACE_INCLUDE_FILE
81 #define TRACE_INCLUDE_FILE iwl-devtrace-msg
82 #include <trace/define_trace.h>