1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM vmalloc
5 #if !defined(_TRACE_VMALLOC_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_VMALLOC_H
8 #include <linux/tracepoint.h>
11 * alloc_vmap_area - called when a new vmap allocation occurs
12 * @addr: an allocated address
13 * @size: a requested size
14 * @align: a requested alignment
15 * @vstart: a requested start range
16 * @vend: a requested end range
17 * @failed: an allocation failed or not
19 * This event is used for a debug purpose, it can give an extra
20 * information for a developer about how often it occurs and which
21 * parameters are passed for further validation.
23 TRACE_EVENT(alloc_vmap_area
,
25 TP_PROTO(unsigned long addr
, unsigned long size
, unsigned long align
,
26 unsigned long vstart
, unsigned long vend
, int failed
),
28 TP_ARGS(addr
, size
, align
, vstart
, vend
, failed
),
31 __field(unsigned long, addr
)
32 __field(unsigned long, size
)
33 __field(unsigned long, align
)
34 __field(unsigned long, vstart
)
35 __field(unsigned long, vend
)
42 __entry
->align
= align
;
43 __entry
->vstart
= vstart
;
45 __entry
->failed
= failed
;
48 TP_printk("va_start: %lu size=%lu align=%lu vstart=0x%lx vend=0x%lx failed=%d",
49 __entry
->addr
, __entry
->size
, __entry
->align
,
50 __entry
->vstart
, __entry
->vend
, __entry
->failed
)
54 * purge_vmap_area_lazy - called when vmap areas were lazily freed
55 * @start: purging start address
56 * @end: purging end address
57 * @npurged: numbed of purged vmap areas
59 * This event is used for a debug purpose. It gives some
60 * indication about start:end range and how many objects
63 TRACE_EVENT(purge_vmap_area_lazy
,
65 TP_PROTO(unsigned long start
, unsigned long end
,
66 unsigned int npurged
),
68 TP_ARGS(start
, end
, npurged
),
71 __field(unsigned long, start
)
72 __field(unsigned long, end
)
73 __field(unsigned int, npurged
)
77 __entry
->start
= start
;
79 __entry
->npurged
= npurged
;
82 TP_printk("start=0x%lx end=0x%lx num_purged=%u",
83 __entry
->start
, __entry
->end
, __entry
->npurged
)
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
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.
97 TRACE_EVENT(free_vmap_area_noflush
,
99 TP_PROTO(unsigned long va_start
, unsigned long nr_lazy
,
100 unsigned long nr_lazy_max
),
102 TP_ARGS(va_start
, nr_lazy
, nr_lazy_max
),
105 __field(unsigned long, va_start
)
106 __field(unsigned long, nr_lazy
)
107 __field(unsigned long, nr_lazy_max
)
111 __entry
->va_start
= va_start
;
112 __entry
->nr_lazy
= nr_lazy
;
113 __entry
->nr_lazy_max
= nr_lazy_max
;
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
)
120 #endif /* _TRACE_VMALLOC_H */
122 /* This part must be outside protection */
123 #include <trace/define_trace.h>