diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h index eeceafaaea4c..c12f40463f4c 100644 --- a/include/trace/events/irq.h +++ b/include/trace/events/irq.h @@ -160,6 +160,37 @@ DEFINE_EVENT(softirq, softirq_raise, TP_ARGS(vec_nr) ); +DECLARE_EVENT_CLASS(tasklet, + + TP_PROTO(void *func), + + TP_ARGS(func), + + TP_STRUCT__entry( + __field( void *, func) + ), + + TP_fast_assign( + __entry->func = func; + ), + + TP_printk("function=%ps", __entry->func) +); + +DEFINE_EVENT(tasklet, tasklet_entry, + + TP_PROTO(void *func), + + TP_ARGS(func) +); + +DEFINE_EVENT(tasklet, tasklet_exit, + + TP_PROTO(void *func), + + TP_ARGS(func) +); + #endif /* _TRACE_IRQ_H */ /* This part must be outside protection */ diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 714e874b975e..6bd0fcbcab99 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -650,11 +650,10 @@ struct cfs_rq { struct list_head leaf_cfs_rq_list; struct task_group *tg; /* group that "owns" this runqueue */ +#ifdef CONFIG_CFS_BANDWIDTH #ifdef CONFIG_SCHED_WALT struct walt_sched_stats walt_stats; #endif - -#ifdef CONFIG_CFS_BANDWIDTH int runtime_enabled; s64 runtime_remaining; @@ -2169,7 +2168,7 @@ cpu_util_freq_walt(int cpu, struct sched_walt_cpu_load *walt_load); #define sched_ravg_window TICK_NSEC static inline u64 sched_ktime_clock(void) { - return 0; + return sched_clock(); } #endif @@ -2646,16 +2645,20 @@ DECLARE_PER_CPU(struct update_util_data __rcu *, cpufreq_update_util_data); static inline void cpufreq_update_util(struct rq *rq, unsigned int flags) { struct update_util_data *data; + u64 clock; #ifdef CONFIG_SCHED_WALT if (!(flags & SCHED_CPUFREQ_WALT)) return; + clock = sched_ktime_clock(); +#else + clock = rq_clock(rq); #endif data = rcu_dereference_sched(*per_cpu_ptr(&cpufreq_update_util_data, cpu_of(rq))); if (data) - data->func(data, sched_ktime_clock(), flags); + data->func(data, clock, flags); } #else static inline void cpufreq_update_util(struct rq *rq, unsigned int flags) {} diff --git a/kernel/softirq.c b/kernel/softirq.c index 13edfcbb71c8..0ee55ec4f7a0 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -523,7 +523,9 @@ static void tasklet_action_common(struct softirq_action *a, if (!test_and_clear_bit(TASKLET_STATE_SCHED, &t->state)) BUG(); + trace_tasklet_entry(t->func); t->func(t->data); + trace_tasklet_exit(t->func); tasklet_unlock(t); continue; }