treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / net / wireless / ath / ath11k / trace.h
blob8700a622be7bd3bab1592a83a0f13bdbba2584dc
1 /* SPDX-License-Identifier: BSD-3-Clause-Clear */
2 /*
3 * Copyright (c) 2019 The Linux Foundation. All rights reserved.
4 */
6 #if !defined(_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
8 #include <linux/tracepoint.h>
9 #include "core.h"
11 #define _TRACE_H_
13 /* create empty functions when tracing is disabled */
14 #if !defined(CONFIG_ATH11K_TRACING)
15 #undef TRACE_EVENT
16 #define TRACE_EVENT(name, proto, ...) \
17 static inline void trace_ ## name(proto) {}
18 #endif /* !CONFIG_ATH11K_TRACING || __CHECKER__ */
20 #undef TRACE_SYSTEM
21 #define TRACE_SYSTEM ath11k
23 TRACE_EVENT(ath11k_htt_pktlog,
24 TP_PROTO(struct ath11k *ar, const void *buf, u16 buf_len),
26 TP_ARGS(ar, buf, buf_len),
28 TP_STRUCT__entry(
29 __string(device, dev_name(ar->ab->dev))
30 __string(driver, dev_driver_string(ar->ab->dev))
31 __field(u16, buf_len)
32 __dynamic_array(u8, pktlog, buf_len)
35 TP_fast_assign(
36 __assign_str(device, dev_name(ar->ab->dev));
37 __assign_str(driver, dev_driver_string(ar->ab->dev));
38 __entry->buf_len = buf_len;
39 memcpy(__get_dynamic_array(pktlog), buf, buf_len);
42 TP_printk(
43 "%s %s size %hu",
44 __get_str(driver),
45 __get_str(device),
46 __entry->buf_len
50 TRACE_EVENT(ath11k_htt_ppdu_stats,
51 TP_PROTO(struct ath11k *ar, const void *data, size_t len),
53 TP_ARGS(ar, data, len),
55 TP_STRUCT__entry(
56 __string(device, dev_name(ar->ab->dev))
57 __string(driver, dev_driver_string(ar->ab->dev))
58 __field(u16, len)
59 __dynamic_array(u8, ppdu, len)
62 TP_fast_assign(
63 __assign_str(device, dev_name(ar->ab->dev));
64 __assign_str(driver, dev_driver_string(ar->ab->dev));
65 __entry->len = len;
66 memcpy(__get_dynamic_array(ppdu), data, len);
69 TP_printk(
70 "%s %s ppdu len %d",
71 __get_str(driver),
72 __get_str(device),
73 __entry->len
77 TRACE_EVENT(ath11k_htt_rxdesc,
78 TP_PROTO(struct ath11k *ar, const void *data, size_t len),
80 TP_ARGS(ar, data, len),
82 TP_STRUCT__entry(
83 __string(device, dev_name(ar->ab->dev))
84 __string(driver, dev_driver_string(ar->ab->dev))
85 __field(u16, len)
86 __dynamic_array(u8, rxdesc, len)
89 TP_fast_assign(
90 __assign_str(device, dev_name(ar->ab->dev));
91 __assign_str(driver, dev_driver_string(ar->ab->dev));
92 __entry->len = len;
93 memcpy(__get_dynamic_array(rxdesc), data, len);
96 TP_printk(
97 "%s %s rxdesc len %d",
98 __get_str(driver),
99 __get_str(device),
100 __entry->len
104 #endif /* _TRACE_H_ || TRACE_HEADER_MULTI_READ*/
106 /* we don't want to use include/trace/events */
107 #undef TRACE_INCLUDE_PATH
108 #define TRACE_INCLUDE_PATH .
109 #undef TRACE_INCLUDE_FILE
110 #define TRACE_INCLUDE_FILE trace
112 /* This part must be outside protection */
113 #include <trace/define_trace.h>