xref: /linux/drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.h (revision c771600c6af14749609b49565ffb4cac2959710d)
149142d12SSubbaraya Sundeep /* SPDX-License-Identifier: GPL-2.0 */
2c7cd6c5aSSunil Goutham /* Marvell RVU Admin Function driver
349142d12SSubbaraya Sundeep  *
4c7cd6c5aSSunil Goutham  * Copyright (C) 2020 Marvell.
5c7cd6c5aSSunil Goutham  *
649142d12SSubbaraya Sundeep  */
749142d12SSubbaraya Sundeep 
849142d12SSubbaraya Sundeep #undef TRACE_SYSTEM
949142d12SSubbaraya Sundeep #define TRACE_SYSTEM rvu
1049142d12SSubbaraya Sundeep 
1149142d12SSubbaraya Sundeep #if !defined(__RVU_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
1249142d12SSubbaraya Sundeep #define __RVU_TRACE_H
1349142d12SSubbaraya Sundeep 
1449142d12SSubbaraya Sundeep #include <linux/types.h>
1549142d12SSubbaraya Sundeep #include <linux/tracepoint.h>
1649142d12SSubbaraya Sundeep #include <linux/pci.h>
1749142d12SSubbaraya Sundeep 
183bdba2c7SJerin Jacob #include "mbox.h"
193bdba2c7SJerin Jacob 
2049142d12SSubbaraya Sundeep TRACE_EVENT(otx2_msg_alloc,
2149142d12SSubbaraya Sundeep 	    TP_PROTO(const struct pci_dev *pdev, u16 id, u64 size),
2249142d12SSubbaraya Sundeep 	    TP_ARGS(pdev, id, size),
2349142d12SSubbaraya Sundeep 	    TP_STRUCT__entry(__string(dev, pci_name(pdev))
2449142d12SSubbaraya Sundeep 			     __field(u16, id)
2549142d12SSubbaraya Sundeep 			     __field(u64, size)
2649142d12SSubbaraya Sundeep 	    ),
27*2c92ca84SSteven Rostedt (Google) 	    TP_fast_assign(__assign_str(dev);
2849142d12SSubbaraya Sundeep 			   __entry->id = id;
2949142d12SSubbaraya Sundeep 			   __entry->size = size;
3049142d12SSubbaraya Sundeep 	    ),
313bdba2c7SJerin Jacob 	    TP_printk("[%s] msg:(%s) size:%lld\n", __get_str(dev),
323bdba2c7SJerin Jacob 		      otx2_mbox_id2name(__entry->id), __entry->size)
3349142d12SSubbaraya Sundeep );
3449142d12SSubbaraya Sundeep 
3549142d12SSubbaraya Sundeep TRACE_EVENT(otx2_msg_send,
3649142d12SSubbaraya Sundeep 	    TP_PROTO(const struct pci_dev *pdev, u16 num_msgs, u64 msg_size),
3749142d12SSubbaraya Sundeep 	    TP_ARGS(pdev, num_msgs, msg_size),
3849142d12SSubbaraya Sundeep 	    TP_STRUCT__entry(__string(dev, pci_name(pdev))
3949142d12SSubbaraya Sundeep 			     __field(u16, num_msgs)
4049142d12SSubbaraya Sundeep 			     __field(u64, msg_size)
4149142d12SSubbaraya Sundeep 	    ),
42*2c92ca84SSteven Rostedt (Google) 	    TP_fast_assign(__assign_str(dev);
4349142d12SSubbaraya Sundeep 			   __entry->num_msgs = num_msgs;
4449142d12SSubbaraya Sundeep 			   __entry->msg_size = msg_size;
4549142d12SSubbaraya Sundeep 	    ),
4649142d12SSubbaraya Sundeep 	    TP_printk("[%s] sent %d msg(s) of size:%lld\n", __get_str(dev),
4749142d12SSubbaraya Sundeep 		      __entry->num_msgs, __entry->msg_size)
4849142d12SSubbaraya Sundeep );
4949142d12SSubbaraya Sundeep 
5049142d12SSubbaraya Sundeep TRACE_EVENT(otx2_msg_check,
5149142d12SSubbaraya Sundeep 	    TP_PROTO(const struct pci_dev *pdev, u16 reqid, u16 rspid, int rc),
5249142d12SSubbaraya Sundeep 	    TP_ARGS(pdev, reqid, rspid, rc),
5349142d12SSubbaraya Sundeep 	    TP_STRUCT__entry(__string(dev, pci_name(pdev))
5449142d12SSubbaraya Sundeep 			     __field(u16, reqid)
5549142d12SSubbaraya Sundeep 			     __field(u16, rspid)
5649142d12SSubbaraya Sundeep 			     __field(int, rc)
5749142d12SSubbaraya Sundeep 	    ),
58*2c92ca84SSteven Rostedt (Google) 	    TP_fast_assign(__assign_str(dev);
5949142d12SSubbaraya Sundeep 			   __entry->reqid = reqid;
6049142d12SSubbaraya Sundeep 			   __entry->rspid = rspid;
6149142d12SSubbaraya Sundeep 			   __entry->rc = rc;
6249142d12SSubbaraya Sundeep 	    ),
6349142d12SSubbaraya Sundeep 	    TP_printk("[%s] req->id:0x%x rsp->id:0x%x resp_code:%d\n",
6449142d12SSubbaraya Sundeep 		      __get_str(dev), __entry->reqid,
6549142d12SSubbaraya Sundeep 		      __entry->rspid, __entry->rc)
6649142d12SSubbaraya Sundeep );
6749142d12SSubbaraya Sundeep 
6849142d12SSubbaraya Sundeep TRACE_EVENT(otx2_msg_interrupt,
6949142d12SSubbaraya Sundeep 	    TP_PROTO(const struct pci_dev *pdev, const char *msg, u64 intr),
7049142d12SSubbaraya Sundeep 	    TP_ARGS(pdev, msg, intr),
7149142d12SSubbaraya Sundeep 	    TP_STRUCT__entry(__string(dev, pci_name(pdev))
7249142d12SSubbaraya Sundeep 			     __string(str, msg)
7349142d12SSubbaraya Sundeep 			     __field(u64, intr)
7449142d12SSubbaraya Sundeep 	    ),
75*2c92ca84SSteven Rostedt (Google) 	    TP_fast_assign(__assign_str(dev);
76*2c92ca84SSteven Rostedt (Google) 			   __assign_str(str);
7749142d12SSubbaraya Sundeep 			   __entry->intr = intr;
7849142d12SSubbaraya Sundeep 	    ),
7949142d12SSubbaraya Sundeep 	    TP_printk("[%s] mbox interrupt %s (0x%llx)\n", __get_str(dev),
8049142d12SSubbaraya Sundeep 		      __get_str(str), __entry->intr)
8149142d12SSubbaraya Sundeep );
8249142d12SSubbaraya Sundeep 
8349142d12SSubbaraya Sundeep TRACE_EVENT(otx2_msg_process,
8449142d12SSubbaraya Sundeep 	    TP_PROTO(const struct pci_dev *pdev, u16 id, int err),
8549142d12SSubbaraya Sundeep 	    TP_ARGS(pdev, id, err),
8649142d12SSubbaraya Sundeep 	    TP_STRUCT__entry(__string(dev, pci_name(pdev))
8749142d12SSubbaraya Sundeep 			     __field(u16, id)
8849142d12SSubbaraya Sundeep 			     __field(int, err)
8949142d12SSubbaraya Sundeep 	    ),
90*2c92ca84SSteven Rostedt (Google) 	    TP_fast_assign(__assign_str(dev);
9149142d12SSubbaraya Sundeep 			   __entry->id = id;
9249142d12SSubbaraya Sundeep 			   __entry->err = err;
9349142d12SSubbaraya Sundeep 	    ),
943bdba2c7SJerin Jacob 	    TP_printk("[%s] msg:(%s) error:%d\n", __get_str(dev),
953bdba2c7SJerin Jacob 		      otx2_mbox_id2name(__entry->id), __entry->err)
9649142d12SSubbaraya Sundeep );
9749142d12SSubbaraya Sundeep 
9849142d12SSubbaraya Sundeep #endif /* __RVU_TRACE_H */
9949142d12SSubbaraya Sundeep 
10049142d12SSubbaraya Sundeep #undef TRACE_INCLUDE_PATH
10149142d12SSubbaraya Sundeep #define TRACE_INCLUDE_PATH .
10249142d12SSubbaraya Sundeep 
10349142d12SSubbaraya Sundeep #undef TRACE_INCLUDE_FILE
10449142d12SSubbaraya Sundeep #define TRACE_INCLUDE_FILE rvu_trace
10549142d12SSubbaraya Sundeep 
10649142d12SSubbaraya Sundeep #include <trace/define_trace.h>
107