1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #if !defined(__TRACE_BRCMSMAC_MSG_H) || defined(TRACE_HEADER_MULTI_READ)
18 #define __TRACE_BRCMSMAC_MSG_H
19
20 #include <linux/tracepoint.h>
21
22 #undef TRACE_SYSTEM
23 #define TRACE_SYSTEM brcmsmac_msg
24
25 #define MAX_MSG_LEN 100
26
27 DECLARE_EVENT_CLASS(brcms_msg_event,
28 TP_PROTO(struct va_format *vaf),
29 TP_ARGS(vaf),
30 TP_STRUCT__entry(
31 __dynamic_array(char, msg, MAX_MSG_LEN)
32 ),
33 TP_fast_assign(
34 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
35 MAX_MSG_LEN, vaf->fmt,
36 *vaf->va) >= MAX_MSG_LEN);
37 ),
38 TP_printk("%s", __get_str(msg))
39 );
40
41 DEFINE_EVENT(brcms_msg_event, brcms_info,
42 TP_PROTO(struct va_format *vaf),
43 TP_ARGS(vaf)
44 );
45
46 DEFINE_EVENT(brcms_msg_event, brcms_warn,
47 TP_PROTO(struct va_format *vaf),
48 TP_ARGS(vaf)
49 );
50
51 DEFINE_EVENT(brcms_msg_event, brcms_err,
52 TP_PROTO(struct va_format *vaf),
53 TP_ARGS(vaf)
54 );
55
56 DEFINE_EVENT(brcms_msg_event, brcms_crit,
57 TP_PROTO(struct va_format *vaf),
58 TP_ARGS(vaf)
59 );
60
61 TRACE_EVENT(brcms_dbg,
62 TP_PROTO(u32 level, const char *func, struct va_format *vaf),
63 TP_ARGS(level, func, vaf),
64 TP_STRUCT__entry(
65 __field(u32, level)
66 __string(func, func)
67 __dynamic_array(char, msg, MAX_MSG_LEN)
68 ),
69 TP_fast_assign(
70 __entry->level = level;
71 __assign_str(func, func);
72 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
73 MAX_MSG_LEN, vaf->fmt,
74 *vaf->va) >= MAX_MSG_LEN);
75 ),
76 TP_printk("%s: %s", __get_str(func), __get_str(msg))
77 );
78 #endif
79
80 #ifdef CONFIG_BRCM_TRACING
81
82 #undef TRACE_INCLUDE_PATH
83 #define TRACE_INCLUDE_PATH .
84 #undef TRACE_INCLUDE_FILE
85 #define TRACE_INCLUDE_FILE brcms_trace_brcmsmac_msg
86 #include <trace/define_trace.h>
87
88 #endif