summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunxian Huang <huangjunxian6@hisilicon.com>2025-04-21 16:27:47 +0300
committerLeon Romanovsky <leon@kernel.org>2025-04-21 21:20:27 +0300
commit1e63e2f96613bc6471e7497e47d1767e3846608e (patch)
tree7bd99e9da98bbfe285b3d757c4080d7b0ea0284b
parent6c98c86708063af509b82f35bfac9577b61b4a94 (diff)
downloadlinux-1e63e2f96613bc6471e7497e47d1767e3846608e.tar.xz
RDMA/hns: Add trace for AEQE dumping
Add trace for AEQE dumping. Output example: $ cat /sys/kernel/debug/tracing/trace tracer: nop entries-in-buffer/entries-written: 2/2 #P:128 _-----=> irqs-off/BH-disabled / _----=> need-resched | / _---=> hardirq/softirq || / _--=> preempt-depth ||| / _-=> migrate-disable |||| / delay TASK-PID CPU# ||||| TIMESTAMP FUNCTION | | | ||||| | | <idle>-0 [120] d.h1. 7995.835587: hns_ae_info: event 19 aeqe: {0x80006013,0x0,0x0,0x10d2c,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0} Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com> Link: https://patch.msgid.link/20250421132750.1363348-4-huangjunxian6@hisilicon.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_hw_v2.c1
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_trace.h19
2 files changed, 20 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index ecc1e0b1df4e..5d3bf84c1aae 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -6260,6 +6260,7 @@ static irqreturn_t hns_roce_v2_aeq_int(struct hns_roce_dev *hr_dev,
eq->sub_type = sub_type;
++eq->cons_index;
aeqe_found = IRQ_HANDLED;
+ trace_hns_ae_info(event_type, aeqe, eq->eqe_size);
atomic64_inc(&hr_dev->dfx_cnt[HNS_ROCE_DFX_AEQE_CNT]);
diff --git a/drivers/infiniband/hw/hns/hns_roce_trace.h b/drivers/infiniband/hw/hns/hns_roce_trace.h
index 56e152387db4..75c89aff68c3 100644
--- a/drivers/infiniband/hw/hns/hns_roce_trace.h
+++ b/drivers/infiniband/hw/hns/hns_roce_trace.h
@@ -85,6 +85,25 @@ DEFINE_EVENT(wqe_template, hns_srq_wqe,
enum hns_roce_trace_type type),
TP_ARGS(qpn, idx, wqe, len, id, type));
+TRACE_EVENT(hns_ae_info,
+ TP_PROTO(int event_type, void *aeqe, unsigned int len),
+ TP_ARGS(event_type, aeqe, len),
+
+ TP_STRUCT__entry(__field(int, event_type)
+ __array(__le32, aeqe,
+ HNS_ROCE_V3_EQE_SIZE / sizeof(__le32))
+ __field(u32, len)
+ ),
+
+ TP_fast_assign(__entry->event_type = event_type;
+ __entry->len = len / sizeof(__le32);
+ memcpy(__entry->aeqe, aeqe, len);
+ ),
+
+ TP_printk("event %2d aeqe: %s", __entry->event_type,
+ __print_array(__entry->aeqe, __entry->len, sizeof(__le32)))
+);
+
#endif /* __HNS_ROCE_TRACE_H */
#undef TRACE_INCLUDE_FILE