xref: /linux/drivers/infiniband/hw/hfi1/trace_rx.h (revision 36ec807b627b4c0a0a382f0ae48eac7187d14b2b)
13ec648c6SKrzysztof Kozlowski /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2462b6b21SSebastian Sanchez /*
3a131d164SKaike Wan  * Copyright(c) 2015 - 2018 Intel Corporation.
4462b6b21SSebastian Sanchez  */
5145eba1aSCai Huoqing 
6462b6b21SSebastian Sanchez #if !defined(__HFI1_TRACE_RX_H) || defined(TRACE_HEADER_MULTI_READ)
7462b6b21SSebastian Sanchez #define __HFI1_TRACE_RX_H
8462b6b21SSebastian Sanchez 
9462b6b21SSebastian Sanchez #include <linux/tracepoint.h>
10462b6b21SSebastian Sanchez #include <linux/trace_seq.h>
11462b6b21SSebastian Sanchez 
12462b6b21SSebastian Sanchez #include "hfi.h"
13462b6b21SSebastian Sanchez 
148cb1021bSMike Marciniszyn #define tidtype_name(type) { PT_##type, #type }
158cb1021bSMike Marciniszyn #define show_tidtype(type)                   \
168cb1021bSMike Marciniszyn __print_symbolic(type,                       \
178cb1021bSMike Marciniszyn 	tidtype_name(EXPECTED),              \
188cb1021bSMike Marciniszyn 	tidtype_name(EAGER),                 \
198cb1021bSMike Marciniszyn 	tidtype_name(INVALID))               \
208cb1021bSMike Marciniszyn 
21462b6b21SSebastian Sanchez #undef TRACE_SYSTEM
22462b6b21SSebastian Sanchez #define TRACE_SYSTEM hfi1_rx
23462b6b21SSebastian Sanchez 
24462b6b21SSebastian Sanchez TRACE_EVENT(hfi1_rcvhdr,
256197a815SDon Hiatt 	    TP_PROTO(struct hfi1_packet *packet),
266197a815SDon Hiatt 	    TP_ARGS(packet),
27aca7f4fcSSebastian Sanchez 	    TP_STRUCT__entry(DD_DEV_ENTRY(packet->rcd->dd)
28462b6b21SSebastian Sanchez 			     __field(u64, eflags)
29462b6b21SSebastian Sanchez 			     __field(u32, ctxt)
30462b6b21SSebastian Sanchez 			     __field(u32, etype)
31462b6b21SSebastian Sanchez 			     __field(u32, hlen)
32462b6b21SSebastian Sanchez 			     __field(u32, tlen)
33462b6b21SSebastian Sanchez 			     __field(u32, updegr)
34462b6b21SSebastian Sanchez 			     __field(u32, etail)
35462b6b21SSebastian Sanchez 			     ),
36aca7f4fcSSebastian Sanchez 	     TP_fast_assign(DD_DEV_ASSIGN(packet->rcd->dd);
37aca7f4fcSSebastian Sanchez 			    __entry->eflags = rhf_err_flags(packet->rhf);
38aca7f4fcSSebastian Sanchez 			    __entry->ctxt = packet->rcd->ctxt;
396197a815SDon Hiatt 			    __entry->etype = packet->etype;
40aca7f4fcSSebastian Sanchez 			    __entry->hlen = packet->hlen;
41aca7f4fcSSebastian Sanchez 			    __entry->tlen = packet->tlen;
42aca7f4fcSSebastian Sanchez 			    __entry->updegr = packet->updegr;
43aca7f4fcSSebastian Sanchez 			    __entry->etail = rhf_egr_index(packet->rhf);
44462b6b21SSebastian Sanchez 			    ),
45462b6b21SSebastian Sanchez 	     TP_printk(
46462b6b21SSebastian Sanchez 		"[%s] ctxt %d eflags 0x%llx etype %d,%s hlen %d tlen %d updegr %d etail %d",
47462b6b21SSebastian Sanchez 		__get_str(dev),
48462b6b21SSebastian Sanchez 		__entry->ctxt,
49462b6b21SSebastian Sanchez 		__entry->eflags,
50462b6b21SSebastian Sanchez 		__entry->etype, show_packettype(__entry->etype),
51462b6b21SSebastian Sanchez 		__entry->hlen,
52462b6b21SSebastian Sanchez 		__entry->tlen,
53462b6b21SSebastian Sanchez 		__entry->updegr,
54462b6b21SSebastian Sanchez 		__entry->etail
55462b6b21SSebastian Sanchez 		)
56462b6b21SSebastian Sanchez );
57462b6b21SSebastian Sanchez 
58462b6b21SSebastian Sanchez TRACE_EVENT(hfi1_receive_interrupt,
59d295dbebSMichael J. Ruhl 	    TP_PROTO(struct hfi1_devdata *dd, struct hfi1_ctxtdata *rcd),
60d295dbebSMichael J. Ruhl 	    TP_ARGS(dd, rcd),
61462b6b21SSebastian Sanchez 	    TP_STRUCT__entry(DD_DEV_ENTRY(dd)
62462b6b21SSebastian Sanchez 			     __field(u32, ctxt)
63462b6b21SSebastian Sanchez 			     __field(u8, slow_path)
64462b6b21SSebastian Sanchez 			     __field(u8, dma_rtail)
65462b6b21SSebastian Sanchez 			     ),
66462b6b21SSebastian Sanchez 	    TP_fast_assign(DD_DEV_ASSIGN(dd);
67d295dbebSMichael J. Ruhl 			__entry->ctxt = rcd->ctxt;
6801c7fc50SMike Marciniszyn 			__entry->slow_path = hfi1_is_slowpath(rcd);
692fb3b5aeSMike Marciniszyn 			__entry->dma_rtail = get_dma_rtail_setting(rcd);
70462b6b21SSebastian Sanchez 			),
71462b6b21SSebastian Sanchez 	    TP_printk("[%s] ctxt %d SlowPath: %d DmaRtail: %d",
72462b6b21SSebastian Sanchez 		      __get_str(dev),
73462b6b21SSebastian Sanchez 		      __entry->ctxt,
74462b6b21SSebastian Sanchez 		      __entry->slow_path,
75462b6b21SSebastian Sanchez 		      __entry->dma_rtail
76462b6b21SSebastian Sanchez 		      )
77462b6b21SSebastian Sanchez );
78462b6b21SSebastian Sanchez 
79462b6b21SSebastian Sanchez TRACE_EVENT(hfi1_mmu_invalidate,
80462b6b21SSebastian Sanchez 	    TP_PROTO(unsigned int ctxt, u16 subctxt, const char *type,
81462b6b21SSebastian Sanchez 		     unsigned long start, unsigned long end),
82462b6b21SSebastian Sanchez 	    TP_ARGS(ctxt, subctxt, type, start, end),
83462b6b21SSebastian Sanchez 	    TP_STRUCT__entry(
84462b6b21SSebastian Sanchez 			     __field(unsigned int, ctxt)
85462b6b21SSebastian Sanchez 			     __field(u16, subctxt)
86462b6b21SSebastian Sanchez 			     __string(type, type)
87462b6b21SSebastian Sanchez 			     __field(unsigned long, start)
88462b6b21SSebastian Sanchez 			     __field(unsigned long, end)
89462b6b21SSebastian Sanchez 			     ),
90462b6b21SSebastian Sanchez 	    TP_fast_assign(
91462b6b21SSebastian Sanchez 			__entry->ctxt = ctxt;
92462b6b21SSebastian Sanchez 			__entry->subctxt = subctxt;
93*2c92ca84SSteven Rostedt (Google) 			__assign_str(type);
94462b6b21SSebastian Sanchez 			__entry->start = start;
95462b6b21SSebastian Sanchez 			__entry->end = end;
96462b6b21SSebastian Sanchez 	    ),
97462b6b21SSebastian Sanchez 	    TP_printk("[%3u:%02u] MMU Invalidate (%s) 0x%lx - 0x%lx",
98462b6b21SSebastian Sanchez 		      __entry->ctxt,
99462b6b21SSebastian Sanchez 		      __entry->subctxt,
100462b6b21SSebastian Sanchez 		      __get_str(type),
101462b6b21SSebastian Sanchez 		      __entry->start,
102462b6b21SSebastian Sanchez 		      __entry->end
103462b6b21SSebastian Sanchez 		      )
104462b6b21SSebastian Sanchez 	    );
105462b6b21SSebastian Sanchez 
106462b6b21SSebastian Sanchez #endif /* __HFI1_TRACE_RX_H */
107462b6b21SSebastian Sanchez 
108462b6b21SSebastian Sanchez #undef TRACE_INCLUDE_PATH
109462b6b21SSebastian Sanchez #undef TRACE_INCLUDE_FILE
110462b6b21SSebastian Sanchez #define TRACE_INCLUDE_PATH .
111462b6b21SSebastian Sanchez #define TRACE_INCLUDE_FILE trace_rx
112462b6b21SSebastian Sanchez #include <trace/define_trace.h>
113