Re: [PATCH 2/3] dma-mapping: Use trace_dma_alloc for dma_alloc* instead of using trace_dma_map
From: Christoph Hellwig
Date: Fri Oct 18 2024 - 01:27:49 EST
On Thu, Oct 17, 2024 at 02:13:53PM -0400, Sean Anderson wrote:
> +DECLARE_EVENT_CLASS(_dma_alloc,
> TP_PROTO(struct device *dev, void *virt_addr, dma_addr_t dma_addr,
> size_t size, enum dma_data_direction dir, gfp_t flags,
> unsigned long attrs),
> @@ -149,7 +149,60 @@ TRACE_EVENT(dma_alloc,
> decode_dma_attrs(__entry->attrs))
> );
>
> -TRACE_EVENT(dma_free,
> +DEFINE_EVENT(_dma_alloc, dma_alloc,
> + TP_PROTO(struct device *dev, void *virt_addr, dma_addr_t dma_addr,
> + size_t size, enum dma_data_direction dir, gfp_t flags,
> + unsigned long attrs),
> + TP_ARGS(dev, virt_addr, dma_addr, size, dir, flags, attrs));
> +
> +DEFINE_EVENT(_dma_alloc, dma_alloc_pages,
The scheme we used in XFS (fs/xfs/xfs_trace.h) for the event classes is
to give the class a _class postdix, and use macros to avoid the repeated
DEFINE_EVENT boilerplate. Any chance you could rewrite this to use
a similar scheme?