Skip to content

Commit 62d3726

Browse files
committed
sched_ext: Fix build when !CONFIG_STACKTRACE
a2f4b16 ("sched_ext: Build fix on !CONFIG_STACKTRACE[_SUPPORT]") tried fixing build when !CONFIG_STACKTRACE but didn't so fully. Also put stack_trace_print() and stack_trace_save() inside CONFIG_STACKTRACE to fix build when !CONFIG_STACKTRACE. Signed-off-by: Tejun Heo <[email protected]> Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
1 parent edf1c58 commit 62d3726

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

kernel/sched/ext.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4469,8 +4469,9 @@ static void scx_ops_disable_workfn(struct kthread_work *work)
44694469

44704470
if (ei->msg[0] != '\0')
44714471
pr_err("sched_ext: %s: %s\n", scx_ops.name, ei->msg);
4472-
4472+
#ifdef CONFIG_STACKTRACE
44734473
stack_trace_print(ei->bt, ei->bt_len, 2);
4474+
#endif
44744475
} else {
44754476
pr_info("sched_ext: BPF scheduler \"%s\" disabled (%s)\n",
44764477
scx_ops.name, ei->reason);
@@ -4847,10 +4848,10 @@ static __printf(3, 4) void scx_ops_exit_kind(enum scx_exit_kind kind,
48474848
return;
48484849

48494850
ei->exit_code = exit_code;
4850-
4851+
#ifdef CONFIG_STACKTRACE
48514852
if (kind >= SCX_EXIT_ERROR)
48524853
ei->bt_len = stack_trace_save(ei->bt, SCX_EXIT_BT_LEN, 1);
4853-
4854+
#endif
48544855
va_start(args, fmt);
48554856
vscnprintf(ei->msg, SCX_EXIT_MSG_LEN, fmt, args);
48564857
va_end(args);

0 commit comments

Comments
 (0)