drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-trace.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-trace.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-trace.h
Extension
.h
Size
5400 bytes
Lines
198
Domain
Driver Families
Bucket
drivers/net
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

#undef TRACE_SYSTEM
#define TRACE_SYSTEM	dpaa2_eth

#if !defined(_DPAA2_ETH_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
#define _DPAA2_ETH_TRACE_H

#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/tracepoint.h>

#define TR_FMT "[%s] fd: addr=0x%llx, len=%u, off=%u"
/* trace_printk format for raw buffer event class */
#define TR_BUF_FMT "[%s] vaddr=%p size=%zu dma_addr=%pad map_size=%zu bpid=%d"

/* This is used to declare a class of events.
 * individual events of this type will be defined below.
 */

/* Store details about a frame descriptor */
DECLARE_EVENT_CLASS(dpaa2_eth_fd,
		    /* Trace function prototype */
		    TP_PROTO(struct net_device *netdev,
			     const struct dpaa2_fd *fd),

		    /* Repeat argument list here */
		    TP_ARGS(netdev, fd),

		    /* A structure containing the relevant information we want
		     * to record. Declare name and type for each normal element,
		     * name, type and size for arrays. Use __string for variable
		     * length strings.
		     */
		    TP_STRUCT__entry(
				     __field(u64, fd_addr)
				     __field(u32, fd_len)
				     __field(u16, fd_offset)
				     __string(name, netdev->name)
		    ),

		    /* The function that assigns values to the above declared
		     * fields
		     */
		    TP_fast_assign(
				   __entry->fd_addr = dpaa2_fd_get_addr(fd);
				   __entry->fd_len = dpaa2_fd_get_len(fd);
				   __entry->fd_offset = dpaa2_fd_get_offset(fd);
				   __assign_str(name);
		    ),

		    /* This is what gets printed when the trace event is
		     * triggered.
		     */
		    TP_printk(TR_FMT,
			      __get_str(name),
			      __entry->fd_addr,
			      __entry->fd_len,
			      __entry->fd_offset)
);

/* Now declare events of the above type. Format is:
 * DEFINE_EVENT(class, name, proto, args), with proto and args same as for class
 */

/* Tx (egress) fd */
DEFINE_EVENT(dpaa2_eth_fd, dpaa2_tx_fd,
	     TP_PROTO(struct net_device *netdev,
		      const struct dpaa2_fd *fd),

	     TP_ARGS(netdev, fd)
);

/* Tx (egress) XSK fd */
DEFINE_EVENT(dpaa2_eth_fd, dpaa2_tx_xsk_fd,
	     TP_PROTO(struct net_device *netdev,
		      const struct dpaa2_fd *fd),

	     TP_ARGS(netdev, fd)
);

/* Rx fd */
DEFINE_EVENT(dpaa2_eth_fd, dpaa2_rx_fd,
	     TP_PROTO(struct net_device *netdev,
		      const struct dpaa2_fd *fd),

	     TP_ARGS(netdev, fd)
);

/* Rx XSK fd */
DEFINE_EVENT(dpaa2_eth_fd, dpaa2_rx_xsk_fd,
	     TP_PROTO(struct net_device *netdev,

Annotation

Implementation Notes