WIP FPC-III support
[linux/fpc-iii.git] / drivers / net / wireless / ath / ath11k / trace.h
blob66d0aae7816cb6e107a44a28c77bfc122a727606
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,
25 u32 pktlog_checksum),
27 TP_ARGS(ar, buf, buf_len, pktlog_checksum),
29 TP_STRUCT__entry(
30 __string(device, dev_name(ar->ab->dev))
31 __string(driver, dev_driver_string(ar->ab->dev))
32 __field(u16, buf_len)
33 __field(u32, pktlog_checksum)
34 __dynamic_array(u8, pktlog, buf_len)
37 TP_fast_assign(
38 __assign_str(device, dev_name(ar->ab->dev));
39 __assign_str(driver, dev_driver_string(ar->ab->dev));
40 __entry->buf_len = buf_len;
41 __entry->pktlog_checksum = pktlog_checksum;
42 memcpy(__get_dynamic_array(pktlog), buf, buf_len);
45 TP_printk(
46 "%s %s size %hu pktlog_checksum %d",
47 __get_str(driver),
48 __get_str(device),
49 __entry->buf_len,
50 __entry->pktlog_checksum
54 TRACE_EVENT(ath11k_htt_ppdu_stats,
55 TP_PROTO(struct ath11k *ar, const void *data, size_t len),
57 TP_ARGS(ar, data, len),
59 TP_STRUCT__entry(
60 __string(device, dev_name(ar->ab->dev))
61 __string(driver, dev_driver_string(ar->ab->dev))
62 __field(u16, len)
63 __dynamic_array(u8, ppdu, len)
66 TP_fast_assign(
67 __assign_str(device, dev_name(ar->ab->dev));
68 __assign_str(driver, dev_driver_string(ar->ab->dev));
69 __entry->len = len;
70 memcpy(__get_dynamic_array(ppdu), data, len);
73 TP_printk(
74 "%s %s ppdu len %d",
75 __get_str(driver),
76 __get_str(device),
77 __entry->len
81 TRACE_EVENT(ath11k_htt_rxdesc,
82 TP_PROTO(struct ath11k *ar, const void *data, size_t len),
84 TP_ARGS(ar, data, len),
86 TP_STRUCT__entry(
87 __string(device, dev_name(ar->ab->dev))
88 __string(driver, dev_driver_string(ar->ab->dev))
89 __field(u16, len)
90 __dynamic_array(u8, rxdesc, len)
93 TP_fast_assign(
94 __assign_str(device, dev_name(ar->ab->dev));
95 __assign_str(driver, dev_driver_string(ar->ab->dev));
96 __entry->len = len;
97 memcpy(__get_dynamic_array(rxdesc), data, len);
100 TP_printk(
101 "%s %s rxdesc len %d",
102 __get_str(driver),
103 __get_str(device),
104 __entry->len
108 #endif /* _TRACE_H_ || TRACE_HEADER_MULTI_READ*/
110 /* we don't want to use include/trace/events */
111 #undef TRACE_INCLUDE_PATH
112 #define TRACE_INCLUDE_PATH .
113 #undef TRACE_INCLUDE_FILE
114 #define TRACE_INCLUDE_FILE trace
116 /* This part must be outside protection */
117 #include <trace/define_trace.h>