All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Cheng-Yang Chou" <yphbchou0911@gmail.com>
Cc: sched-ext@lists.linux.dev
Subject: Re: [PATCH sched_ext/for-7.4] tools/sched_ext: Skip scx_lib_init_probe() without CONFIG_FUNCTION_TRACER
Date: Mon, 24 Aug 2026 16:02:07 +0000	[thread overview]
Message-ID: <20260824160207.D46791F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260824155051.20841-1-yphbchou0911@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The SCX_OPS_LOAD macro introduces a hard compile-time dependency on `scx_lib_init_probe` existing in the user's BPF skeleton, which will cause a C compiler error for schedulers that do not define this probe.
--

--- Patch [1]: [PATCH sched_ext/for-7.4] tools/sched_ext: Skip scx_lib_init_probe() without CONFIG_FUNCTION_TRACER ---
commit fc2df7f154a3b0d6909630ef49d7036552669ee3
Author: Cheng-Yang Chou <yphbchou0911@gmail.com>

tools/sched_ext: Skip scx_lib_init_probe() without CONFIG_FUNCTION_TRACER

This commit updates the SCX_OPS_LOAD macro to conditionally disable
autoload for the scx_lib_init_probe program if function tracing is
unavailable. It also modifies the post-load loop to skip programs that
have autoload disabled.

> diff --git a/tools/sched_ext/include/scx/compat.h b/tools/sched_ext/include/scx/compat.h
> --- a/tools/sched_ext/include/scx/compat.h
> +++ b/tools/sched_ext/include/scx/compat.h

[ ... ]

>  /* See SCX_OPS_OPEN() above for backward-compatibility handling. */
>  #define SCX_OPS_LOAD(__skel, __ops_name, __scx_name, __uei_name) ({		\
>  	struct bpf_program *__prog;						\
>  	UEI_SET_SIZE(__skel, __ops_name, __uei_name);				\
> +	if (!__COMPAT_function_tracer_available())				\
> +		bpf_program__set_autoload((__skel)->progs.scx_lib_init_probe, false); \

[Severity: Medium]
Will this cause a compile-time failure for out-of-tree schedulers that do
not include a scx_lib_init_probe program?

Skeletons generated by bpftool only contain fields for BPF programs that
are actually present in the BPF object. If a user's scheduler skeleton
lacks this specific probe, (__skel)->progs.scx_lib_init_probe won't exist
in the generated struct and will trigger a C compiler error when invoking
this macro.

Could this look up the program dynamically using
bpf_object__find_program_by_name() at runtime instead, to avoid breaking
compilation for schedulers without this probe?

>  	SCX_BUG_ON(__scx_name##__load((__skel)), "Failed to load skel");	\

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260824155051.20841-1-yphbchou0911@gmail.com?part=1

      reply	other threads:[~2026-08-24 16:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-24 15:50 [PATCH sched_ext/for-7.4] tools/sched_ext: Skip scx_lib_init_probe() without CONFIG_FUNCTION_TRACER Cheng-Yang Chou
2026-08-24 16:02 ` sashiko-bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260824160207.D46791F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=sched-ext@lists.linux.dev \
    --cc=yphbchou0911@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.