-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
brcmfmac: introduce tracepoints for message logging
Inspired by tracing functionality added by Seth Forshee in the brcmsmac driver, this patch adds similar functionality to brcmfmac. Reviewed-by: Piotr Haber <phaber@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
- Loading branch information
Arend van Spriel
authored and
John W. Linville
committed
Mar 6, 2013
1 parent
cd86452
commit e548357
Showing
6 changed files
with
159 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright (c) 2012 Broadcom Corporation | ||
* | ||
* Permission to use, copy, modify, and/or distribute this software for any | ||
* purpose with or without fee is hereby granted, provided that the above | ||
* copyright notice and this permission notice appear in all copies. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY | ||
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION | ||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN | ||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
*/ | ||
|
||
#include <linux/module.h> /* bug in tracepoint.h, it should include this */ | ||
|
||
#ifndef __CHECKER__ | ||
#define CREATE_TRACE_POINTS | ||
#include "tracepoint.h" | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/* | ||
* Copyright (c) 2013 Broadcom Corporation | ||
* | ||
* Permission to use, copy, modify, and/or distribute this software for any | ||
* purpose with or without fee is hereby granted, provided that the above | ||
* copyright notice and this permission notice appear in all copies. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY | ||
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION | ||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN | ||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
*/ | ||
#if !defined(BRCMF_TRACEPOINT_H_) || defined(TRACE_HEADER_MULTI_READ) | ||
#define BRCMF_TRACEPOINT_H_ | ||
|
||
#include <linux/types.h> | ||
#include <linux/tracepoint.h> | ||
|
||
#ifndef CONFIG_BRCM_TRACING | ||
|
||
#undef TRACE_EVENT | ||
#define TRACE_EVENT(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_BRCM_TRACING */ | ||
|
||
#undef TRACE_SYSTEM | ||
#define TRACE_SYSTEM brcmfmac | ||
|
||
#define MAX_MSG_LEN 100 | ||
|
||
TRACE_EVENT(brcmf_err, | ||
TP_PROTO(const char *func, struct va_format *vaf), | ||
TP_ARGS(func, vaf), | ||
TP_STRUCT__entry( | ||
__string(func, func) | ||
__dynamic_array(char, msg, MAX_MSG_LEN) | ||
), | ||
TP_fast_assign( | ||
__assign_str(func, func); | ||
WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg), | ||
MAX_MSG_LEN, vaf->fmt, | ||
*vaf->va) >= MAX_MSG_LEN); | ||
), | ||
TP_printk("%s: %s", __get_str(func), __get_str(msg)) | ||
); | ||
|
||
TRACE_EVENT(brcmf_dbg, | ||
TP_PROTO(u32 level, const char *func, struct va_format *vaf), | ||
TP_ARGS(level, func, vaf), | ||
TP_STRUCT__entry( | ||
__field(u32, level) | ||
__string(func, func) | ||
__dynamic_array(char, msg, MAX_MSG_LEN) | ||
), | ||
TP_fast_assign( | ||
__entry->level = level; | ||
__assign_str(func, func); | ||
WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg), | ||
MAX_MSG_LEN, vaf->fmt, | ||
*vaf->va) >= MAX_MSG_LEN); | ||
), | ||
TP_printk("%s: %s", __get_str(func), __get_str(msg)) | ||
); | ||
|
||
#ifdef CONFIG_BRCM_TRACING | ||
|
||
#undef TRACE_INCLUDE_PATH | ||
#define TRACE_INCLUDE_PATH . | ||
#undef TRACE_INCLUDE_FILE | ||
#define TRACE_INCLUDE_FILE tracepoint | ||
|
||
#include <trace/define_trace.h> | ||
|
||
#endif /* CONFIG_BRCM_TRACING */ | ||
|
||
#endif /* BRCMF_TRACEPOINT_H_ */ |