Linux Audio

Check our new training course

Loading...
v6.8
 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
17DECLARE_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
29DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_err,
30	TP_PROTO(struct va_format *vaf),
31	TP_ARGS(vaf)
32);
33
34DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_warn,
35	TP_PROTO(struct va_format *vaf),
36	TP_ARGS(vaf)
37);
38
39DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_info,
40	TP_PROTO(struct va_format *vaf),
41	TP_ARGS(vaf)
42);
43
44DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_crit,
45	TP_PROTO(struct va_format *vaf),
46	TP_ARGS(vaf)
47);
48
49TRACE_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, 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>
v4.17
 
 1/******************************************************************************
 2 *
 3 * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
 4 *
 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.
 8 *
 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
12 * more details.
13 *
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
17 *
18 * The full GNU General Public License is included in this distribution in the
19 * file called LICENSE.
20 *
21 * Contact Information:
22 *  Intel Linux Wireless <linuxwifi@intel.com>
23 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
24 *
25 *****************************************************************************/
26
27#if !defined(__IWLWIFI_DEVICE_TRACE_MSG) || defined(TRACE_HEADER_MULTI_READ)
28#define __IWLWIFI_DEVICE_TRACE_MSG
29
30#include <linux/tracepoint.h>
31
32#undef TRACE_SYSTEM
33#define TRACE_SYSTEM iwlwifi_msg
34
35#define MAX_MSG_LEN	110
36
37DECLARE_EVENT_CLASS(iwlwifi_msg_event,
38	TP_PROTO(struct va_format *vaf),
39	TP_ARGS(vaf),
40	TP_STRUCT__entry(
41		__dynamic_array(char, msg, MAX_MSG_LEN)
42	),
43	TP_fast_assign(
44		WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
45				       MAX_MSG_LEN, vaf->fmt,
46				       *vaf->va) >= MAX_MSG_LEN);
47	),
48	TP_printk("%s", __get_str(msg))
49);
50
51DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_err,
52	TP_PROTO(struct va_format *vaf),
53	TP_ARGS(vaf)
54);
55
56DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_warn,
57	TP_PROTO(struct va_format *vaf),
58	TP_ARGS(vaf)
59);
60
61DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_info,
62	TP_PROTO(struct va_format *vaf),
63	TP_ARGS(vaf)
64);
65
66DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_crit,
67	TP_PROTO(struct va_format *vaf),
68	TP_ARGS(vaf)
69);
70
71TRACE_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),
75	TP_STRUCT__entry(
76		__field(u32, level)
77		__field(u8, in_interrupt)
78		__string(function, function)
79		__dynamic_array(char, msg, MAX_MSG_LEN)
80	),
81	TP_fast_assign(
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);
88	),
89	TP_printk("%s", __get_str(msg))
90);
91#endif /* __IWLWIFI_DEVICE_TRACE_MSG */
92
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>