summaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorIan Munsie <imunsie@au1.ibm.com>2015-01-09 04:34:36 -0500
committerMichael Ellerman <mpe@ellerman.id.au>2015-01-22 01:31:51 -0500
commit9bcf28cdb28e6a793c4e59f0a42c66fe241993a8 (patch)
treea9a9f854584e3f03b58ea714e73d2b71089b4008 /drivers/misc
parentd3383aaae9800b9e13e25b71f70dff3814d10373 (diff)
cxl: Add tracepoints
This patch adds tracepoints throughout the cxl driver, which can provide insight into: - Context lifetimes - Commands sent to the PSL and AFU and their completion status - Segment and page table misses and their resolution - PSL and AFU interrupts - slbia calls from the powerpc copro_fault code These tracepoints are mostly intended to aid in debugging (particularly for new AFU designs), and may be useful standalone or in conjunction with hardware traces collected by the PSL (read out via the trace interface in debugfs) and AFUs. Signed-off-by: Ian Munsie <imunsie@au1.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/cxl/Makefile5
-rw-r--r--drivers/misc/cxl/fault.c5
-rw-r--r--drivers/misc/cxl/file.c3
-rw-r--r--drivers/misc/cxl/irq.c4
-rw-r--r--drivers/misc/cxl/main.c2
-rw-r--r--drivers/misc/cxl/native.c38
-rw-r--r--drivers/misc/cxl/trace.c13
-rw-r--r--drivers/misc/cxl/trace.h459
8 files changed, 520 insertions, 9 deletions
diff --git a/drivers/misc/cxl/Makefile b/drivers/misc/cxl/Makefile
index 165e98fef2c2..edb494d3ff27 100644
--- a/drivers/misc/cxl/Makefile
+++ b/drivers/misc/cxl/Makefile
@@ -1,3 +1,6 @@
1cxl-y += main.o file.o irq.o fault.o native.o context.o sysfs.o debugfs.o pci.o 1cxl-y += main.o file.o irq.o fault.o native.o context.o sysfs.o debugfs.o pci.o trace.o
2obj-$(CONFIG_CXL) += cxl.o 2obj-$(CONFIG_CXL) += cxl.o
3obj-$(CONFIG_CXL_BASE) += base.o 3obj-$(CONFIG_CXL_BASE) += base.o
4
5# For tracepoints to include our trace.h from tracepoint infrastructure:
6CFLAGS_trace.o := -I$(src)
diff --git a/drivers/misc/cxl/fault.c b/drivers/misc/cxl/fault.c
index e010302a192b..5286b8b704f5 100644
--- a/drivers/misc/cxl/fault.c
+++ b/drivers/misc/cxl/fault.c
@@ -20,6 +20,7 @@
20#include <asm/mmu.h> 20#include <asm/mmu.h>
21 21
22#include "cxl.h" 22#include "cxl.h"
23#include "trace.h"
23 24
24static bool sste_matches(struct cxl_sste *sste, struct copro_slb *slb) 25static bool sste_matches(struct cxl_sste *sste, struct copro_slb *slb)
25{ 26{
@@ -75,6 +76,7 @@ static void cxl_load_segment(struct cxl_context *ctx, struct copro_slb *slb)
75 76
76 pr_devel("CXL Populating SST[%li]: %#llx %#llx\n", 77 pr_devel("CXL Populating SST[%li]: %#llx %#llx\n",
77 sste - ctx->sstp, slb->vsid, slb->esid); 78 sste - ctx->sstp, slb->vsid, slb->esid);
79 trace_cxl_ste_write(ctx, sste - ctx->sstp, slb->esid, slb->vsid);
78 80
79 sste->vsid_data = cpu_to_be64(slb->vsid); 81 sste->vsid_data = cpu_to_be64(slb->vsid);
80 sste->esid_data = cpu_to_be64(slb->esid); 82 sste->esid_data = cpu_to_be64(slb->esid);
@@ -116,6 +118,7 @@ static int cxl_handle_segment_miss(struct cxl_context *ctx,
116 int rc; 118 int rc;
117 119
118 pr_devel("CXL interrupt: Segment fault pe: %i ea: %#llx\n", ctx->pe, ea); 120 pr_devel("CXL interrupt: Segment fault pe: %i ea: %#llx\n", ctx->pe, ea);
121 trace_cxl_ste_miss(ctx, ea);
119 122
120 if ((rc = cxl_fault_segment(ctx, mm, ea))) 123 if ((rc = cxl_fault_segment(ctx, mm, ea)))
121 cxl_ack_ae(ctx); 124 cxl_ack_ae(ctx);
@@ -135,6 +138,8 @@ static void cxl_handle_page_fault(struct cxl_context *ctx,
135 int result; 138 int result;
136 unsigned long access, flags, inv_flags = 0; 139 unsigned long access, flags, inv_flags = 0;
137 140
141 trace_cxl_pte_miss(ctx, dsisr, dar);
142
138 if ((result = copro_handle_mm_fault(mm, dar, dsisr, &flt))) { 143 if ((result = copro_handle_mm_fault(mm, dar, dsisr, &flt))) {
139 pr_devel("copro_handle_mm_fault failed: %#x\n", result); 144 pr_devel("copro_handle_mm_fault failed: %#x\n", result);
140 return cxl_ack_ae(ctx); 145 return cxl_ack_ae(ctx);
diff --git a/drivers/misc/cxl/file.c b/drivers/misc/cxl/file.c
index b09be4462294..8953de6fde2d 100644
--- a/drivers/misc/cxl/file.c
+++ b/drivers/misc/cxl/file.c
@@ -23,6 +23,7 @@
23#include <asm/copro.h> 23#include <asm/copro.h>
24 24
25#include "cxl.h" 25#include "cxl.h"
26#include "trace.h"
26 27
27#define CXL_NUM_MINORS 256 /* Total to reserve */ 28#define CXL_NUM_MINORS 256 /* Total to reserve */
28#define CXL_DEV_MINORS 13 /* 1 control + 4 AFUs * 3 (dedicated/master/shared) */ 29#define CXL_DEV_MINORS 13 /* 1 control + 4 AFUs * 3 (dedicated/master/shared) */
@@ -184,6 +185,8 @@ static long afu_ioctl_start_work(struct cxl_context *ctx,
184 */ 185 */
185 ctx->pid = get_pid(get_task_pid(current, PIDTYPE_PID)); 186 ctx->pid = get_pid(get_task_pid(current, PIDTYPE_PID));
186 187
188 trace_cxl_attach(ctx, work.work_element_descriptor, work.num_interrupts, amr);
189
187 if ((rc = cxl_attach_process(ctx, false, work.work_element_descriptor, 190 if ((rc = cxl_attach_process(ctx, false, work.work_element_descriptor,
188 amr))) { 191 amr))) {
189 afu_release_irqs(ctx); 192 afu_release_irqs(ctx);
diff --git a/drivers/misc/cxl/irq.c b/drivers/misc/cxl/irq.c
index 68ab608ecbe7..f0836472403b 100644
--- a/drivers/misc/cxl/irq.c
+++ b/drivers/misc/cxl/irq.c
@@ -17,6 +17,7 @@
17#include <misc/cxl.h> 17#include <misc/cxl.h>
18 18
19#include "cxl.h" 19#include "cxl.h"
20#include "trace.h"
20 21
21/* XXX: This is implementation specific */ 22/* XXX: This is implementation specific */
22static irqreturn_t handle_psl_slice_error(struct cxl_context *ctx, u64 dsisr, u64 errstat) 23static irqreturn_t handle_psl_slice_error(struct cxl_context *ctx, u64 dsisr, u64 errstat)
@@ -100,6 +101,8 @@ static irqreturn_t cxl_irq(int irq, void *data, struct cxl_irq_info *irq_info)
100 dsisr = irq_info->dsisr; 101 dsisr = irq_info->dsisr;
101 dar = irq_info->dar; 102 dar = irq_info->dar;
102 103
104 trace_cxl_psl_irq(ctx, irq, dsisr, dar);
105
103 pr_devel("CXL interrupt %i for afu pe: %i DSISR: %#llx DAR: %#llx\n", irq, ctx->pe, dsisr, dar); 106 pr_devel("CXL interrupt %i for afu pe: %i DSISR: %#llx DAR: %#llx\n", irq, ctx->pe, dsisr, dar);
104 107
105 if (dsisr & CXL_PSL_DSISR_An_DS) { 108 if (dsisr & CXL_PSL_DSISR_An_DS) {
@@ -237,6 +240,7 @@ static irqreturn_t cxl_irq_afu(int irq, void *data)
237 return IRQ_HANDLED; 240 return IRQ_HANDLED;
238 } 241 }
239 242
243 trace_cxl_afu_irq(ctx, afu_irq, irq, hwirq);
240 pr_devel("Received AFU interrupt %i for pe: %i (virq %i hwirq %lx)\n", 244 pr_devel("Received AFU interrupt %i for pe: %i (virq %i hwirq %lx)\n",
241 afu_irq, ctx->pe, irq, hwirq); 245 afu_irq, ctx->pe, irq, hwirq);
242 246
diff --git a/drivers/misc/cxl/main.c b/drivers/misc/cxl/main.c
index 4cde9b661642..8ccddceead66 100644
--- a/drivers/misc/cxl/main.c
+++ b/drivers/misc/cxl/main.c
@@ -23,6 +23,7 @@
23#include <misc/cxl.h> 23#include <misc/cxl.h>
24 24
25#include "cxl.h" 25#include "cxl.h"
26#include "trace.h"
26 27
27static DEFINE_SPINLOCK(adapter_idr_lock); 28static DEFINE_SPINLOCK(adapter_idr_lock);
28static DEFINE_IDR(cxl_adapter_idr); 29static DEFINE_IDR(cxl_adapter_idr);
@@ -48,6 +49,7 @@ static inline void _cxl_slbia(struct cxl_context *ctx, struct mm_struct *mm)
48 ctx->afu->adapter->adapter_num, ctx->afu->slice, ctx->pe); 49 ctx->afu->adapter->adapter_num, ctx->afu->slice, ctx->pe);
49 50
50 spin_lock_irqsave(&ctx->sste_lock, flags); 51 spin_lock_irqsave(&ctx->sste_lock, flags);
52 trace_cxl_slbia(ctx);
51 memset(ctx->sstp, 0, ctx->sst_size); 53 memset(ctx->sstp, 0, ctx->sst_size);
52 spin_unlock_irqrestore(&ctx->sste_lock, flags); 54 spin_unlock_irqrestore(&ctx->sste_lock, flags);
53 mb(); 55 mb();
diff --git a/drivers/misc/cxl/native.c b/drivers/misc/cxl/native.c
index 0f24fa5b0de3..29185fc61276 100644
--- a/drivers/misc/cxl/native.c
+++ b/drivers/misc/cxl/native.c
@@ -18,24 +18,28 @@
18#include <misc/cxl.h> 18#include <misc/cxl.h>
19 19
20#include "cxl.h" 20#include "cxl.h"
21#include "trace.h"
21 22
22static int afu_control(struct cxl_afu *afu, u64 command, 23static int afu_control(struct cxl_afu *afu, u64 command,
23 u64 result, u64 mask, bool enabled) 24 u64 result, u64 mask, bool enabled)
24{ 25{
25 u64 AFU_Cntl = cxl_p2n_read(afu, CXL_AFU_Cntl_An); 26 u64 AFU_Cntl = cxl_p2n_read(afu, CXL_AFU_Cntl_An);
26 unsigned long timeout = jiffies + (HZ * CXL_TIMEOUT); 27 unsigned long timeout = jiffies + (HZ * CXL_TIMEOUT);
28 int rc = 0;
27 29
28 spin_lock(&afu->afu_cntl_lock); 30 spin_lock(&afu->afu_cntl_lock);
29 pr_devel("AFU command starting: %llx\n", command); 31 pr_devel("AFU command starting: %llx\n", command);
30 32
33 trace_cxl_afu_ctrl(afu, command);
34
31 cxl_p2n_write(afu, CXL_AFU_Cntl_An, AFU_Cntl | command); 35 cxl_p2n_write(afu, CXL_AFU_Cntl_An, AFU_Cntl | command);
32 36
33 AFU_Cntl = cxl_p2n_read(afu, CXL_AFU_Cntl_An); 37 AFU_Cntl = cxl_p2n_read(afu, CXL_AFU_Cntl_An);
34 while ((AFU_Cntl & mask) != result) { 38 while ((AFU_Cntl & mask) != result) {
35 if (time_after_eq(jiffies, timeout)) { 39 if (time_after_eq(jiffies, timeout)) {
36 dev_warn(&afu->dev, "WARNING: AFU control timed out!\n"); 40 dev_warn(&afu->dev, "WARNING: AFU control timed out!\n");
37 spin_unlock(&afu->afu_cntl_lock); 41 rc = -EBUSY;
38 return -EBUSY; 42 goto out;
39 } 43 }
40 pr_devel_ratelimited("AFU control... (0x%.16llx)\n", 44 pr_devel_ratelimited("AFU control... (0x%.16llx)\n",
41 AFU_Cntl | command); 45 AFU_Cntl | command);
@@ -44,9 +48,11 @@ static int afu_control(struct cxl_afu *afu, u64 command,
44 }; 48 };
45 pr_devel("AFU command complete: %llx\n", command); 49 pr_devel("AFU command complete: %llx\n", command);
46 afu->enabled = enabled; 50 afu->enabled = enabled;
51out:
52 trace_cxl_afu_ctrl_done(afu, command, rc);
47 spin_unlock(&afu->afu_cntl_lock); 53 spin_unlock(&afu->afu_cntl_lock);
48 54
49 return 0; 55 return rc;
50} 56}
51 57
52static int afu_enable(struct cxl_afu *afu) 58static int afu_enable(struct cxl_afu *afu)
@@ -91,6 +97,9 @@ int cxl_psl_purge(struct cxl_afu *afu)
91 u64 dsisr, dar; 97 u64 dsisr, dar;
92 u64 start, end; 98 u64 start, end;
93 unsigned long timeout = jiffies + (HZ * CXL_TIMEOUT); 99 unsigned long timeout = jiffies + (HZ * CXL_TIMEOUT);
100 int rc = 0;
101
102 trace_cxl_psl_ctrl(afu, CXL_PSL_SCNTL_An_Pc);
94 103
95 pr_devel("PSL purge request\n"); 104 pr_devel("PSL purge request\n");
96 105
@@ -107,7 +116,8 @@ int cxl_psl_purge(struct cxl_afu *afu)
107 == CXL_PSL_SCNTL_An_Ps_Pending) { 116 == CXL_PSL_SCNTL_An_Ps_Pending) {
108 if (time_after_eq(jiffies, timeout)) { 117 if (time_after_eq(jiffies, timeout)) {
109 dev_warn(&afu->dev, "WARNING: PSL Purge timed out!\n"); 118 dev_warn(&afu->dev, "WARNING: PSL Purge timed out!\n");
110 return -EBUSY; 119 rc = -EBUSY;
120 goto out;
111 } 121 }
112 dsisr = cxl_p2n_read(afu, CXL_PSL_DSISR_An); 122 dsisr = cxl_p2n_read(afu, CXL_PSL_DSISR_An);
113 pr_devel_ratelimited("PSL purging... PSL_CNTL: 0x%.16llx PSL_DSISR: 0x%.16llx\n", PSL_CNTL, dsisr); 123 pr_devel_ratelimited("PSL purging... PSL_CNTL: 0x%.16llx PSL_DSISR: 0x%.16llx\n", PSL_CNTL, dsisr);
@@ -128,7 +138,9 @@ int cxl_psl_purge(struct cxl_afu *afu)
128 138
129 cxl_p1n_write(afu, CXL_PSL_SCNTL_An, 139 cxl_p1n_write(afu, CXL_PSL_SCNTL_An,
130 PSL_CNTL & ~CXL_PSL_SCNTL_An_Pc); 140 PSL_CNTL & ~CXL_PSL_SCNTL_An_Pc);
131 return 0; 141out:
142 trace_cxl_psl_ctrl_done(afu, CXL_PSL_SCNTL_An_Pc, rc);
143 return rc;
132} 144}
133 145
134static int spa_max_procs(int spa_size) 146static int spa_max_procs(int spa_size)
@@ -279,6 +291,9 @@ static int do_process_element_cmd(struct cxl_context *ctx,
279{ 291{
280 u64 state; 292 u64 state;
281 unsigned long timeout = jiffies + (HZ * CXL_TIMEOUT); 293 unsigned long timeout = jiffies + (HZ * CXL_TIMEOUT);
294 int rc = 0;
295
296 trace_cxl_llcmd(ctx, cmd);
282 297
283 WARN_ON(!ctx->afu->enabled); 298 WARN_ON(!ctx->afu->enabled);
284 299
@@ -290,12 +305,14 @@ static int do_process_element_cmd(struct cxl_context *ctx,
290 while (1) { 305 while (1) {
291 if (time_after_eq(jiffies, timeout)) { 306 if (time_after_eq(jiffies, timeout)) {
292 dev_warn(&ctx->afu->dev, "WARNING: Process Element Command timed out!\n"); 307 dev_warn(&ctx->afu->dev, "WARNING: Process Element Command timed out!\n");
293 return -EBUSY; 308 rc = -EBUSY;
309 goto out;
294 } 310 }
295 state = be64_to_cpup(ctx->afu->sw_command_status); 311 state = be64_to_cpup(ctx->afu->sw_command_status);
296 if (state == ~0ULL) { 312 if (state == ~0ULL) {
297 pr_err("cxl: Error adding process element to AFU\n"); 313 pr_err("cxl: Error adding process element to AFU\n");
298 return -1; 314 rc = -1;
315 goto out;
299 } 316 }
300 if ((state & (CXL_SPA_SW_CMD_MASK | CXL_SPA_SW_STATE_MASK | CXL_SPA_SW_LINK_MASK)) == 317 if ((state & (CXL_SPA_SW_CMD_MASK | CXL_SPA_SW_STATE_MASK | CXL_SPA_SW_LINK_MASK)) ==
301 (cmd | (cmd >> 16) | ctx->pe)) 318 (cmd | (cmd >> 16) | ctx->pe))
@@ -310,7 +327,9 @@ static int do_process_element_cmd(struct cxl_context *ctx,
310 schedule(); 327 schedule();
311 328
312 } 329 }
313 return 0; 330out:
331 trace_cxl_llcmd_done(ctx, cmd, rc);
332 return rc;
314} 333}
315 334
316static int add_process_element(struct cxl_context *ctx) 335static int add_process_element(struct cxl_context *ctx)
@@ -630,6 +649,8 @@ static inline int detach_process_native_afu_directed(struct cxl_context *ctx)
630 649
631int cxl_detach_process(struct cxl_context *ctx) 650int cxl_detach_process(struct cxl_context *ctx)
632{ 651{
652 trace_cxl_detach(ctx);
653
633 if (ctx->afu->current_mode == CXL_MODE_DEDICATED) 654 if (ctx->afu->current_mode == CXL_MODE_DEDICATED)
634 return detach_process_native_dedicated(ctx); 655 return detach_process_native_dedicated(ctx);
635 656
@@ -668,6 +689,7 @@ static void recover_psl_err(struct cxl_afu *afu, u64 errstat)
668 689
669int cxl_ack_irq(struct cxl_context *ctx, u64 tfc, u64 psl_reset_mask) 690int cxl_ack_irq(struct cxl_context *ctx, u64 tfc, u64 psl_reset_mask)
670{ 691{
692 trace_cxl_psl_irq_ack(ctx, tfc);
671 if (tfc) 693 if (tfc)
672 cxl_p2n_write(ctx->afu, CXL_PSL_TFC_An, tfc); 694 cxl_p2n_write(ctx->afu, CXL_PSL_TFC_An, tfc);
673 if (psl_reset_mask) 695 if (psl_reset_mask)
diff --git a/drivers/misc/cxl/trace.c b/drivers/misc/cxl/trace.c
new file mode 100644
index 000000000000..c2b06d319e6e
--- /dev/null
+++ b/drivers/misc/cxl/trace.c
@@ -0,0 +1,13 @@
1/*
2 * Copyright 2015 IBM Corp.
3 *
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.
8 */
9
10#ifndef __CHECKER__
11#define CREATE_TRACE_POINTS
12#include "trace.h"
13#endif
diff --git a/drivers/misc/cxl/trace.h b/drivers/misc/cxl/trace.h
new file mode 100644
index 000000000000..ae434d87887e
--- /dev/null
+++ b/drivers/misc/cxl/trace.h
@@ -0,0 +1,459 @@
1/*
2 * Copyright 2015 IBM Corp.
3 *
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.
8 */
9
10#undef TRACE_SYSTEM
11#define TRACE_SYSTEM cxl
12
13#if !defined(_CXL_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
14#define _CXL_TRACE_H
15
16#include <linux/tracepoint.h>
17
18#include "cxl.h"
19
20#define DSISR_FLAGS \
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" }
33
34#define TFC_FLAGS \
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" }
39
40#define LLCMD_NAMES \
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" }
47
48#define AFU_COMMANDS \
49 { 0, "DISABLE" }, \
50 { CXL_AFU_Cntl_An_E, "ENABLE" }, \
51 { CXL_AFU_Cntl_An_RA, "RESET" }
52
53#define PSL_COMMANDS \
54 { CXL_PSL_SCNTL_An_Pc, "PURGE" }, \
55 { CXL_PSL_SCNTL_An_Sc, "SUSPEND" }
56
57
58DECLARE_EVENT_CLASS(cxl_pe_class,
59 TP_PROTO(struct cxl_context *ctx),
60
61 TP_ARGS(ctx),
62
63 TP_STRUCT__entry(
64 __field(u8, card)
65 __field(u8, afu)
66 __field(u16, pe)
67 ),
68
69 TP_fast_assign(
70 __entry->card = ctx->afu->adapter->adapter_num;
71 __entry->afu = ctx->afu->slice;
72 __entry->pe = ctx->pe;
73 ),
74
75 TP_printk("afu%i.%i pe=%i",
76 __entry->card,
77 __entry->afu,
78 __entry->pe
79 )
80);
81
82
83TRACE_EVENT(cxl_attach,
84 TP_PROTO(struct cxl_context *ctx, u64 wed, s16 num_interrupts, u64 amr),
85
86 TP_ARGS(ctx, wed, num_interrupts, amr),
87
88 TP_STRUCT__entry(
89 __field(u8, card)
90 __field(u8, afu)
91 __field(u16, pe)
92 __field(pid_t, pid)
93 __field(u64, wed)
94 __field(u64, amr)
95 __field(s16, num_interrupts)
96 ),
97
98 TP_fast_assign(
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);
103 __entry->wed = wed;
104 __entry->amr = amr;
105 __entry->num_interrupts = num_interrupts;
106 ),
107
108 TP_printk("afu%i.%i pid=%i pe=%i wed=0x%.16llx irqs=%i amr=0x%llx",
109 __entry->card,
110 __entry->afu,
111 __entry->pid,
112 __entry->pe,
113 __entry->wed,
114 __entry->num_interrupts,
115 __entry->amr
116 )
117);
118
119DEFINE_EVENT(cxl_pe_class, cxl_detach,
120 TP_PROTO(struct cxl_context *ctx),
121 TP_ARGS(ctx)
122);
123
124TRACE_EVENT(cxl_afu_irq,
125 TP_PROTO(struct cxl_context *ctx, int afu_irq, int virq, irq_hw_number_t hwirq),
126
127 TP_ARGS(ctx, afu_irq, virq, hwirq),
128
129 TP_STRUCT__entry(
130 __field(u8, card)
131 __field(u8, afu)
132 __field(u16, pe)
133 __field(u16, afu_irq)
134 __field(int, virq)
135 __field(irq_hw_number_t, hwirq)
136 ),
137
138 TP_fast_assign(
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;
145 ),
146
147 TP_printk("afu%i.%i pe=%i afu_irq=%i virq=%i hwirq=0x%lx",
148 __entry->card,
149 __entry->afu,
150 __entry->pe,
151 __entry->afu_irq,
152 __entry->virq,
153 __entry->hwirq
154 )
155);
156
157TRACE_EVENT(cxl_psl_irq,
158 TP_PROTO(struct cxl_context *ctx, int irq, u64 dsisr, u64 dar),
159
160 TP_ARGS(ctx, irq, dsisr, dar),
161
162 TP_STRUCT__entry(
163 __field(u8, card)
164 __field(u8, afu)
165 __field(u16, pe)
166 __field(int, irq)
167 __field(u64, dsisr)
168 __field(u64, dar)
169 ),
170
171 TP_fast_assign(
172 __entry->card = ctx->afu->adapter->adapter_num;
173 __entry->afu = ctx->afu->slice;
174 __entry->pe = ctx->pe;
175 __entry->irq = irq;
176 __entry->dsisr = dsisr;
177 __entry->dar = dar;
178 ),
179
180 TP_printk("afu%i.%i pe=%i irq=%i dsisr=%s dar=0x%.16llx",
181 __entry->card,
182 __entry->afu,
183 __entry->pe,
184 __entry->irq,
185 __print_flags(__entry->dsisr, "|", DSISR_FLAGS),
186 __entry->dar
187 )
188);
189
190TRACE_EVENT(cxl_psl_irq_ack,
191 TP_PROTO(struct cxl_context *ctx, u64 tfc),
192
193 TP_ARGS(ctx, tfc),
194
195 TP_STRUCT__entry(
196 __field(u8, card)
197 __field(u8, afu)
198 __field(u16, pe)
199 __field(u64, tfc)
200 ),
201
202 TP_fast_assign(
203 __entry->card = ctx->afu->adapter->adapter_num;
204 __entry->afu = ctx->afu->slice;
205 __entry->pe = ctx->pe;
206 __entry->tfc = tfc;
207 ),
208
209 TP_printk("afu%i.%i pe=%i tfc=%s",
210 __entry->card,
211 __entry->afu,
212 __entry->pe,
213 __print_flags(__entry->tfc, "|", TFC_FLAGS)
214 )
215);
216
217TRACE_EVENT(cxl_ste_miss,
218 TP_PROTO(struct cxl_context *ctx, u64 dar),
219
220 TP_ARGS(ctx, dar),
221
222 TP_STRUCT__entry(
223 __field(u8, card)
224 __field(u8, afu)
225 __field(u16, pe)
226 __field(u64, dar)
227 ),
228
229 TP_fast_assign(
230 __entry->card = ctx->afu->adapter->adapter_num;
231 __entry->afu = ctx->afu->slice;
232 __entry->pe = ctx->pe;
233 __entry->dar = dar;
234 ),
235
236 TP_printk("afu%i.%i pe=%i dar=0x%.16llx",
237 __entry->card,
238 __entry->afu,
239 __entry->pe,
240 __entry->dar
241 )
242);
243
244TRACE_EVENT(cxl_ste_write,
245 TP_PROTO(struct cxl_context *ctx, unsigned int idx, u64 e, u64 v),
246
247 TP_ARGS(ctx, idx, e, v),
248
249 TP_STRUCT__entry(
250 __field(u8, card)
251 __field(u8, afu)
252 __field(u16, pe)
253 __field(unsigned int, idx)
254 __field(u64, e)
255 __field(u64, v)
256 ),
257
258 TP_fast_assign(
259 __entry->card = ctx->afu->adapter->adapter_num;
260 __entry->afu = ctx->afu->slice;
261 __entry->pe = ctx->pe;
262 __entry->idx = idx;
263 __entry->e = e;
264 __entry->v = v;
265 ),
266
267 TP_printk("afu%i.%i pe=%i SSTE[%i] E=0x%.16llx V=0x%.16llx",
268 __entry->card,
269 __entry->afu,
270 __entry->pe,
271 __entry->idx,
272 __entry->e,
273 __entry->v
274 )
275);
276
277TRACE_EVENT(cxl_pte_miss,
278 TP_PROTO(struct cxl_context *ctx, u64 dsisr, u64 dar),
279
280 TP_ARGS(ctx, dsisr, dar),
281
282 TP_STRUCT__entry(
283 __field(u8, card)
284 __field(u8, afu)
285 __field(u16, pe)
286 __field(u64, dsisr)
287 __field(u64, dar)
288 ),
289
290 TP_fast_assign(
291 __entry->card = ctx->afu->adapter->adapter_num;
292 __entry->afu = ctx->afu->slice;
293 __entry->pe = ctx->pe;
294 __entry->dsisr = dsisr;
295 __entry->dar = dar;
296 ),
297
298 TP_printk("afu%i.%i pe=%i dsisr=%s dar=0x%.16llx",
299 __entry->card,
300 __entry->afu,
301 __entry->pe,
302 __print_flags(__entry->dsisr, "|", DSISR_FLAGS),
303 __entry->dar
304 )
305);
306
307TRACE_EVENT(cxl_llcmd,
308 TP_PROTO(struct cxl_context *ctx, u64 cmd),
309
310 TP_ARGS(ctx, cmd),
311
312 TP_STRUCT__entry(
313 __field(u8, card)
314 __field(u8, afu)
315 __field(u16, pe)
316 __field(u64, cmd)
317 ),
318
319 TP_fast_assign(
320 __entry->card = ctx->afu->adapter->adapter_num;
321 __entry->afu = ctx->afu->slice;
322 __entry->pe = ctx->pe;
323 __entry->cmd = cmd;
324 ),
325
326 TP_printk("afu%i.%i pe=%i cmd=%s",
327 __entry->card,
328 __entry->afu,
329 __entry->pe,
330 __print_symbolic_u64(__entry->cmd, LLCMD_NAMES)
331 )
332);
333
334TRACE_EVENT(cxl_llcmd_done,
335 TP_PROTO(struct cxl_context *ctx, u64 cmd, int rc),
336
337 TP_ARGS(ctx, cmd, rc),
338
339 TP_STRUCT__entry(
340 __field(u8, card)
341 __field(u8, afu)
342 __field(u16, pe)
343 __field(u64, cmd)
344 __field(int, rc)
345 ),
346
347 TP_fast_assign(
348 __entry->card = ctx->afu->adapter->adapter_num;
349 __entry->afu = ctx->afu->slice;
350 __entry->pe = ctx->pe;
351 __entry->rc = rc;
352 __entry->cmd = cmd;
353 ),
354
355 TP_printk("afu%i.%i pe=%i cmd=%s rc=%i",
356 __entry->card,
357 __entry->afu,
358 __entry->pe,
359 __print_symbolic_u64(__entry->cmd, LLCMD_NAMES),
360 __entry->rc
361 )
362);
363
364DECLARE_EVENT_CLASS(cxl_afu_psl_ctrl,
365 TP_PROTO(struct cxl_afu *afu, u64 cmd),
366
367 TP_ARGS(afu, cmd),
368
369 TP_STRUCT__entry(
370 __field(u8, card)
371 __field(u8, afu)
372 __field(u64, cmd)
373 ),
374
375 TP_fast_assign(
376 __entry->card = afu->adapter->adapter_num;
377 __entry->afu = afu->slice;
378 __entry->cmd = cmd;
379 ),
380
381 TP_printk("afu%i.%i cmd=%s",
382 __entry->card,
383 __entry->afu,
384 __print_symbolic_u64(__entry->cmd, AFU_COMMANDS)
385 )
386);
387
388DECLARE_EVENT_CLASS(cxl_afu_psl_ctrl_done,
389 TP_PROTO(struct cxl_afu *afu, u64 cmd, int rc),
390
391 TP_ARGS(afu, cmd, rc),
392
393 TP_STRUCT__entry(
394 __field(u8, card)
395 __field(u8, afu)
396 __field(u64, cmd)
397 __field(int, rc)
398 ),
399
400 TP_fast_assign(
401 __entry->card = afu->adapter->adapter_num;
402 __entry->afu = afu->slice;
403 __entry->rc = rc;
404 __entry->cmd = cmd;
405 ),
406
407 TP_printk("afu%i.%i cmd=%s rc=%i",
408 __entry->card,
409 __entry->afu,
410 __print_symbolic_u64(__entry->cmd, AFU_COMMANDS),
411 __entry->rc
412 )
413);
414
415DEFINE_EVENT(cxl_afu_psl_ctrl, cxl_afu_ctrl,
416 TP_PROTO(struct cxl_afu *afu, u64 cmd),
417 TP_ARGS(afu, cmd)
418);
419
420DEFINE_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)
423);
424
425DEFINE_EVENT_PRINT(cxl_afu_psl_ctrl, cxl_psl_ctrl,
426 TP_PROTO(struct cxl_afu *afu, u64 cmd),
427 TP_ARGS(afu, cmd),
428
429 TP_printk("psl%i.%i cmd=%s",
430 __entry->card,
431 __entry->afu,
432 __print_symbolic_u64(__entry->cmd, PSL_COMMANDS)
433 )
434);
435
436DEFINE_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),
439
440 TP_printk("psl%i.%i cmd=%s rc=%i",
441 __entry->card,
442 __entry->afu,
443 __print_symbolic_u64(__entry->cmd, PSL_COMMANDS),
444 __entry->rc
445 )
446);
447
448DEFINE_EVENT(cxl_pe_class, cxl_slbia,
449 TP_PROTO(struct cxl_context *ctx),
450 TP_ARGS(ctx)
451);
452
453#endif /* _CXL_TRACE_H */
454
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>