Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe1a6966 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
Browse files

sched: don't use preprocessor directives inside a macro



The preprocessor directives are used inside sched_enq_deq_task
trace point which is a macro. This is forbidden and sparse gives
an error. To fix this, we always print the task walt stats in this
trace point. When WALT is not enabled, the stats are printed as 0.

Change-Id: Ibe3460e7c22b85220c2088da4570c2c9fd03c848
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent 70be28c9
Loading
Loading
Loading
Loading
+4 −13
Original line number Diff line number Diff line
@@ -71,10 +71,8 @@ TRACE_EVENT(sched_enq_deq_task,
		__field(unsigned long,	cpu_load		)
		__field(unsigned int,	rt_nr_running		)
		__field(unsigned int,	cpus_allowed		)
#ifdef CONFIG_SCHED_WALT
		__field(unsigned int,	demand			)
		__field(unsigned int,	pred_demand		)
#endif
	),

	TP_fast_assign(
@@ -87,24 +85,17 @@ TRACE_EVENT(sched_enq_deq_task,
		__entry->cpu_load	= task_rq(p)->cpu_load[0];
		__entry->rt_nr_running	= task_rq(p)->rt.rt_nr_running;
		__entry->cpus_allowed	= cpus_allowed;
#ifdef CONFIG_SCHED_WALT
		__entry->demand		= p->ravg.demand;
		__entry->pred_demand	= p->ravg.pred_demand;
#endif
		__entry->demand		= task_load(p);
		__entry->pred_demand	= task_pl(p);
	),

	TP_printk("cpu=%d %s comm=%s pid=%d prio=%d nr_running=%u cpu_load=%lu rt_nr_running=%u affine=%x"
#ifdef CONFIG_SCHED_WALT
			" demand=%u pred_demand=%u"
#endif
			, __entry->cpu,
	TP_printk("cpu=%d %s comm=%s pid=%d prio=%d nr_running=%u cpu_load=%lu rt_nr_running=%u affine=%x demand=%u pred_demand=%u",
			__entry->cpu,
			__entry->enqueue ? "enqueue" : "dequeue",
			__entry->comm, __entry->pid,
			__entry->prio, __entry->nr_running,
			__entry->cpu_load, __entry->rt_nr_running, __entry->cpus_allowed
#ifdef CONFIG_SCHED_WALT
			, __entry->demand, __entry->pred_demand
#endif
			)
);

+6 −0
Original line number Diff line number Diff line
@@ -2536,6 +2536,11 @@ static inline unsigned int task_load(struct task_struct *p)
	return p->ravg.demand;
}

static inline unsigned int task_pl(struct task_struct *p)
{
	return p->ravg.pred_demand;
}

#define pct_to_real(tunable)	\
		(div64_u64((u64)tunable * (u64)max_task_load(), 100))

@@ -2798,6 +2803,7 @@ struct related_thread_group *task_related_thread_group(struct task_struct *p)
}

static inline u32 task_load(struct task_struct *p) { return 0; }
static inline u32 task_pl(struct task_struct *p) { return 0; }

static inline int update_preferred_cluster(struct related_thread_group *grp,
			 struct task_struct *p, u32 old_load)