mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-11 05:17:10 +09:00
ANDROID: sched/events: Introduce overutilized trace event
Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
Signed-off-by: Andres Oportus <andresoportus@google.com>
(cherry picked from commit 8e45d94128)
[ - Trivial cherry pick issues
- Changed commit title for consistency ]
Signed-off-by: Quentin Perret <quentin.perret@arm.com>
Change-Id: I78fb5e82223558def0cf16105c233591cda81d5c
This commit is contained in:
committed by
Quentin Perret
parent
3124a5b9d0
commit
6dfaed989e
@@ -964,6 +964,27 @@ TRACE_EVENT(sched_boost_task,
|
||||
__entry->margin)
|
||||
);
|
||||
|
||||
/*
|
||||
* Tracepoint for system overutilized flag
|
||||
*/
|
||||
TRACE_EVENT(sched_overutilized,
|
||||
|
||||
TP_PROTO(int overutilized),
|
||||
|
||||
TP_ARGS(overutilized),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field( int, overutilized )
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->overutilized = overutilized;
|
||||
),
|
||||
|
||||
TP_printk("overutilized=%d",
|
||||
__entry->overutilized)
|
||||
);
|
||||
|
||||
#endif /* CONFIG_SMP */
|
||||
#endif /* _TRACE_SCHED_H */
|
||||
|
||||
|
||||
@@ -5134,8 +5134,10 @@ static inline bool cpu_overutilized(int cpu)
|
||||
|
||||
static inline void update_overutilized_status(struct rq *rq)
|
||||
{
|
||||
if (!READ_ONCE(rq->rd->overutilized) && cpu_overutilized(rq->cpu))
|
||||
if (!READ_ONCE(rq->rd->overutilized) && cpu_overutilized(rq->cpu)) {
|
||||
WRITE_ONCE(rq->rd->overutilized, SG_OVERUTILIZED);
|
||||
trace_sched_overutilized(1);
|
||||
}
|
||||
}
|
||||
#else
|
||||
static inline void update_overutilized_status(struct rq *rq) { }
|
||||
@@ -8961,9 +8963,12 @@ next_group:
|
||||
|
||||
/* Update over-utilization (tipping point, U >= 0) indicator */
|
||||
WRITE_ONCE(rd->overutilized, sg_status & SG_OVERUTILIZED);
|
||||
trace_sched_overutilized(!!(sg_status & SG_OVERUTILIZED));
|
||||
} else if (sg_status & SG_OVERUTILIZED) {
|
||||
WRITE_ONCE(env->dst_rq->rd->overutilized, SG_OVERUTILIZED);
|
||||
trace_sched_overutilized(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user