Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / include / trace / events / percpu.h
blob5b8211ca895002812b37fb3d227bac433cc3b0bd
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
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),
21 TP_STRUCT__entry(
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 )
28 __field( int, off )
29 __field( void __percpu *, ptr )
30 __field( size_t, bytes_alloc )
31 __field( unsigned long, gfp_flags )
33 TP_fast_assign(
34 __entry->call_site = call_site;
35 __entry->reserved = reserved;
36 __entry->is_atomic = is_atomic;
37 __entry->size = size;
38 __entry->align = align;
39 __entry->base_addr = base_addr;
40 __entry->off = off;
41 __entry->ptr = ptr;
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),
60 TP_STRUCT__entry(
61 __field( void *, base_addr )
62 __field( int, off )
63 __field( void __percpu *, ptr )
66 TP_fast_assign(
67 __entry->base_addr = base_addr;
68 __entry->off = off;
69 __entry->ptr = ptr;
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),
82 TP_STRUCT__entry(
83 __field( bool, reserved )
84 __field( bool, is_atomic )
85 __field( size_t, size )
86 __field( size_t, align )
89 TP_fast_assign(
90 __entry->reserved = reserved;
91 __entry->is_atomic = is_atomic;
92 __entry->size = size;
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),
105 TP_ARGS(base_addr),
107 TP_STRUCT__entry(
108 __field( void *, base_addr )
111 TP_fast_assign(
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),
122 TP_ARGS(base_addr),
124 TP_STRUCT__entry(
125 __field( void *, base_addr )
128 TP_fast_assign(
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>