1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 2df95e795SDennis Zhou #undef TRACE_SYSTEM 3df95e795SDennis Zhou #define TRACE_SYSTEM percpu 4df95e795SDennis Zhou 5df95e795SDennis Zhou #if !defined(_TRACE_PERCPU_H) || defined(TRACE_HEADER_MULTI_READ) 6df95e795SDennis Zhou #define _TRACE_PERCPU_H 7df95e795SDennis Zhou 8df95e795SDennis Zhou #include <linux/tracepoint.h> 9f67bed13SVasily Averin #include <trace/events/mmflags.h> 10df95e795SDennis Zhou 11df95e795SDennis Zhou TRACE_EVENT(percpu_alloc_percpu, 12df95e795SDennis Zhou 13f67bed13SVasily Averin TP_PROTO(unsigned long call_site, 14f67bed13SVasily Averin bool reserved, bool is_atomic, size_t size, 15f67bed13SVasily Averin size_t align, void *base_addr, int off, 16f67bed13SVasily Averin void __percpu *ptr, size_t bytes_alloc, gfp_t gfp_flags), 17df95e795SDennis Zhou 18f67bed13SVasily Averin TP_ARGS(call_site, reserved, is_atomic, size, align, base_addr, off, 19f67bed13SVasily Averin ptr, bytes_alloc, gfp_flags), 20df95e795SDennis Zhou 21df95e795SDennis Zhou TP_STRUCT__entry( 22f67bed13SVasily Averin __field( unsigned long, call_site ) 23df95e795SDennis Zhou __field( bool, reserved ) 24df95e795SDennis Zhou __field( bool, is_atomic ) 25df95e795SDennis Zhou __field( size_t, size ) 26df95e795SDennis Zhou __field( size_t, align ) 27df95e795SDennis Zhou __field( void *, base_addr ) 28df95e795SDennis Zhou __field( int, off ) 29df95e795SDennis Zhou __field( void __percpu *, ptr ) 30f67bed13SVasily Averin __field( size_t, bytes_alloc ) 31*e5c3f619SVasily Averin __field( unsigned long, gfp_flags ) 32df95e795SDennis Zhou ), 33df95e795SDennis Zhou TP_fast_assign( 34f67bed13SVasily Averin __entry->call_site = call_site; 35df95e795SDennis Zhou __entry->reserved = reserved; 36df95e795SDennis Zhou __entry->is_atomic = is_atomic; 37df95e795SDennis Zhou __entry->size = size; 38df95e795SDennis Zhou __entry->align = align; 39df95e795SDennis Zhou __entry->base_addr = base_addr; 40df95e795SDennis Zhou __entry->off = off; 41df95e795SDennis Zhou __entry->ptr = ptr; 42f67bed13SVasily Averin __entry->bytes_alloc = bytes_alloc; 43*e5c3f619SVasily Averin __entry->gfp_flags = (__force unsigned long)gfp_flags; 44df95e795SDennis Zhou ), 45df95e795SDennis Zhou 46f67bed13SVasily Averin 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", 47f67bed13SVasily Averin (void *)__entry->call_site, 48df95e795SDennis Zhou __entry->reserved, __entry->is_atomic, 49df95e795SDennis Zhou __entry->size, __entry->align, 50f67bed13SVasily Averin __entry->base_addr, __entry->off, __entry->ptr, 51f67bed13SVasily Averin __entry->bytes_alloc, show_gfp_flags(__entry->gfp_flags)) 52df95e795SDennis Zhou ); 53df95e795SDennis Zhou 54df95e795SDennis Zhou TRACE_EVENT(percpu_free_percpu, 55df95e795SDennis Zhou 56df95e795SDennis Zhou TP_PROTO(void *base_addr, int off, void __percpu *ptr), 57df95e795SDennis Zhou 58df95e795SDennis Zhou TP_ARGS(base_addr, off, ptr), 59df95e795SDennis Zhou 60df95e795SDennis Zhou TP_STRUCT__entry( 61df95e795SDennis Zhou __field( void *, base_addr ) 62df95e795SDennis Zhou __field( int, off ) 63df95e795SDennis Zhou __field( void __percpu *, ptr ) 64df95e795SDennis Zhou ), 65df95e795SDennis Zhou 66df95e795SDennis Zhou TP_fast_assign( 67df95e795SDennis Zhou __entry->base_addr = base_addr; 68df95e795SDennis Zhou __entry->off = off; 69df95e795SDennis Zhou __entry->ptr = ptr; 70df95e795SDennis Zhou ), 71df95e795SDennis Zhou 72df95e795SDennis Zhou TP_printk("base_addr=%p off=%d ptr=%p", 73df95e795SDennis Zhou __entry->base_addr, __entry->off, __entry->ptr) 74df95e795SDennis Zhou ); 75df95e795SDennis Zhou 76df95e795SDennis Zhou TRACE_EVENT(percpu_alloc_percpu_fail, 77df95e795SDennis Zhou 78df95e795SDennis Zhou TP_PROTO(bool reserved, bool is_atomic, size_t size, size_t align), 79df95e795SDennis Zhou 80df95e795SDennis Zhou TP_ARGS(reserved, is_atomic, size, align), 81df95e795SDennis Zhou 82df95e795SDennis Zhou TP_STRUCT__entry( 83df95e795SDennis Zhou __field( bool, reserved ) 84df95e795SDennis Zhou __field( bool, is_atomic ) 85df95e795SDennis Zhou __field( size_t, size ) 86df95e795SDennis Zhou __field( size_t, align ) 87df95e795SDennis Zhou ), 88df95e795SDennis Zhou 89df95e795SDennis Zhou TP_fast_assign( 90df95e795SDennis Zhou __entry->reserved = reserved; 91df95e795SDennis Zhou __entry->is_atomic = is_atomic; 92df95e795SDennis Zhou __entry->size = size; 93df95e795SDennis Zhou __entry->align = align; 94df95e795SDennis Zhou ), 95df95e795SDennis Zhou 96df95e795SDennis Zhou TP_printk("reserved=%d is_atomic=%d size=%zu align=%zu", 97df95e795SDennis Zhou __entry->reserved, __entry->is_atomic, 98df95e795SDennis Zhou __entry->size, __entry->align) 99df95e795SDennis Zhou ); 100df95e795SDennis Zhou 101df95e795SDennis Zhou TRACE_EVENT(percpu_create_chunk, 102df95e795SDennis Zhou 103df95e795SDennis Zhou TP_PROTO(void *base_addr), 104df95e795SDennis Zhou 105df95e795SDennis Zhou TP_ARGS(base_addr), 106df95e795SDennis Zhou 107df95e795SDennis Zhou TP_STRUCT__entry( 108df95e795SDennis Zhou __field( void *, base_addr ) 109df95e795SDennis Zhou ), 110df95e795SDennis Zhou 111df95e795SDennis Zhou TP_fast_assign( 112df95e795SDennis Zhou __entry->base_addr = base_addr; 113df95e795SDennis Zhou ), 114df95e795SDennis Zhou 115df95e795SDennis Zhou TP_printk("base_addr=%p", __entry->base_addr) 116df95e795SDennis Zhou ); 117df95e795SDennis Zhou 118df95e795SDennis Zhou TRACE_EVENT(percpu_destroy_chunk, 119df95e795SDennis Zhou 120df95e795SDennis Zhou TP_PROTO(void *base_addr), 121df95e795SDennis Zhou 122df95e795SDennis Zhou TP_ARGS(base_addr), 123df95e795SDennis Zhou 124df95e795SDennis Zhou TP_STRUCT__entry( 125df95e795SDennis Zhou __field( void *, base_addr ) 126df95e795SDennis Zhou ), 127df95e795SDennis Zhou 128df95e795SDennis Zhou TP_fast_assign( 129df95e795SDennis Zhou __entry->base_addr = base_addr; 130df95e795SDennis Zhou ), 131df95e795SDennis Zhou 132df95e795SDennis Zhou TP_printk("base_addr=%p", __entry->base_addr) 133df95e795SDennis Zhou ); 134df95e795SDennis Zhou 135df95e795SDennis Zhou #endif /* _TRACE_PERCPU_H */ 136df95e795SDennis Zhou 137df95e795SDennis Zhou #include <trace/define_trace.h> 138