treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / net / wireless / intel / iwlwifi / iwl-devtrace-msg.h
blob9ad93ef60890302960826098372abcef6d75c9ca
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /******************************************************************************
4 * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
6 * Contact Information:
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>
17 #undef TRACE_SYSTEM
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),
24 TP_ARGS(vaf),
25 TP_STRUCT__entry(
26 __dynamic_array(char, msg, MAX_MSG_LEN)
28 TP_fast_assign(
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),
38 TP_ARGS(vaf)
41 DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_warn,
42 TP_PROTO(struct va_format *vaf),
43 TP_ARGS(vaf)
46 DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_info,
47 TP_PROTO(struct va_format *vaf),
48 TP_ARGS(vaf)
51 DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_crit,
52 TP_PROTO(struct va_format *vaf),
53 TP_ARGS(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),
60 TP_STRUCT__entry(
61 __field(u32, level)
62 __field(u8, in_interrupt)
63 __string(function, function)
64 __dynamic_array(char, msg, MAX_MSG_LEN)
66 TP_fast_assign(
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>