Commit da01d53c authored by Kalle Valo's avatar Kalle Valo

ath6kl: add tracing support to log functions

All log messages are now sent through tracing interface as well if
ATH6KL_TRACING is enabled.
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent d470b4bc
...@@ -67,6 +67,7 @@ int ath6kl_info(const char *fmt, ...) ...@@ -67,6 +67,7 @@ int ath6kl_info(const char *fmt, ...)
va_start(args, fmt); va_start(args, fmt);
vaf.va = &args; vaf.va = &args;
ret = ath6kl_printk(KERN_INFO, "%pV", &vaf); ret = ath6kl_printk(KERN_INFO, "%pV", &vaf);
trace_ath6kl_log_info(&vaf);
va_end(args); va_end(args);
return ret; return ret;
...@@ -84,6 +85,7 @@ int ath6kl_err(const char *fmt, ...) ...@@ -84,6 +85,7 @@ int ath6kl_err(const char *fmt, ...)
va_start(args, fmt); va_start(args, fmt);
vaf.va = &args; vaf.va = &args;
ret = ath6kl_printk(KERN_ERR, "%pV", &vaf); ret = ath6kl_printk(KERN_ERR, "%pV", &vaf);
trace_ath6kl_log_err(&vaf);
va_end(args); va_end(args);
return ret; return ret;
...@@ -101,6 +103,7 @@ int ath6kl_warn(const char *fmt, ...) ...@@ -101,6 +103,7 @@ int ath6kl_warn(const char *fmt, ...)
va_start(args, fmt); va_start(args, fmt);
vaf.va = &args; vaf.va = &args;
ret = ath6kl_printk(KERN_WARNING, "%pV", &vaf); ret = ath6kl_printk(KERN_WARNING, "%pV", &vaf);
trace_ath6kl_log_warn(&vaf);
va_end(args); va_end(args);
return ret; return ret;
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#define DEBUG_H #define DEBUG_H
#include "hif.h" #include "hif.h"
#include "trace.h"
enum ATH6K_DEBUG_MASK { enum ATH6K_DEBUG_MASK {
ATH6KL_DBG_CREDIT = BIT(0), ATH6KL_DBG_CREDIT = BIT(0),
......
...@@ -25,6 +25,11 @@ static inline unsigned int ath6kl_get_wmi_id(void *buf, size_t buf_len) ...@@ -25,6 +25,11 @@ static inline unsigned int ath6kl_get_wmi_id(void *buf, size_t buf_len)
#undef TRACE_EVENT #undef TRACE_EVENT
#define TRACE_EVENT(name, proto, ...) \ #define TRACE_EVENT(name, proto, ...) \
static inline void trace_ ## name(proto) {} static inline void trace_ ## name(proto) {}
#undef DECLARE_EVENT_CLASS
#define DECLARE_EVENT_CLASS(...)
#undef DEFINE_EVENT
#define DEFINE_EVENT(evt_class, name, proto, ...) \
static inline void trace_ ## name(proto) {}
#endif /* !CONFIG_ATH6KL_TRACING || __CHECKER__ */ #endif /* !CONFIG_ATH6KL_TRACING || __CHECKER__ */
#undef TRACE_SYSTEM #undef TRACE_SYSTEM
...@@ -241,6 +246,38 @@ TRACE_EVENT(ath6kl_htc_tx, ...@@ -241,6 +246,38 @@ TRACE_EVENT(ath6kl_htc_tx,
) )
); );
#define ATH6KL_MSG_MAX 200
DECLARE_EVENT_CLASS(ath6kl_log_event,
TP_PROTO(struct va_format *vaf),
TP_ARGS(vaf),
TP_STRUCT__entry(
__dynamic_array(char, msg, ATH6KL_MSG_MAX)
),
TP_fast_assign(
WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
ATH6KL_MSG_MAX,
vaf->fmt,
*vaf->va) >= ATH6KL_MSG_MAX);
),
TP_printk("%s", __get_str(msg))
);
DEFINE_EVENT(ath6kl_log_event, ath6kl_log_err,
TP_PROTO(struct va_format *vaf),
TP_ARGS(vaf)
);
DEFINE_EVENT(ath6kl_log_event, ath6kl_log_warn,
TP_PROTO(struct va_format *vaf),
TP_ARGS(vaf)
);
DEFINE_EVENT(ath6kl_log_event, ath6kl_log_info,
TP_PROTO(struct va_format *vaf),
TP_ARGS(vaf)
);
#endif /* _ ATH6KL_TRACE_H || TRACE_HEADER_MULTI_READ*/ #endif /* _ ATH6KL_TRACE_H || TRACE_HEADER_MULTI_READ*/
/* we don't want to use include/trace/events */ /* we don't want to use include/trace/events */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment