habanalabs: trace DMA allocations
authorOhad Sharabi <osharabi@habana.ai>
Sun, 12 Jun 2022 12:00:29 +0000 (15:00 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Sun, 18 Sep 2022 10:29:53 +0000 (13:29 +0300)
commit0263256791094180ab8749b224ef7bfe0bfd67bb
tree8c6399d75795e897d119b8fef07b4d3604290d11
parent4eb87df3d04aa725e752fe2df0df3e83f204d247
habanalabs: trace DMA allocations

This patch add tracepoints in the code for DMA allocation.
The main purpose is to be able to cross data with the map operations and
determine whether memory violation occurred, for example free DMA
allocation before unmapping it from device memory.

To achieve this the DMA alloc/free code flows were refactored so that a
single DMA tracepoint will catch many flows.

To get better understanding of what happened in the DMA allocations
the real allocating function is added to the trace as well.

Signed-off-by: Ohad Sharabi <osharabi@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/device.c
drivers/misc/habanalabs/common/habanalabs.h
include/trace/events/habanalabs.h