Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm: vmalloc: add free_vmap_area_noflush trace event

This event is used in order to validate/debug a start address of freed VA,
number of currently outstanding and maximum allowed areas.

Link: https://lkml.kernel.org/r/20221018181053.434508-4-urezki@gmail.com
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Oleksiy Avramchenko <oleksiy.avramchenko@sony.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Uladzislau Rezki (Sony) and committed by
Andrew Morton
fabc27f7 b3a5a7b0

+34
+34
include/trace/events/vmalloc.h
··· 83 83 __entry->start, __entry->end, __entry->npurged) 84 84 ); 85 85 86 + /** 87 + * free_vmap_area_noflush - called when a vmap area is freed 88 + * @va_start: a start address of VA 89 + * @nr_lazy: number of current lazy pages 90 + * @nr_lazy_max: number of maximum lazy pages 91 + * 92 + * This event is used for a debug purpose. It gives some 93 + * indication about a VA that is released, number of current 94 + * outstanding areas and a maximum allowed threshold before 95 + * dropping all of them. 96 + */ 97 + TRACE_EVENT(free_vmap_area_noflush, 98 + 99 + TP_PROTO(unsigned long va_start, unsigned long nr_lazy, 100 + unsigned long nr_lazy_max), 101 + 102 + TP_ARGS(va_start, nr_lazy, nr_lazy_max), 103 + 104 + TP_STRUCT__entry( 105 + __field(unsigned long, va_start) 106 + __field(unsigned long, nr_lazy) 107 + __field(unsigned long, nr_lazy_max) 108 + ), 109 + 110 + TP_fast_assign( 111 + __entry->va_start = va_start; 112 + __entry->nr_lazy = nr_lazy; 113 + __entry->nr_lazy_max = nr_lazy_max; 114 + ), 115 + 116 + TP_printk("va_start=0x%lx nr_lazy=%lu nr_lazy_max=%lu", 117 + __entry->va_start, __entry->nr_lazy, __entry->nr_lazy_max) 118 + ); 119 + 86 120 #endif /* _TRACE_VMALLOC_H */ 87 121 88 122 /* This part must be outside protection */