2 * Copyright (c) 2011 Broadcom Corporation
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 #if !defined(__TRACE_BRCMSMAC_MSG_H) || defined(TRACE_HEADER_MULTI_READ)
18 #define __TRACE_BRCMSMAC_MSG_H
20 #include <linux/tracepoint.h>
23 #define TRACE_SYSTEM brcmsmac_msg
25 #define MAX_MSG_LEN 100
27 DECLARE_EVENT_CLASS(brcms_msg_event
,
28 TP_PROTO(struct va_format
*vaf
),
31 __dynamic_array(char, msg
, MAX_MSG_LEN
)
34 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg
),
35 MAX_MSG_LEN
, vaf
->fmt
,
36 *vaf
->va
) >= MAX_MSG_LEN
);
38 TP_printk("%s", __get_str(msg
))
41 DEFINE_EVENT(brcms_msg_event
, brcms_info
,
42 TP_PROTO(struct va_format
*vaf
),
46 DEFINE_EVENT(brcms_msg_event
, brcms_warn
,
47 TP_PROTO(struct va_format
*vaf
),
51 DEFINE_EVENT(brcms_msg_event
, brcms_err
,
52 TP_PROTO(struct va_format
*vaf
),
56 DEFINE_EVENT(brcms_msg_event
, brcms_crit
,
57 TP_PROTO(struct va_format
*vaf
),
61 TRACE_EVENT(brcms_dbg
,
62 TP_PROTO(u32 level
, const char *func
, struct va_format
*vaf
),
63 TP_ARGS(level
, func
, vaf
),
67 __dynamic_array(char, msg
, MAX_MSG_LEN
)
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
);
76 TP_printk("%s: %s", __get_str(func
), __get_str(msg
))
78 #endif /* __TRACE_BRCMSMAC_MSG_H */
80 #ifdef CONFIG_BRCM_TRACING
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>
88 #endif /* CONFIG_BRCM_TRACING */