__entry->nrgn, __entry->nrgp)
);
+/*
+ * Tracepoint for schedtune_tasks_update
+ */
+TRACE_EVENT(sched_tune_filter,
+
+ TP_PROTO(int nrg_delta, int cap_delta,
+ int nrg_gain, int cap_gain,
+ int payoff, int region),
+
+ TP_ARGS(nrg_delta, cap_delta, nrg_gain, cap_gain, payoff, region),
+
+ TP_STRUCT__entry(
+ __field( int, nrg_delta )
+ __field( int, cap_delta )
+ __field( int, nrg_gain )
+ __field( int, cap_gain )
+ __field( int, payoff )
+ __field( int, region )
+ ),
+
+ TP_fast_assign(
+ __entry->nrg_delta = nrg_delta;
+ __entry->cap_delta = cap_delta;
+ __entry->nrg_gain = nrg_gain;
+ __entry->cap_gain = cap_gain;
+ __entry->payoff = payoff;
+ __entry->region = region;
+ ),
+
+ TP_printk("nrg_delta=%d cap_delta=%d nrg_gain=%d cap_gain=%d payoff=%d region=%d",
+ __entry->nrg_delta, __entry->cap_delta,
+ __entry->nrg_gain, __entry->cap_gain,
+ __entry->payoff, __entry->region)
+);
+
#endif /* _TRACE_SCHED_H */
/* This part must be outside protection */
*/
payoff = nrg_delta * threshold_gains[perf_boost_idx].cap_gain;
payoff -= cap_delta * threshold_gains[perf_boost_idx].nrg_gain;
+
+ trace_sched_tune_filter(
+ nrg_delta, cap_delta,
+ threshold_gains[perf_boost_idx].nrg_gain,
+ threshold_gains[perf_boost_idx].cap_gain,
+ payoff, 8);
+
return payoff;
}
*/
payoff = cap_delta * threshold_gains[perf_constrain_idx].nrg_gain;
payoff -= nrg_delta * threshold_gains[perf_constrain_idx].cap_gain;
+
+ trace_sched_tune_filter(
+ nrg_delta, cap_delta,
+ threshold_gains[perf_constrain_idx].nrg_gain,
+ threshold_gains[perf_constrain_idx].cap_gain,
+ payoff, 6);
+
return payoff;
}
int perf_constrain_idx;
/* Optimal (O) region */
- if (nrg_delta < 0 && cap_delta > 0)
+ if (nrg_delta < 0 && cap_delta > 0) {
+ trace_sched_tune_filter(nrg_delta, cap_delta, 0, 0, 1, 0);
return INT_MAX;
+ }
/* Suboptimal (S) region */
- if (nrg_delta > 0 && cap_delta < 0)
+ if (nrg_delta > 0 && cap_delta < 0) {
+ trace_sched_tune_filter(nrg_delta, cap_delta, 0, 0, -1, 5);
return -INT_MAX;
+ }
/* Get task specific perf Boost/Constraints indexes */
rcu_read_lock();
struct task_struct *task)
{
/* Optimal (O) region */
- if (nrg_delta < 0 && cap_delta > 0)
+ if (nrg_delta < 0 && cap_delta > 0) {
+ trace_sched_tune_filter(nrg_delta, cap_delta, 0, 0, 1, 0);
return INT_MAX;
+ }
/* Suboptimal (S) region */
- if (nrg_delta > 0 && cap_delta < 0)
+ if (nrg_delta > 0 && cap_delta < 0) {
+ trace_sched_tune_filter(nrg_delta, cap_delta, 0, 0, -1, 5);
return -INT_MAX;
+ }
return __schedtune_accept_deltas(nrg_delta, cap_delta,
perf_boost_idx, perf_constrain_idx);