2 * Copyright(c) 2015 - 2018 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>
55 #define tidtype_name(type) { PT_##type, #type }
56 #define show_tidtype(type) \
57 __print_symbolic(type, \
58 tidtype_name(EXPECTED), \
59 tidtype_name(EAGER), \
60 tidtype_name(INVALID)) \
63 #define TRACE_SYSTEM hfi1_rx
65 TRACE_EVENT(hfi1_rcvhdr,
66 TP_PROTO(struct hfi1_packet *packet),
68 TP_STRUCT__entry(DD_DEV_ENTRY(packet->rcd->dd)
77 TP_fast_assign(DD_DEV_ASSIGN(packet->rcd->dd);
78 __entry->eflags = rhf_err_flags(packet->rhf);
79 __entry->ctxt = packet->rcd->ctxt;
80 __entry->etype = packet->etype;
81 __entry->hlen = packet->hlen;
82 __entry->tlen = packet->tlen;
83 __entry->updegr = packet->updegr;
84 __entry->etail = rhf_egr_index(packet->rhf);
87 "[%s] ctxt %d eflags 0x%llx etype %d,%s hlen %d tlen %d updegr %d etail %d",
91 __entry->etype, show_packettype(__entry->etype),
99 TRACE_EVENT(hfi1_receive_interrupt,
100 TP_PROTO(struct hfi1_devdata *dd, struct hfi1_ctxtdata *rcd),
102 TP_STRUCT__entry(DD_DEV_ENTRY(dd)
104 __field(u8, slow_path)
105 __field(u8, dma_rtail)
107 TP_fast_assign(DD_DEV_ASSIGN(dd);
108 __entry->ctxt = rcd->ctxt;
109 if (rcd->do_interrupt ==
110 &handle_receive_interrupt) {
111 __entry->slow_path = 1;
112 __entry->dma_rtail = 0xFF;
113 } else if (rcd->do_interrupt ==
114 &handle_receive_interrupt_dma_rtail){
115 __entry->dma_rtail = 1;
116 __entry->slow_path = 0;
117 } else if (rcd->do_interrupt ==
118 &handle_receive_interrupt_nodma_rtail) {
119 __entry->dma_rtail = 0;
120 __entry->slow_path = 0;
123 TP_printk("[%s] ctxt %d SlowPath: %d DmaRtail: %d",
131 TRACE_EVENT(hfi1_mmu_invalidate,
132 TP_PROTO(unsigned int ctxt, u16 subctxt, const char *type,
133 unsigned long start, unsigned long end),
134 TP_ARGS(ctxt, subctxt, type, start, end),
136 __field(unsigned int, ctxt)
137 __field(u16, subctxt)
139 __field(unsigned long, start)
140 __field(unsigned long, end)
143 __entry->ctxt = ctxt;
144 __entry->subctxt = subctxt;
145 __assign_str(type, type);
146 __entry->start = start;
149 TP_printk("[%3u:%02u] MMU Invalidate (%s) 0x%lx - 0x%lx",
158 #endif /* __HFI1_TRACE_RX_H */
160 #undef TRACE_INCLUDE_PATH
161 #undef TRACE_INCLUDE_FILE
162 #define TRACE_INCLUDE_PATH .
163 #define TRACE_INCLUDE_FILE trace_rx
164 #include <trace/define_trace.h>