Linux Audio

Check our new training course

Loading...
v6.8
 1/* SPDX-License-Identifier: GPL-2.0-only */
 2/******************************************************************************
 3 *
 4 * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
 5 * Copyright(c) 2015        Intel Deutschland GmbH
 6 * Copyright(c) 2018 - 2019, 2023 Intel Corporation
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 7 *****************************************************************************/
 8
 9#if !defined(__IWLWIFI_DEVICE_TRACE_DATA) || defined(TRACE_HEADER_MULTI_READ)
10#define __IWLWIFI_DEVICE_TRACE_DATA
11
12#include <linux/tracepoint.h>
13
14#undef TRACE_SYSTEM
15#define TRACE_SYSTEM iwlwifi_data
16
17TRACE_EVENT(iwlwifi_dev_tx_tb,
18	TP_PROTO(const struct device *dev, struct sk_buff *skb,
19		 u8 *data_src, dma_addr_t phys, size_t data_len),
20	TP_ARGS(dev, skb, data_src, phys, data_len),
21	TP_STRUCT__entry(
22		DEV_ENTRY
23		__field(u64, phys)
24
25		__dynamic_array(u8, data,
26				iwl_trace_data(skb) ? data_len : 0)
27	),
28	TP_fast_assign(
29		DEV_ASSIGN;
30		__entry->phys = phys;
31		if (iwl_trace_data(skb))
32			memcpy(__get_dynamic_array(data), data_src, data_len);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33	),
34	TP_printk("[%s] TX frame data", __get_str(dev))
35);
36
37TRACE_EVENT(iwlwifi_dev_rx_data,
38	TP_PROTO(const struct device *dev,
39		 void *rxbuf, size_t len, size_t start),
40	TP_ARGS(dev, rxbuf, len, start),
 
41	TP_STRUCT__entry(
42		DEV_ENTRY
43		__dynamic_array(u8, data, len - start)
 
 
44	),
45	TP_fast_assign(
 
46		DEV_ASSIGN;
47		if (start < len)
48			memcpy(__get_dynamic_array(data),
49			       ((u8 *)rxbuf) + start, len - start);
50	),
51	TP_printk("[%s] RX frame data", __get_str(dev))
52);
53#endif /* __IWLWIFI_DEVICE_TRACE_DATA */
54
55#undef TRACE_INCLUDE_PATH
56#define TRACE_INCLUDE_PATH .
57#undef TRACE_INCLUDE_FILE
58#define TRACE_INCLUDE_FILE iwl-devtrace-data
59#include <trace/define_trace.h>
v4.17
 
 1/******************************************************************************
 2 *
 3 * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
 4 * Copyright(c) 2015        Intel Deutschland GmbH
 5 *
 6 * This program is free software; you can redistribute it and/or modify it
 7 * under the terms of version 2 of the GNU General Public License as
 8 * published by the Free Software Foundation.
 9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 *
19 * The full GNU General Public License is included in this distribution in the
20 * file called LICENSE.
21 *
22 * Contact Information:
23 *  Intel Linux Wireless <linuxwifi@intel.com>
24 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
25 *
26 *****************************************************************************/
27
28#if !defined(__IWLWIFI_DEVICE_TRACE_DATA) || defined(TRACE_HEADER_MULTI_READ)
29#define __IWLWIFI_DEVICE_TRACE_DATA
30
31#include <linux/tracepoint.h>
32
33#undef TRACE_SYSTEM
34#define TRACE_SYSTEM iwlwifi_data
35
36TRACE_EVENT(iwlwifi_dev_tx_data,
37	TP_PROTO(const struct device *dev,
38		 struct sk_buff *skb, u8 hdr_len),
39	TP_ARGS(dev, skb, hdr_len),
40	TP_STRUCT__entry(
41		DEV_ENTRY
 
42
43		__dynamic_array(u8, data,
44				iwl_trace_data(skb) ? skb->len - hdr_len : 0)
45	),
46	TP_fast_assign(
47		DEV_ASSIGN;
 
48		if (iwl_trace_data(skb))
49			skb_copy_bits(skb, hdr_len,
50				      __get_dynamic_array(data),
51				      skb->len - hdr_len);
52	),
53	TP_printk("[%s] TX frame data", __get_str(dev))
54);
55
56TRACE_EVENT(iwlwifi_dev_tx_tso_chunk,
57	TP_PROTO(const struct device *dev,
58		 u8 *data_src, size_t data_len),
59	TP_ARGS(dev, data_src, data_len),
60	TP_STRUCT__entry(
61		DEV_ENTRY
62
63		__dynamic_array(u8, data, data_len)
64	),
65	TP_fast_assign(
66		DEV_ASSIGN;
67		memcpy(__get_dynamic_array(data), data_src, data_len);
68	),
69	TP_printk("[%s] TX frame data", __get_str(dev))
70);
71
72TRACE_EVENT(iwlwifi_dev_rx_data,
73	TP_PROTO(const struct device *dev,
74		 const struct iwl_trans *trans,
75		 void *rxbuf, size_t len),
76	TP_ARGS(dev, trans, rxbuf, len),
77	TP_STRUCT__entry(
78		DEV_ENTRY
79
80		__dynamic_array(u8, data,
81				len - iwl_rx_trace_len(trans, rxbuf, len))
82	),
83	TP_fast_assign(
84		size_t offs = iwl_rx_trace_len(trans, rxbuf, len);
85		DEV_ASSIGN;
86		if (offs < len)
87			memcpy(__get_dynamic_array(data),
88			       ((u8 *)rxbuf) + offs, len - offs);
89	),
90	TP_printk("[%s] RX frame data", __get_str(dev))
91);
92#endif /* __IWLWIFI_DEVICE_TRACE_DATA */
93
94#undef TRACE_INCLUDE_PATH
95#define TRACE_INCLUDE_PATH .
96#undef TRACE_INCLUDE_FILE
97#define TRACE_INCLUDE_FILE iwl-devtrace-data
98#include <trace/define_trace.h>