]> git.dujemihanovic.xyz Git - linux.git/commitdiff
sched_ext: Fix build when !CONFIG_STACKTRACE
authorTejun Heo <tj@kernel.org>
Mon, 23 Sep 2024 16:45:22 +0000 (06:45 -1000)
committerTejun Heo <tj@kernel.org>
Mon, 23 Sep 2024 16:45:22 +0000 (06:45 -1000)
a2f4b16e736d ("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 <tj@kernel.org>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202409220642.fDW2OmWc-lkp@intel.com/
kernel/sched/ext.c

index 9ee5a9a261cc6b44b6c5400e67616f4850e45cea..7c320dcd72d52fa815f8106a22570a7037d17111 100644 (file)
@@ -4469,8 +4469,9 @@ static void scx_ops_disable_workfn(struct kthread_work *work)
 
                if (ei->msg[0] != '\0')
                        pr_err("sched_ext: %s: %s\n", scx_ops.name, ei->msg);
-
+#ifdef CONFIG_STACKTRACE
                stack_trace_print(ei->bt, ei->bt_len, 2);
+#endif
        } else {
                pr_info("sched_ext: BPF scheduler \"%s\" disabled (%s)\n",
                        scx_ops.name, ei->reason);
@@ -4847,10 +4848,10 @@ static __printf(3, 4) void scx_ops_exit_kind(enum scx_exit_kind kind,
                return;
 
        ei->exit_code = exit_code;
-
+#ifdef CONFIG_STACKTRACE
        if (kind >= SCX_EXIT_ERROR)
                ei->bt_len = stack_trace_save(ei->bt, SCX_EXIT_BT_LEN, 1);
-
+#endif
        va_start(args, fmt);
        vscnprintf(ei->msg, SCX_EXIT_MSG_LEN, fmt, args);
        va_end(args);