1 /* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
2 /* Copyright 2014-2015 Freescale Semiconductor Inc.
6 #define TRACE_SYSTEM dpaa2_eth
8 #if !defined(_DPAA2_ETH_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
9 #define _DPAA2_ETH_TRACE_H
11 #include <linux/skbuff.h>
12 #include <linux/netdevice.h>
13 #include <linux/tracepoint.h>
15 #define TR_FMT "[%s] fd: addr=0x%llx, len=%u, off=%u"
16 /* trace_printk format for raw buffer event class */
17 #define TR_BUF_FMT "[%s] vaddr=%p size=%zu dma_addr=%pad map_size=%zu bpid=%d"
19 /* This is used to declare a class of events.
20 * individual events of this type will be defined below.
23 /* Store details about a frame descriptor */
24 DECLARE_EVENT_CLASS(dpaa2_eth_fd
,
25 /* Trace function prototype */
26 TP_PROTO(struct net_device
*netdev
,
27 const struct dpaa2_fd
*fd
),
29 /* Repeat argument list here */
32 /* A structure containing the relevant information we want
33 * to record. Declare name and type for each normal element,
34 * name, type and size for arrays. Use __string for variable
40 __field(u16
, fd_offset
)
41 __string(name
, netdev
->name
)
44 /* The function that assigns values to the above declared
48 __entry
->fd_addr
= dpaa2_fd_get_addr(fd
);
49 __entry
->fd_len
= dpaa2_fd_get_len(fd
);
50 __entry
->fd_offset
= dpaa2_fd_get_offset(fd
);
51 __assign_str(name
, netdev
->name
);
54 /* This is what gets printed when the trace event is
64 /* Now declare events of the above type. Format is:
65 * DEFINE_EVENT(class, name, proto, args), with proto and args same as for class
69 DEFINE_EVENT(dpaa2_eth_fd
, dpaa2_tx_fd
,
70 TP_PROTO(struct net_device
*netdev
,
71 const struct dpaa2_fd
*fd
),
77 DEFINE_EVENT(dpaa2_eth_fd
, dpaa2_rx_fd
,
78 TP_PROTO(struct net_device
*netdev
,
79 const struct dpaa2_fd
*fd
),
84 /* Tx confirmation fd */
85 DEFINE_EVENT(dpaa2_eth_fd
, dpaa2_tx_conf_fd
,
86 TP_PROTO(struct net_device
*netdev
,
87 const struct dpaa2_fd
*fd
),
92 /* Log data about raw buffers. Useful for tracing DPBP content. */
93 TRACE_EVENT(dpaa2_eth_buf_seed
,
94 /* Trace function prototype */
95 TP_PROTO(struct net_device
*netdev
,
96 /* virtual address and size */
99 /* dma map address and size */
102 /* buffer pool id, if relevant */
105 /* Repeat argument list here */
106 TP_ARGS(netdev
, vaddr
, size
, dma_addr
, map_size
, bpid
),
108 /* A structure containing the relevant information we want
109 * to record. Declare name and type for each normal element,
110 * name, type and size for arrays. Use __string for variable
114 __field(void *, vaddr
)
115 __field(size_t, size
)
116 __field(dma_addr_t
, dma_addr
)
117 __field(size_t, map_size
)
119 __string(name
, netdev
->name
)
122 /* The function that assigns values to the above declared
126 __entry
->vaddr
= vaddr
;
127 __entry
->size
= size
;
128 __entry
->dma_addr
= dma_addr
;
129 __entry
->map_size
= map_size
;
130 __entry
->bpid
= bpid
;
131 __assign_str(name
, netdev
->name
);
134 /* This is what gets printed when the trace event is
137 TP_printk(TR_BUF_FMT
,
146 /* If only one event of a certain type needs to be declared, use TRACE_EVENT().
147 * The syntax is the same as for DECLARE_EVENT_CLASS().
150 #endif /* _DPAA2_ETH_TRACE_H */
152 /* This must be outside ifdef _DPAA2_ETH_TRACE_H */
153 #undef TRACE_INCLUDE_PATH
154 #define TRACE_INCLUDE_PATH .
155 #undef TRACE_INCLUDE_FILE
156 #define TRACE_INCLUDE_FILE dpaa2-eth-trace
157 #include <trace/define_trace.h>