drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_trace.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_trace.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_trace.h
Extension
.h
Size
5045 bytes
Lines
182
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 hns3

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

#include <linux/tracepoint.h>

#define PF_DESC_LEN	(sizeof(struct hclge_desc) / sizeof(u32))
#define PF_GET_MBX_LEN	(sizeof(struct hclge_mbx_vf_to_pf_cmd) / sizeof(u32))
#define PF_SEND_MBX_LEN	(sizeof(struct hclge_mbx_pf_to_vf_cmd) / sizeof(u32))

TRACE_EVENT(hclge_pf_mbx_get,
	TP_PROTO(
		struct hclge_dev *hdev,
		struct hclge_mbx_vf_to_pf_cmd *req),
	TP_ARGS(hdev, req),

	TP_STRUCT__entry(
		__field(u8, vfid)
		__field(u8, code)
		__field(u8, subcode)
		__string(pciname, pci_name(hdev->pdev))
		__string(devname, hdev->vport[0].nic.kinfo.netdev->name)
		__array(u32, mbx_data, PF_GET_MBX_LEN)
	),

	TP_fast_assign(
		__entry->vfid = req->mbx_src_vfid;
		__entry->code = req->msg.code;
		__entry->subcode = req->msg.subcode;
		__assign_str(pciname);
		__assign_str(devname);
		memcpy(__entry->mbx_data, req,
		       sizeof(struct hclge_mbx_vf_to_pf_cmd));
	),

	TP_printk(
		"%s %s vfid:%u code:%u subcode:%u data:%s",
		__get_str(pciname), __get_str(devname), __entry->vfid,
		__entry->code, __entry->subcode,
		__print_array(__entry->mbx_data, PF_GET_MBX_LEN, sizeof(u32))
	)
);

TRACE_EVENT(hclge_pf_mbx_send,
	TP_PROTO(
		struct hclge_dev *hdev,
		struct hclge_mbx_pf_to_vf_cmd *req),
	TP_ARGS(hdev, req),

	TP_STRUCT__entry(
		__field(u8, vfid)
		__field(u16, code)
		__string(pciname, pci_name(hdev->pdev))
		__string(devname, hdev->vport[0].nic.kinfo.netdev->name)
		__array(u32, mbx_data, PF_SEND_MBX_LEN)
	),

	TP_fast_assign(
		__entry->vfid = req->dest_vfid;
		__entry->code = le16_to_cpu(req->msg.code);
		__assign_str(pciname);
		__assign_str(devname);
		memcpy(__entry->mbx_data, req,
		       sizeof(struct hclge_mbx_pf_to_vf_cmd));
	),

	TP_printk(
		"%s %s vfid:%u code:%u data:%s",
		__get_str(pciname), __get_str(devname), __entry->vfid,
		__entry->code,
		__print_array(__entry->mbx_data, PF_SEND_MBX_LEN, sizeof(u32))
	)
);

DECLARE_EVENT_CLASS(hclge_pf_cmd_template,
		    TP_PROTO(struct hclge_comm_hw *hw,
			     struct hclge_desc *desc,
			     int index,
			     int num),
		    TP_ARGS(hw, desc, index, num),

		    TP_STRUCT__entry(__field(u16, opcode)
			__field(u16, flag)
			__field(u16, retval)
			__field(u16, rsv)
			__field(int, index)
			__field(int, num)
			__string(pciname, pci_name(hw->cmq.csq.pdev))

Annotation

Implementation Notes