Add scx_bpf_error() calls when scx_bpf_create_dsq() fails in the remaining
schedulers to improve debuggability:
- scx_simple.bpf.c: simple_init()
- scx_sdt.bpf.c: sdt_init()
- scx_cpu0.bpf.c: cpu0_init()
- scx_flatcg.bpf.c: fcg_init()
This follows the same pattern established in commit
2f8d489897ae
("sched_ext: Add error logging for dsq creation failures") for other
schedulers and ensures consistent error reporting across all schedulers.
Signed-off-by: zhidao su <suzhidao@xiaomi.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
s32 BPF_STRUCT_OPS_SLEEPABLE(cpu0_init)
{
- return scx_bpf_create_dsq(DSQ_CPU0, -1);
+ int ret;
+
+ ret = scx_bpf_create_dsq(DSQ_CPU0, -1);
+ if (ret) {
+ scx_bpf_error("failed to create DSQ %d (%d)", DSQ_CPU0, ret);
+ return ret;
+ }
+
+ return 0;
}
void BPF_STRUCT_OPS(cpu0_exit, struct scx_exit_info *ei)
s32 BPF_STRUCT_OPS_SLEEPABLE(fcg_init)
{
- return scx_bpf_create_dsq(FALLBACK_DSQ, -1);
+ int ret;
+
+ ret = scx_bpf_create_dsq(FALLBACK_DSQ, -1);
+ if (ret) {
+ scx_bpf_error("failed to create DSQ %d (%d)", FALLBACK_DSQ, ret);
+ return ret;
+ }
+
+ return 0;
}
void BPF_STRUCT_OPS(fcg_exit, struct scx_exit_info *ei)
return ret;
}
- return scx_bpf_create_dsq(SHARED_DSQ, -1);
+ ret = scx_bpf_create_dsq(SHARED_DSQ, -1);
+ if (ret) {
+ scx_bpf_error("failed to create DSQ %d (%d)", SHARED_DSQ, ret);
+ return ret;
+ }
+
+ return 0;
}
void BPF_STRUCT_OPS(sdt_exit, struct scx_exit_info *ei)
s32 BPF_STRUCT_OPS_SLEEPABLE(simple_init)
{
- return scx_bpf_create_dsq(SHARED_DSQ, -1);
+ int ret;
+
+ ret = scx_bpf_create_dsq(SHARED_DSQ, -1);
+ if (ret) {
+ scx_bpf_error("failed to create DSQ %d (%d)", SHARED_DSQ, ret);
+ return ret;
+ }
+
+ return 0;
}
void BPF_STRUCT_OPS(simple_exit, struct scx_exit_info *ei)