Re: [PATCH v2 14/23] mm/slab_common: print cache name in tracepoints

From: Vlastimil Babka
Date: Fri Apr 29 2022 - 10:07:43 EST

On 4/14/22 10:57, Hyeonggon Yoo wrote:
> Print cache name in tracepoints. If there is no corresponding cache
> (kmalloc in SLOB or kmalloc_large_node), use KMALLOC_{,LARGE_}NAME
> macro.
> Signed-off-by: Hyeonggon Yoo <42.hyeyoo@xxxxxxxxx>

Regarding tracepoints, I'm not sure it's a good idea to unify kmalloc and
kmem_cache_alloc. I think the common use case is to trace kmalloc as there
are many different callers, and then I'm not interested in kmem_cache_alloc
callers much.

What I would suggest instead is:
- drop the _node versions, add node to normal versions
- drop the kmem_alloc EVENT_CLASS, as kmalloc is different enough from
kmem_cache_alloc (see next points), define separately as TRACE_EVENT().
- printing cache_name makes sense to add for kmem_cache_alloc (also allows
filtering events) but not for kmalloc.
- kmem_cache_alloc with name can then drop the bytes_req, bytes_alloc as
they are fixed for given name (and can be read from slabinfo).

Not using a common tracepoint will prevent some later unifications/cleanup
(patch 21?), but hopefully not too much?