diff options
author | Radhakrishna Sripada <radhakrishna.sripada@intel.com> | 2024-06-07 11:29:43 -0700 |
---|---|---|
committer | Matt Roper <matthew.d.roper@intel.com> | 2024-06-12 09:26:18 -0700 |
commit | e81568a0cbb288770f8d2e4b7d41752a9f367bd1 (patch) | |
tree | 32b4270b316f1370e62d9b82fface31f4d22ba40 /drivers/gpu/drm/xe/xe_trace.h | |
parent | 501c4255c40935280a10844cf7550bf1e4f8939b (diff) | |
download | lwn-e81568a0cbb288770f8d2e4b7d41752a9f367bd1.tar.gz lwn-e81568a0cbb288770f8d2e4b7d41752a9f367bd1.zip |
drm/xe: Add reg read/write trace
This will help debug register read/writes and provides
a way to trace all the mmio transactions.
v2: Fix kunit error
v3: Print devid to help in multi-gpu setup
v3: rebase and use variable sized variant to display
dev name(Gustavo)
v4: Pass single argument to __asign_str to fix kunit error
v5: Remove unrelated include xe_tile.h and remove cast in trace
Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240607182943.3572524-7-radhakrishna.sripada@intel.com
Diffstat (limited to 'drivers/gpu/drm/xe/xe_trace.h')
-rw-r--r-- | drivers/gpu/drm/xe/xe_trace.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/xe_trace.h b/drivers/gpu/drm/xe/xe_trace.h index 27ba7c416405..09ca1ad057b0 100644 --- a/drivers/gpu/drm/xe/xe_trace.h +++ b/drivers/gpu/drm/xe/xe_trace.h @@ -346,6 +346,34 @@ DEFINE_EVENT(xe_hw_fence, xe_hw_fence_free, TP_ARGS(fence) ); +TRACE_EVENT(xe_reg_rw, + TP_PROTO(struct xe_gt *gt, bool write, u32 reg, u64 val, int len), + + TP_ARGS(gt, write, reg, val, len), + + TP_STRUCT__entry( + __string(dev, __dev_name_gt(gt)) + __field(u64, val) + __field(u32, reg) + __field(u16, write) + __field(u16, len) + ), + + TP_fast_assign( + __assign_str(dev); + __entry->val = val; + __entry->reg = reg; + __entry->write = write; + __entry->len = len; + ), + + TP_printk("dev=%s, %s reg=0x%x, len=%d, val=(0x%x, 0x%x)", + __get_str(dev), __entry->write ? "write" : "read", + __entry->reg, __entry->len, + (u32)(__entry->val & 0xffffffff), + (u32)(__entry->val >> 32)) +); + #endif /* This part must be outside protection */ |