^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #undef TRACE_SYSTEM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define TRACE_SYSTEM cpuhp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #if !defined(_TRACE_CPUHP_H) || defined(TRACE_HEADER_MULTI_READ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #define _TRACE_CPUHP_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #include <linux/tracepoint.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) TRACE_EVENT(cpuhp_enter,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) TP_PROTO(unsigned int cpu,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) int target,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) int idx,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) int (*fun)(unsigned int)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) TP_ARGS(cpu, target, idx, fun),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) __field( unsigned int, cpu )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) __field( int, target )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) __field( int, idx )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) __field( void *, fun )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) __entry->cpu = cpu;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) __entry->target = target;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) __entry->idx = idx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) __entry->fun = fun;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) TP_printk("cpu: %04u target: %3d step: %3d (%ps)",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) __entry->cpu, __entry->target, __entry->idx, __entry->fun)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) TRACE_EVENT(cpuhp_multi_enter,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) TP_PROTO(unsigned int cpu,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) int target,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) int idx,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) int (*fun)(unsigned int, struct hlist_node *),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) struct hlist_node *node),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) TP_ARGS(cpu, target, idx, fun, node),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) __field( unsigned int, cpu )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) __field( int, target )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) __field( int, idx )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) __field( void *, fun )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) __entry->cpu = cpu;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) __entry->target = target;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) __entry->idx = idx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) __entry->fun = fun;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) TP_printk("cpu: %04u target: %3d step: %3d (%ps)",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) __entry->cpu, __entry->target, __entry->idx, __entry->fun)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) TRACE_EVENT(cpuhp_exit,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) TP_PROTO(unsigned int cpu,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) int state,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) int idx,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) int ret),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) TP_ARGS(cpu, state, idx, ret),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) __field( unsigned int, cpu )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) __field( int, state )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) __field( int, idx )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) __field( int, ret )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) __entry->cpu = cpu;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) __entry->state = state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) __entry->idx = idx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) __entry->ret = ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) TP_printk(" cpu: %04u state: %3d step: %3d ret: %d",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) __entry->cpu, __entry->state, __entry->idx, __entry->ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) TRACE_EVENT(cpuhp_pause,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) TP_PROTO(struct cpumask *cpus, u64 start_time, unsigned char pause),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) TP_ARGS(cpus, start_time, pause),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) __field( unsigned int, cpus )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) __field( unsigned int, active_cpus )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) __field( unsigned int, time )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) __field( unsigned char, pause )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) __entry->cpus = cpumask_bits(cpus)[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) __entry->active_cpus = cpumask_bits(cpu_active_mask)[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) __entry->time = div64_u64(sched_clock() - start_time, 1000);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) __entry->pause = pause;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) TP_printk("req_cpus=0x%x act_cpus=0x%x time=%u us paused=%d",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) __entry->cpus, __entry->active_cpus, __entry->time, __entry->pause)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) /* This part must be outside protection */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) #include <trace/define_trace.h>