2 * Copyright 2015 IBM Corp.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
11 #define TRACE_SYSTEM cxl
13 #if !defined(_CXL_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
16 #include <linux/tracepoint.h>
21 { CXL_PSL_DSISR_An_DS, "DS" }, \
22 { CXL_PSL_DSISR_An_DM, "DM" }, \
23 { CXL_PSL_DSISR_An_ST, "ST" }, \
24 { CXL_PSL_DSISR_An_UR, "UR" }, \
25 { CXL_PSL_DSISR_An_PE, "PE" }, \
26 { CXL_PSL_DSISR_An_AE, "AE" }, \
27 { CXL_PSL_DSISR_An_OC, "OC" }, \
28 { CXL_PSL_DSISR_An_M, "M" }, \
29 { CXL_PSL_DSISR_An_P, "P" }, \
30 { CXL_PSL_DSISR_An_A, "A" }, \
31 { CXL_PSL_DSISR_An_S, "S" }, \
32 { CXL_PSL_DSISR_An_K, "K" }
35 { CXL_PSL_TFC_An_A, "A" }, \
36 { CXL_PSL_TFC_An_C, "C" }, \
37 { CXL_PSL_TFC_An_AE, "AE" }, \
38 { CXL_PSL_TFC_An_R, "R" }
41 { CXL_SPA_SW_CMD_TERMINATE, "TERMINATE" }, \
42 { CXL_SPA_SW_CMD_REMOVE, "REMOVE" }, \
43 { CXL_SPA_SW_CMD_SUSPEND, "SUSPEND" }, \
44 { CXL_SPA_SW_CMD_RESUME, "RESUME" }, \
45 { CXL_SPA_SW_CMD_ADD, "ADD" }, \
46 { CXL_SPA_SW_CMD_UPDATE, "UPDATE" }
48 #define AFU_COMMANDS \
50 { CXL_AFU_Cntl_An_E, "ENABLE" }, \
51 { CXL_AFU_Cntl_An_RA, "RESET" }
53 #define PSL_COMMANDS \
54 { CXL_PSL_SCNTL_An_Pc, "PURGE" }, \
55 { CXL_PSL_SCNTL_An_Sc, "SUSPEND" }
58 DECLARE_EVENT_CLASS(cxl_pe_class
,
59 TP_PROTO(struct cxl_context
*ctx
),
70 __entry
->card
= ctx
->afu
->adapter
->adapter_num
;
71 __entry
->afu
= ctx
->afu
->slice
;
72 __entry
->pe
= ctx
->pe
;
75 TP_printk("afu%i.%i pe=%i",
83 TRACE_EVENT(cxl_attach
,
84 TP_PROTO(struct cxl_context
*ctx
, u64 wed
, s16 num_interrupts
, u64 amr
),
86 TP_ARGS(ctx
, wed
, num_interrupts
, amr
),
95 __field(s16
, num_interrupts
)
99 __entry
->card
= ctx
->afu
->adapter
->adapter_num
;
100 __entry
->afu
= ctx
->afu
->slice
;
101 __entry
->pe
= ctx
->pe
;
102 __entry
->pid
= pid_nr(ctx
->pid
);
105 __entry
->num_interrupts
= num_interrupts
;
108 TP_printk("afu%i.%i pid=%i pe=%i wed=0x%.16llx irqs=%i amr=0x%llx",
114 __entry
->num_interrupts
,
119 DEFINE_EVENT(cxl_pe_class
, cxl_detach
,
120 TP_PROTO(struct cxl_context
*ctx
),
124 TRACE_EVENT(cxl_afu_irq
,
125 TP_PROTO(struct cxl_context
*ctx
, int afu_irq
, int virq
, irq_hw_number_t hwirq
),
127 TP_ARGS(ctx
, afu_irq
, virq
, hwirq
),
133 __field(u16
, afu_irq
)
135 __field(irq_hw_number_t
, hwirq
)
139 __entry
->card
= ctx
->afu
->adapter
->adapter_num
;
140 __entry
->afu
= ctx
->afu
->slice
;
141 __entry
->pe
= ctx
->pe
;
142 __entry
->afu_irq
= afu_irq
;
143 __entry
->virq
= virq
;
144 __entry
->hwirq
= hwirq
;
147 TP_printk("afu%i.%i pe=%i afu_irq=%i virq=%i hwirq=0x%lx",
157 TRACE_EVENT(cxl_psl_irq
,
158 TP_PROTO(struct cxl_context
*ctx
, int irq
, u64 dsisr
, u64 dar
),
160 TP_ARGS(ctx
, irq
, dsisr
, dar
),
172 __entry
->card
= ctx
->afu
->adapter
->adapter_num
;
173 __entry
->afu
= ctx
->afu
->slice
;
174 __entry
->pe
= ctx
->pe
;
176 __entry
->dsisr
= dsisr
;
180 TP_printk("afu%i.%i pe=%i irq=%i dsisr=%s dar=0x%.16llx",
185 __print_flags(__entry
->dsisr
, "|", DSISR_FLAGS
),
190 TRACE_EVENT(cxl_psl_irq_ack
,
191 TP_PROTO(struct cxl_context
*ctx
, u64 tfc
),
203 __entry
->card
= ctx
->afu
->adapter
->adapter_num
;
204 __entry
->afu
= ctx
->afu
->slice
;
205 __entry
->pe
= ctx
->pe
;
209 TP_printk("afu%i.%i pe=%i tfc=%s",
213 __print_flags(__entry
->tfc
, "|", TFC_FLAGS
)
217 TRACE_EVENT(cxl_ste_miss
,
218 TP_PROTO(struct cxl_context
*ctx
, u64 dar
),
230 __entry
->card
= ctx
->afu
->adapter
->adapter_num
;
231 __entry
->afu
= ctx
->afu
->slice
;
232 __entry
->pe
= ctx
->pe
;
236 TP_printk("afu%i.%i pe=%i dar=0x%.16llx",
244 TRACE_EVENT(cxl_ste_write
,
245 TP_PROTO(struct cxl_context
*ctx
, unsigned int idx
, u64 e
, u64 v
),
247 TP_ARGS(ctx
, idx
, e
, v
),
253 __field(unsigned int, idx
)
259 __entry
->card
= ctx
->afu
->adapter
->adapter_num
;
260 __entry
->afu
= ctx
->afu
->slice
;
261 __entry
->pe
= ctx
->pe
;
267 TP_printk("afu%i.%i pe=%i SSTE[%i] E=0x%.16llx V=0x%.16llx",
277 TRACE_EVENT(cxl_pte_miss
,
278 TP_PROTO(struct cxl_context
*ctx
, u64 dsisr
, u64 dar
),
280 TP_ARGS(ctx
, dsisr
, dar
),
291 __entry
->card
= ctx
->afu
->adapter
->adapter_num
;
292 __entry
->afu
= ctx
->afu
->slice
;
293 __entry
->pe
= ctx
->pe
;
294 __entry
->dsisr
= dsisr
;
298 TP_printk("afu%i.%i pe=%i dsisr=%s dar=0x%.16llx",
302 __print_flags(__entry
->dsisr
, "|", DSISR_FLAGS
),
307 TRACE_EVENT(cxl_llcmd
,
308 TP_PROTO(struct cxl_context
*ctx
, u64 cmd
),
320 __entry
->card
= ctx
->afu
->adapter
->adapter_num
;
321 __entry
->afu
= ctx
->afu
->slice
;
322 __entry
->pe
= ctx
->pe
;
326 TP_printk("afu%i.%i pe=%i cmd=%s",
330 __print_symbolic_u64(__entry
->cmd
, LLCMD_NAMES
)
334 TRACE_EVENT(cxl_llcmd_done
,
335 TP_PROTO(struct cxl_context
*ctx
, u64 cmd
, int rc
),
337 TP_ARGS(ctx
, cmd
, rc
),
348 __entry
->card
= ctx
->afu
->adapter
->adapter_num
;
349 __entry
->afu
= ctx
->afu
->slice
;
350 __entry
->pe
= ctx
->pe
;
355 TP_printk("afu%i.%i pe=%i cmd=%s rc=%i",
359 __print_symbolic_u64(__entry
->cmd
, LLCMD_NAMES
),
364 DECLARE_EVENT_CLASS(cxl_afu_psl_ctrl
,
365 TP_PROTO(struct cxl_afu
*afu
, u64 cmd
),
376 __entry
->card
= afu
->adapter
->adapter_num
;
377 __entry
->afu
= afu
->slice
;
381 TP_printk("afu%i.%i cmd=%s",
384 __print_symbolic_u64(__entry
->cmd
, AFU_COMMANDS
)
388 DECLARE_EVENT_CLASS(cxl_afu_psl_ctrl_done
,
389 TP_PROTO(struct cxl_afu
*afu
, u64 cmd
, int rc
),
391 TP_ARGS(afu
, cmd
, rc
),
401 __entry
->card
= afu
->adapter
->adapter_num
;
402 __entry
->afu
= afu
->slice
;
407 TP_printk("afu%i.%i cmd=%s rc=%i",
410 __print_symbolic_u64(__entry
->cmd
, AFU_COMMANDS
),
415 DEFINE_EVENT(cxl_afu_psl_ctrl
, cxl_afu_ctrl
,
416 TP_PROTO(struct cxl_afu
*afu
, u64 cmd
),
420 DEFINE_EVENT(cxl_afu_psl_ctrl_done
, cxl_afu_ctrl_done
,
421 TP_PROTO(struct cxl_afu
*afu
, u64 cmd
, int rc
),
422 TP_ARGS(afu
, cmd
, rc
)
425 DEFINE_EVENT_PRINT(cxl_afu_psl_ctrl
, cxl_psl_ctrl
,
426 TP_PROTO(struct cxl_afu
*afu
, u64 cmd
),
429 TP_printk("psl%i.%i cmd=%s",
432 __print_symbolic_u64(__entry
->cmd
, PSL_COMMANDS
)
436 DEFINE_EVENT_PRINT(cxl_afu_psl_ctrl_done
, cxl_psl_ctrl_done
,
437 TP_PROTO(struct cxl_afu
*afu
, u64 cmd
, int rc
),
438 TP_ARGS(afu
, cmd
, rc
),
440 TP_printk("psl%i.%i cmd=%s rc=%i",
443 __print_symbolic_u64(__entry
->cmd
, PSL_COMMANDS
),
448 DEFINE_EVENT(cxl_pe_class
, cxl_slbia
,
449 TP_PROTO(struct cxl_context
*ctx
),
453 #endif /* _CXL_TRACE_H */
455 /* This part must be outside protection */
456 #undef TRACE_INCLUDE_PATH
457 #define TRACE_INCLUDE_PATH .
458 #define TRACE_INCLUDE_FILE trace
459 #include <trace/define_trace.h>