summaryrefslogtreecommitdiffstats
path: root/include/trace/events
diff options
context:
space:
mode:
authorOhad Sharabi <osharabi@habana.ai>2023-08-27 09:54:06 +0200
committerOded Gabbay <ogabbay@kernel.org>2023-10-09 11:37:23 +0200
commit309ed969032c99e14ffabbc29ecf51e659e0ee4b (patch)
tree80926cf12cb9bb6b90b66790038f86acb110ff72 /include/trace/events
parentaccel/habanalabs: remove unused asic functions (diff)
downloadlinux-309ed969032c99e14ffabbc29ecf51e659e0ee4b.tar.xz
linux-309ed969032c99e14ffabbc29ecf51e659e0ee4b.zip
accel/habanalabs: add traces for dma mappings
In order to get a full picture of DMA mappings (e.g. to track DMAR errors), DMA mappings APIs should be covered. 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/events')
-rw-r--r--include/trace/events/habanalabs.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/include/trace/events/habanalabs.h b/include/trace/events/habanalabs.h
index 951643e6a7a9..0d3667399d01 100644
--- a/include/trace/events/habanalabs.h
+++ b/include/trace/events/habanalabs.h
@@ -87,6 +87,49 @@ DEFINE_EVENT(habanalabs_dma_alloc_template, habanalabs_dma_free,
TP_PROTO(struct device *dev, u64 cpu_addr, u64 dma_addr, size_t size, const char *caller),
TP_ARGS(dev, cpu_addr, dma_addr, size, caller));
+DECLARE_EVENT_CLASS(habanalabs_dma_map_template,
+ TP_PROTO(struct device *dev, u64 phys_addr, u64 dma_addr, size_t len,
+ enum dma_data_direction dir, const char *caller),
+
+ TP_ARGS(dev, phys_addr, dma_addr, len, dir, caller),
+
+ TP_STRUCT__entry(
+ __string(dname, dev_name(dev))
+ __field(u64, phys_addr)
+ __field(u64, dma_addr)
+ __field(u32, len)
+ __field(int, dir)
+ __field(const char *, caller)
+ ),
+
+ TP_fast_assign(
+ __assign_str(dname, dev_name(dev));
+ __entry->phys_addr = phys_addr;
+ __entry->dma_addr = dma_addr;
+ __entry->len = len;
+ __entry->dir = dir;
+ __entry->caller = caller;
+ ),
+
+ TP_printk("%s: phys_addr: %#llx, dma_addr: %#llx, len: %#x, dir: %d, caller: %s",
+ __get_str(dname),
+ __entry->phys_addr,
+ __entry->dma_addr,
+ __entry->len,
+ __entry->dir,
+ __entry->caller)
+);
+
+DEFINE_EVENT(habanalabs_dma_map_template, habanalabs_dma_map_page,
+ TP_PROTO(struct device *dev, u64 phys_addr, u64 dma_addr, size_t len,
+ enum dma_data_direction dir, const char *caller),
+ TP_ARGS(dev, phys_addr, dma_addr, len, dir, caller));
+
+DEFINE_EVENT(habanalabs_dma_map_template, habanalabs_dma_unmap_page,
+ TP_PROTO(struct device *dev, u64 phys_addr, u64 dma_addr, size_t len,
+ enum dma_data_direction dir, const char *caller),
+ TP_ARGS(dev, phys_addr, dma_addr, len, dir, caller));
+
DECLARE_EVENT_CLASS(habanalabs_comms_template,
TP_PROTO(struct device *dev, char *op_str),