lkml.org 
[lkml]   [2022]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] habanalabs: trace DMA allocations
On Thu, 11 Aug 2022 14:39:53 +0300
Oded Gabbay <ogabbay@kernel.org> wrote:

> @@ -113,11 +116,16 @@ static void *hl_dma_alloc_common(struct hl_device *hdev, size_t size, dma_addr_t
> break;
> }
>
> + if (!ZERO_OR_NULL_PTR(ptr))

If you change the above to:

if (trace_habanalabs_dma_alloc_enabled() && !ZERO_OR_NULL_PTR(ptr))

The conditional check will be skipped when this tracepoint is disabled.

-- Steve


> + trace_habanalabs_dma_alloc(hdev->dev, (u64) (uintptr_t) ptr, *dma_handle, size,
> + caller);
> +
> return ptr;
> }
>

\
 
 \ /
  Last update: 2022-08-11 15:54    [W:0.078 / U:0.664 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site