Commit bac3fc0e authored by Qais Yousef's avatar Qais Yousef Committed by Ionela Voinescu
Browse files

sched_tp: fix compilation error on SMP systems with NR_CPUS=2

SPAN_SIZE was being set to 0 when NR_CPUS was 2; which triggererd
a compile time assertion. Which exposed a bug in the logic where we
where rounding down instead of up. Fix it by using round_up() to ensure
we get the correct span size for the NR_CPUS.

Ensure as well that we don't use a spansize greather than 128. The trace
str can't take arbitrarly large size. It's limited to 256 but be more
conservative and cap it to 128.
Signed-off-by: Qais Yousef's avatarQais Yousef <>
parent 841ea8bb
......@@ -2,11 +2,14 @@
#define TRACE_SYSTEM sched
#define MAX_SPAN_SIZE 128
#if !defined(_SCHED_EVENTS_H) || defined(TRACE_HEADER_MULTI_READ)
#define PATH_SIZE 64
#define __SPAN_SIZE (round_up(NR_CPUS, 4)/4)
#include <linux/tracepoint.h>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment