1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /* Copyright (c) 2018-2019 Hisilicon Limited. */
4 /* This must be outside ifdef _HCLGEVF_TRACE_H */
6 #define TRACE_SYSTEM hns3
8 #if !defined(_HCLGEVF_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
9 #define _HCLGEVF_TRACE_H_
11 #include <linux/tracepoint.h>
13 #define VF_GET_MBX_LEN (sizeof(struct hclge_mbx_pf_to_vf_cmd) / sizeof(u32))
14 #define VF_SEND_MBX_LEN (sizeof(struct hclge_mbx_vf_to_pf_cmd) / sizeof(u32))
16 TRACE_EVENT(hclge_vf_mbx_get
,
18 struct hclgevf_dev
*hdev
,
19 struct hclge_mbx_pf_to_vf_cmd
*req
),
25 __string(pciname
, pci_name(hdev
->pdev
))
26 __string(devname
, &hdev
->nic
.kinfo
.netdev
->name
)
27 __array(u32
, mbx_data
, VF_GET_MBX_LEN
)
31 __entry
->vfid
= req
->dest_vfid
;
32 __entry
->code
= req
->msg
.code
;
33 __assign_str(pciname
, pci_name(hdev
->pdev
));
34 __assign_str(devname
, &hdev
->nic
.kinfo
.netdev
->name
);
35 memcpy(__entry
->mbx_data
, req
,
36 sizeof(struct hclge_mbx_pf_to_vf_cmd
));
40 "%s %s vfid:%u code:%u data:%s",
41 __get_str(pciname
), __get_str(devname
), __entry
->vfid
,
43 __print_array(__entry
->mbx_data
, VF_GET_MBX_LEN
, sizeof(u32
))
47 TRACE_EVENT(hclge_vf_mbx_send
,
49 struct hclgevf_dev
*hdev
,
50 struct hclge_mbx_vf_to_pf_cmd
*req
),
57 __string(pciname
, pci_name(hdev
->pdev
))
58 __string(devname
, &hdev
->nic
.kinfo
.netdev
->name
)
59 __array(u32
, mbx_data
, VF_SEND_MBX_LEN
)
63 __entry
->vfid
= req
->mbx_src_vfid
;
64 __entry
->code
= req
->msg
.code
;
65 __entry
->subcode
= req
->msg
.subcode
;
66 __assign_str(pciname
, pci_name(hdev
->pdev
));
67 __assign_str(devname
, &hdev
->nic
.kinfo
.netdev
->name
);
68 memcpy(__entry
->mbx_data
, req
,
69 sizeof(struct hclge_mbx_vf_to_pf_cmd
));
73 "%s %s vfid:%u code:%u subcode:%u data:%s",
74 __get_str(pciname
), __get_str(devname
), __entry
->vfid
,
75 __entry
->code
, __entry
->subcode
,
76 __print_array(__entry
->mbx_data
, VF_SEND_MBX_LEN
, sizeof(u32
))
80 #endif /* _HCLGEVF_TRACE_H_ */
82 /* This must be outside ifdef _HCLGEVF_TRACE_H */
83 #undef TRACE_INCLUDE_PATH
84 #define TRACE_INCLUDE_PATH .
85 #undef TRACE_INCLUDE_FILE
86 #define TRACE_INCLUDE_FILE hclgevf_trace
87 #include <trace/define_trace.h>