1 /******************************************************************************
3 * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 * The full GNU General Public License is included in this distribution in the
19 * file called LICENSE.
21 * Contact Information:
22 * Intel Linux Wireless <linuxwifi@intel.com>
23 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
25 *****************************************************************************/
27 #if !defined(__IWLWIFI_DEVICE_TRACE_MSG) || defined(TRACE_HEADER_MULTI_READ)
28 #define __IWLWIFI_DEVICE_TRACE_MSG
30 #include <linux/tracepoint.h>
33 #define TRACE_SYSTEM iwlwifi_msg
35 #define MAX_MSG_LEN 110
37 DECLARE_EVENT_CLASS(iwlwifi_msg_event
,
38 TP_PROTO(struct va_format
*vaf
),
41 __dynamic_array(char, msg
, MAX_MSG_LEN
)
44 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg
),
45 MAX_MSG_LEN
, vaf
->fmt
,
46 *vaf
->va
) >= MAX_MSG_LEN
);
48 TP_printk("%s", __get_str(msg
))
51 DEFINE_EVENT(iwlwifi_msg_event
, iwlwifi_err
,
52 TP_PROTO(struct va_format
*vaf
),
56 DEFINE_EVENT(iwlwifi_msg_event
, iwlwifi_warn
,
57 TP_PROTO(struct va_format
*vaf
),
61 DEFINE_EVENT(iwlwifi_msg_event
, iwlwifi_info
,
62 TP_PROTO(struct va_format
*vaf
),
66 DEFINE_EVENT(iwlwifi_msg_event
, iwlwifi_crit
,
67 TP_PROTO(struct va_format
*vaf
),
71 TRACE_EVENT(iwlwifi_dbg
,
72 TP_PROTO(u32 level
, bool in_interrupt
, const char *function
,
73 struct va_format
*vaf
),
74 TP_ARGS(level
, in_interrupt
, function
, vaf
),
77 __field(u8
, in_interrupt
)
78 __string(function
, function
)
79 __dynamic_array(char, msg
, MAX_MSG_LEN
)
82 __entry
->level
= level
;
83 __entry
->in_interrupt
= in_interrupt
;
84 __assign_str(function
, function
);
85 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg
),
86 MAX_MSG_LEN
, vaf
->fmt
,
87 *vaf
->va
) >= MAX_MSG_LEN
);
89 TP_printk("%s", __get_str(msg
))
91 #endif /* __IWLWIFI_DEVICE_TRACE_MSG */
93 #undef TRACE_INCLUDE_PATH
94 #define TRACE_INCLUDE_PATH .
95 #undef TRACE_INCLUDE_FILE
96 #define TRACE_INCLUDE_FILE iwl-devtrace-msg
97 #include <trace/define_trace.h>