2 * Copyright(c) 2015, 2016 Intel Corporation.
4 * This file is provided under a dual BSD/GPLv2 license. When using or
5 * redistributing this file, you may do so under either license.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of version 2 of the GNU General Public License as
11 * published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
20 * Redistribution and use in source and binary forms, with or without
21 * modification, are permitted provided that the following conditions
24 * - Redistributions of source code must retain the above copyright
25 * notice, this list of conditions and the following disclaimer.
26 * - Redistributions in binary form must reproduce the above copyright
27 * notice, this list of conditions and the following disclaimer in
28 * the documentation and/or other materials provided with the
30 * - Neither the name of Intel Corporation nor the names of its
31 * contributors may be used to endorse or promote products derived
32 * from this software without specific prior written permission.
34 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
35 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
36 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
37 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
38 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
39 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
40 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
41 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
42 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
43 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
44 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47 #if !defined(__HFI1_TRACE_RX_H) || defined(TRACE_HEADER_MULTI_READ)
48 #define __HFI1_TRACE_RX_H
50 #include <linux/tracepoint.h>
51 #include <linux/trace_seq.h>
56 #define TRACE_SYSTEM hfi1_rx
58 TRACE_EVENT(hfi1_rcvhdr,
59 TP_PROTO(struct hfi1_devdata *dd,
68 TP_ARGS(dd, ctxt, eflags, etype, hlen, tlen, updegr, etail),
69 TP_STRUCT__entry(DD_DEV_ENTRY(dd)
78 TP_fast_assign(DD_DEV_ASSIGN(dd);
79 __entry->eflags = eflags;
81 __entry->etype = etype;
84 __entry->updegr = updegr;
85 __entry->etail = etail;
88 "[%s] ctxt %d eflags 0x%llx etype %d,%s hlen %d tlen %d updegr %d etail %d",
92 __entry->etype, show_packettype(__entry->etype),
100 TRACE_EVENT(hfi1_receive_interrupt,
101 TP_PROTO(struct hfi1_devdata *dd, u32 ctxt),
103 TP_STRUCT__entry(DD_DEV_ENTRY(dd)
105 __field(u8, slow_path)
106 __field(u8, dma_rtail)
108 TP_fast_assign(DD_DEV_ASSIGN(dd);
109 __entry->ctxt = ctxt;
110 if (dd->rcd[ctxt]->do_interrupt ==
111 &handle_receive_interrupt) {
112 __entry->slow_path = 1;
113 __entry->dma_rtail = 0xFF;
114 } else if (dd->rcd[ctxt]->do_interrupt ==
115 &handle_receive_interrupt_dma_rtail){
116 __entry->dma_rtail = 1;
117 __entry->slow_path = 0;
118 } else if (dd->rcd[ctxt]->do_interrupt ==
119 &handle_receive_interrupt_nodma_rtail) {
120 __entry->dma_rtail = 0;
121 __entry->slow_path = 0;
124 TP_printk("[%s] ctxt %d SlowPath: %d DmaRtail: %d",
132 TRACE_EVENT(hfi1_exp_tid_reg,
133 TP_PROTO(unsigned int ctxt, u16 subctxt, u32 rarr,
134 u32 npages, unsigned long va, unsigned long pa,
136 TP_ARGS(ctxt, subctxt, rarr, npages, va, pa, dma),
138 __field(unsigned int, ctxt)
139 __field(u16, subctxt)
142 __field(unsigned long, va)
143 __field(unsigned long, pa)
144 __field(dma_addr_t, dma)
147 __entry->ctxt = ctxt;
148 __entry->subctxt = subctxt;
149 __entry->rarr = rarr;
150 __entry->npages = npages;
155 TP_printk("[%u:%u] entry:%u, %u pages @ 0x%lx, va:0x%lx dma:0x%llx",
166 TRACE_EVENT(hfi1_exp_tid_unreg,
167 TP_PROTO(unsigned int ctxt, u16 subctxt, u32 rarr, u32 npages,
168 unsigned long va, unsigned long pa, dma_addr_t dma),
169 TP_ARGS(ctxt, subctxt, rarr, npages, va, pa, dma),
171 __field(unsigned int, ctxt)
172 __field(u16, subctxt)
175 __field(unsigned long, va)
176 __field(unsigned long, pa)
177 __field(dma_addr_t, dma)
180 __entry->ctxt = ctxt;
181 __entry->subctxt = subctxt;
182 __entry->rarr = rarr;
183 __entry->npages = npages;
188 TP_printk("[%u:%u] entry:%u, %u pages @ 0x%lx, va:0x%lx dma:0x%llx",
199 TRACE_EVENT(hfi1_exp_tid_inval,
200 TP_PROTO(unsigned int ctxt, u16 subctxt, unsigned long va, u32 rarr,
201 u32 npages, dma_addr_t dma),
202 TP_ARGS(ctxt, subctxt, va, rarr, npages, dma),
204 __field(unsigned int, ctxt)
205 __field(u16, subctxt)
206 __field(unsigned long, va)
209 __field(dma_addr_t, dma)
212 __entry->ctxt = ctxt;
213 __entry->subctxt = subctxt;
215 __entry->rarr = rarr;
216 __entry->npages = npages;
219 TP_printk("[%u:%u] entry:%u, %u pages @ 0x%lx dma: 0x%llx",
229 TRACE_EVENT(hfi1_mmu_invalidate,
230 TP_PROTO(unsigned int ctxt, u16 subctxt, const char *type,
231 unsigned long start, unsigned long end),
232 TP_ARGS(ctxt, subctxt, type, start, end),
234 __field(unsigned int, ctxt)
235 __field(u16, subctxt)
237 __field(unsigned long, start)
238 __field(unsigned long, end)
241 __entry->ctxt = ctxt;
242 __entry->subctxt = subctxt;
243 __assign_str(type, type);
244 __entry->start = start;
247 TP_printk("[%3u:%02u] MMU Invalidate (%s) 0x%lx - 0x%lx",
256 #endif /* __HFI1_TRACE_RX_H */
258 #undef TRACE_INCLUDE_PATH
259 #undef TRACE_INCLUDE_FILE
260 #define TRACE_INCLUDE_PATH .
261 #define TRACE_INCLUDE_FILE trace_rx
262 #include <trace/define_trace.h>