summaryrefslogtreecommitdiff
path: root/include/trace
diff options
context:
space:
mode:
authorOhad Sharabi <osharabi@habana.ai>2022-11-30 14:02:00 +0200
committerOded Gabbay <ogabbay@kernel.org>2023-01-26 11:52:11 +0200
commitd5077a55006c4af513e9b19acfa8e44b069a4fde (patch)
tree2036ca2028f63c21a51f6c64b93417e6581484fc /include/trace
parent200f3cf047f084834949ea6eea43d558c39a6abe (diff)
habanalabs: define events to trace PCI LBW access
There are cases where it may be useful to dump the whole LBW configs. Yet, doing so while spamming the kernel log will probably shade other important messages since the LBW access is done in sheer volume. To answer this we add trace events for those too. Signed-off-by: Ohad Sharabi <osharabi@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/habanalabs.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/include/trace/events/habanalabs.h b/include/trace/events/habanalabs.h
index 10233e13cee4..951643e6a7a9 100644
--- a/include/trace/events/habanalabs.h
+++ b/include/trace/events/habanalabs.h
@@ -123,6 +123,45 @@ DEFINE_EVENT(habanalabs_comms_template, habanalabs_comms_wait_status_done,
TP_PROTO(struct device *dev, char *op_str),
TP_ARGS(dev, op_str));
+DECLARE_EVENT_CLASS(habanalabs_reg_access_template,
+ TP_PROTO(struct device *dev, u32 addr, u32 val),
+
+ TP_ARGS(dev, addr, val),
+
+ TP_STRUCT__entry(
+ __string(dname, dev_name(dev))
+ __field(u32, addr)
+ __field(u32, val)
+ ),
+
+ TP_fast_assign(
+ __assign_str(dname, dev_name(dev));
+ __entry->addr = addr;
+ __entry->val = val;
+ ),
+
+ TP_printk("%s: addr: %#x, val: %#x",
+ __get_str(dname),
+ __entry->addr,
+ __entry->val)
+);
+
+DEFINE_EVENT(habanalabs_reg_access_template, habanalabs_rreg32,
+ TP_PROTO(struct device *dev, u32 addr, u32 val),
+ TP_ARGS(dev, addr, val));
+
+DEFINE_EVENT(habanalabs_reg_access_template, habanalabs_wreg32,
+ TP_PROTO(struct device *dev, u32 addr, u32 val),
+ TP_ARGS(dev, addr, val));
+
+DEFINE_EVENT(habanalabs_reg_access_template, habanalabs_elbi_read,
+ TP_PROTO(struct device *dev, u32 addr, u32 val),
+ TP_ARGS(dev, addr, val));
+
+DEFINE_EVENT(habanalabs_reg_access_template, habanalabs_elbi_write,
+ TP_PROTO(struct device *dev, u32 addr, u32 val),
+ TP_ARGS(dev, addr, val));
+
#endif /* if !defined(_TRACE_HABANALABS_H) || defined(TRACE_HEADER_MULTI_READ) */
/* This part must be outside protection */