1 /* 2 * Copyright (C) 2015 Steve Muckle <smuckle@linaro.org> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License version 2 as 6 * published by the Free Software Foundation. 7 */ 8 9 #undef TRACE_SYSTEM 10 #define TRACE_SYSTEM cpufreq_sched 11 12 #if !defined(_TRACE_CPUFREQ_SCHED_H) || defined(TRACE_HEADER_MULTI_READ) 13 #define _TRACE_CPUFREQ_SCHED_H 14 15 #include <linux/sched.h> 16 #include <linux/tracepoint.h> 17 18 TRACE_EVENT(cpufreq_sched_throttled, 19 TP_PROTO(unsigned int rem), 20 TP_ARGS(rem), 21 TP_STRUCT__entry( 22 __field( unsigned int, rem) 23 ), 24 TP_fast_assign( 25 __entry->rem = rem; 26 ), 27 TP_printk("throttled - %d usec remaining", __entry->rem) 28 ); 29 30 TRACE_EVENT(cpufreq_sched_request_opp, 31 TP_PROTO(int cpu, 32 unsigned long capacity, 33 unsigned int freq_new, 34 unsigned int requested_freq), 35 TP_ARGS(cpu, capacity, freq_new, requested_freq), 36 TP_STRUCT__entry( 37 __field( int, cpu) 38 __field( unsigned long, capacity) 39 __field( unsigned int, freq_new) 40 __field( unsigned int, requested_freq) 41 ), 42 TP_fast_assign( 43 __entry->cpu = cpu; 44 __entry->capacity = capacity; 45 __entry->freq_new = freq_new; 46 __entry->requested_freq = requested_freq; 47 ), 48 TP_printk("cpu %d cap change, cluster cap request %ld => OPP %d " 49 "(cur %d)", 50 __entry->cpu, __entry->capacity, __entry->freq_new, 51 __entry->requested_freq) 52 ); 53 54 TRACE_EVENT(cpufreq_sched_update_capacity, 55 TP_PROTO(int cpu, 56 bool request, 57 struct sched_capacity_reqs *scr, 58 unsigned long new_capacity), 59 TP_ARGS(cpu, request, scr, new_capacity), 60 TP_STRUCT__entry( 61 __field( int, cpu) 62 __field( bool, request) 63 __field( unsigned long, cfs) 64 __field( unsigned long, rt) 65 __field( unsigned long, dl) 66 __field( unsigned long, total) 67 __field( unsigned long, new_total) 68 ), 69 TP_fast_assign( 70 __entry->cpu = cpu; 71 __entry->request = request; 72 __entry->cfs = scr->cfs; 73 __entry->rt = scr->rt; 74 __entry->dl = scr->dl; 75 __entry->total = scr->total; 76 __entry->new_total = new_capacity; 77 ), 78 TP_printk("cpu=%d set_cap=%d cfs=%ld rt=%ld dl=%ld old_tot=%ld " 79 "new_tot=%ld", 80 __entry->cpu, __entry->request, __entry->cfs, __entry->rt, 81 __entry->dl, __entry->total, __entry->new_total) 82 ); 83 84 #endif /* _TRACE_CPUFREQ_SCHED_H */ 85 86 /* This part must be outside protection */ 87 #include <trace/define_trace.h> 88