Re: [RFC PATCH 2/5] sched/events: Introduce cfs_rq load tracking trace event

From: Dietmar Eggemann
Date: Wed Mar 29 2017 - 16:39:07 EST


On 03/28/2017 07:37 PM, Steven Rostedt wrote:
On Tue, 28 Mar 2017 13:36:26 -0400
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

But why play games, and rely on the design of the code? A
TRACE_EVENT_CONDTION() is more robust and documents that this
tracepoint should not be called when cfs_rq is NULL.

In other words, what are you trying to save for not using the
TRACE_EVENT_CONDITION()?

IMHO, if we could avoid this

if(cfs_rq)
trace_sched_load_cfs_rq(cfs_rq);
else
trace_sched_load_se(container_of(sa, struct sched_entity, avg));

in __update_load_avg(), then we can use 'unconditional' TRACE_EVENTs in all call-sites:

__update_load_avg{_cfs_rq}(), propagate_entity_load_avg(), attach_entity_load_avg(), detach_entity_load_avg() for cfs_rq and

__update_load_avg_blocked_se(), __update_load_avg_se(), propagate_entity_load_avg() for se.

[...]