1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM percpu
5 #if !defined(_TRACE_PERCPU_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_PERCPU_H
8 #include <linux/tracepoint.h>
9 #include <trace/events/mmflags.h>
11 TRACE_EVENT(percpu_alloc_percpu
,
13 TP_PROTO(unsigned long call_site
,
14 bool reserved
, bool is_atomic
, size_t size
,
15 size_t align
, void *base_addr
, int off
,
16 void __percpu
*ptr
, size_t bytes_alloc
, gfp_t gfp_flags
),
18 TP_ARGS(call_site
, reserved
, is_atomic
, size
, align
, base_addr
, off
,
19 ptr
, bytes_alloc
, gfp_flags
),
22 __field( unsigned long, call_site
)
23 __field( bool, reserved
)
24 __field( bool, is_atomic
)
25 __field( size_t, size
)
26 __field( size_t, align
)
27 __field( void *, base_addr
)
29 __field( void __percpu
*, ptr
)
30 __field( size_t, bytes_alloc
)
31 __field( unsigned long, gfp_flags
)
34 __entry
->call_site
= call_site
;
35 __entry
->reserved
= reserved
;
36 __entry
->is_atomic
= is_atomic
;
38 __entry
->align
= align
;
39 __entry
->base_addr
= base_addr
;
42 __entry
->bytes_alloc
= bytes_alloc
;
43 __entry
->gfp_flags
= (__force
unsigned long)gfp_flags
;
46 TP_printk("call_site=%pS reserved=%d is_atomic=%d size=%zu align=%zu base_addr=%p off=%d ptr=%p bytes_alloc=%zu gfp_flags=%s",
47 (void *)__entry
->call_site
,
48 __entry
->reserved
, __entry
->is_atomic
,
49 __entry
->size
, __entry
->align
,
50 __entry
->base_addr
, __entry
->off
, __entry
->ptr
,
51 __entry
->bytes_alloc
, show_gfp_flags(__entry
->gfp_flags
))
54 TRACE_EVENT(percpu_free_percpu
,
56 TP_PROTO(void *base_addr
, int off
, void __percpu
*ptr
),
58 TP_ARGS(base_addr
, off
, ptr
),
61 __field( void *, base_addr
)
63 __field( void __percpu
*, ptr
)
67 __entry
->base_addr
= base_addr
;
72 TP_printk("base_addr=%p off=%d ptr=%p",
73 __entry
->base_addr
, __entry
->off
, __entry
->ptr
)
76 TRACE_EVENT(percpu_alloc_percpu_fail
,
78 TP_PROTO(bool reserved
, bool is_atomic
, size_t size
, size_t align
),
80 TP_ARGS(reserved
, is_atomic
, size
, align
),
83 __field( bool, reserved
)
84 __field( bool, is_atomic
)
85 __field( size_t, size
)
86 __field( size_t, align
)
90 __entry
->reserved
= reserved
;
91 __entry
->is_atomic
= is_atomic
;
93 __entry
->align
= align
;
96 TP_printk("reserved=%d is_atomic=%d size=%zu align=%zu",
97 __entry
->reserved
, __entry
->is_atomic
,
98 __entry
->size
, __entry
->align
)
101 TRACE_EVENT(percpu_create_chunk
,
103 TP_PROTO(void *base_addr
),
108 __field( void *, base_addr
)
112 __entry
->base_addr
= base_addr
;
115 TP_printk("base_addr=%p", __entry
->base_addr
)
118 TRACE_EVENT(percpu_destroy_chunk
,
120 TP_PROTO(void *base_addr
),
125 __field( void *, base_addr
)
129 __entry
->base_addr
= base_addr
;
132 TP_printk("base_addr=%p", __entry
->base_addr
)
135 #endif /* _TRACE_PERCPU_H */
137 #include <trace/define_trace.h>