1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Marvell RVU Admin Function driver
3  *
4  * Copyright (C) 2020 Marvell.
5  *
6  */
7 
8 #undef TRACE_SYSTEM
9 #define TRACE_SYSTEM rvu
10 
11 #if !defined(__RVU_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
12 #define __RVU_TRACE_H
13 
14 #include <linux/types.h>
15 #include <linux/tracepoint.h>
16 #include <linux/pci.h>
17 
18 #include "mbox.h"
19 
20 TRACE_EVENT(otx2_msg_alloc,
21 	    TP_PROTO(const struct pci_dev *pdev, u16 id, u64 size),
22 	    TP_ARGS(pdev, id, size),
23 	    TP_STRUCT__entry(__string(dev, pci_name(pdev))
24 			     __field(u16, id)
25 			     __field(u64, size)
26 	    ),
27 	    TP_fast_assign(__assign_str(dev, pci_name(pdev));
28 			   __entry->id = id;
29 			   __entry->size = size;
30 	    ),
31 	    TP_printk("[%s] msg:(%s) size:%lld\n", __get_str(dev),
32 		      otx2_mbox_id2name(__entry->id), __entry->size)
33 );
34 
35 TRACE_EVENT(otx2_msg_send,
36 	    TP_PROTO(const struct pci_dev *pdev, u16 num_msgs, u64 msg_size),
37 	    TP_ARGS(pdev, num_msgs, msg_size),
38 	    TP_STRUCT__entry(__string(dev, pci_name(pdev))
39 			     __field(u16, num_msgs)
40 			     __field(u64, msg_size)
41 	    ),
42 	    TP_fast_assign(__assign_str(dev, pci_name(pdev));
43 			   __entry->num_msgs = num_msgs;
44 			   __entry->msg_size = msg_size;
45 	    ),
46 	    TP_printk("[%s] sent %d msg(s) of size:%lld\n", __get_str(dev),
47 		      __entry->num_msgs, __entry->msg_size)
48 );
49 
50 TRACE_EVENT(otx2_msg_check,
51 	    TP_PROTO(const struct pci_dev *pdev, u16 reqid, u16 rspid, int rc),
52 	    TP_ARGS(pdev, reqid, rspid, rc),
53 	    TP_STRUCT__entry(__string(dev, pci_name(pdev))
54 			     __field(u16, reqid)
55 			     __field(u16, rspid)
56 			     __field(int, rc)
57 	    ),
58 	    TP_fast_assign(__assign_str(dev, pci_name(pdev));
59 			   __entry->reqid = reqid;
60 			   __entry->rspid = rspid;
61 			   __entry->rc = rc;
62 	    ),
63 	    TP_printk("[%s] req->id:0x%x rsp->id:0x%x resp_code:%d\n",
64 		      __get_str(dev), __entry->reqid,
65 		      __entry->rspid, __entry->rc)
66 );
67 
68 TRACE_EVENT(otx2_msg_interrupt,
69 	    TP_PROTO(const struct pci_dev *pdev, const char *msg, u64 intr),
70 	    TP_ARGS(pdev, msg, intr),
71 	    TP_STRUCT__entry(__string(dev, pci_name(pdev))
72 			     __string(str, msg)
73 			     __field(u64, intr)
74 	    ),
75 	    TP_fast_assign(__assign_str(dev, pci_name(pdev));
76 			   __assign_str(str, msg);
77 			   __entry->intr = intr;
78 	    ),
79 	    TP_printk("[%s] mbox interrupt %s (0x%llx)\n", __get_str(dev),
80 		      __get_str(str), __entry->intr)
81 );
82 
83 TRACE_EVENT(otx2_msg_process,
84 	    TP_PROTO(const struct pci_dev *pdev, u16 id, int err),
85 	    TP_ARGS(pdev, id, err),
86 	    TP_STRUCT__entry(__string(dev, pci_name(pdev))
87 			     __field(u16, id)
88 			     __field(int, err)
89 	    ),
90 	    TP_fast_assign(__assign_str(dev, pci_name(pdev));
91 			   __entry->id = id;
92 			   __entry->err = err;
93 	    ),
94 	    TP_printk("[%s] msg:(%s) error:%d\n", __get_str(dev),
95 		      otx2_mbox_id2name(__entry->id), __entry->err)
96 );
97 
98 #endif /* __RVU_TRACE_H */
99 
100 #undef TRACE_INCLUDE_PATH
101 #define TRACE_INCLUDE_PATH .
102 
103 #undef TRACE_INCLUDE_FILE
104 #define TRACE_INCLUDE_FILE rvu_trace
105 
106 #include <trace/define_trace.h>
107