Skip to content

Commit fcbc423

Browse files
vishalc-ibmhtejun
authored andcommitted
sched_ext: Add __weak markers to BPF helper function decalarations
Fix build errors by adding __weak markers to BPF helper function declarations in header files. This resolves static assertion failures in scx_qmap.bpf.c and scx_flatcg.bpf.c where functions like scx_bpf_dispatch_from_dsq_set_slice, scx_bpf_dispatch_from_dsq_set_vtime, and scx_bpf_task_cgroup were missing the __weak attribute. [1] https://lore.kernel.org/all/[email protected] Signed-off-by: Vishal Chourasia <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent 95b8736 commit fcbc423

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/sched_ext/include/scx/common.bpf.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ void scx_bpf_dispatch_vtime(struct task_struct *p, u64 dsq_id, u64 slice, u64 vt
4141
u32 scx_bpf_dispatch_nr_slots(void) __ksym;
4242
void scx_bpf_dispatch_cancel(void) __ksym;
4343
bool scx_bpf_consume(u64 dsq_id) __ksym;
44-
void scx_bpf_dispatch_from_dsq_set_slice(struct bpf_iter_scx_dsq *it__iter, u64 slice) __ksym;
45-
void scx_bpf_dispatch_from_dsq_set_vtime(struct bpf_iter_scx_dsq *it__iter, u64 vtime) __ksym;
44+
void scx_bpf_dispatch_from_dsq_set_slice(struct bpf_iter_scx_dsq *it__iter, u64 slice) __ksym __weak;
45+
void scx_bpf_dispatch_from_dsq_set_vtime(struct bpf_iter_scx_dsq *it__iter, u64 vtime) __ksym __weak;
4646
bool scx_bpf_dispatch_from_dsq(struct bpf_iter_scx_dsq *it__iter, struct task_struct *p, u64 dsq_id, u64 enq_flags) __ksym __weak;
4747
bool scx_bpf_dispatch_vtime_from_dsq(struct bpf_iter_scx_dsq *it__iter, struct task_struct *p, u64 dsq_id, u64 enq_flags) __ksym __weak;
4848
u32 scx_bpf_reenqueue_local(void) __ksym;
@@ -71,7 +71,7 @@ s32 scx_bpf_pick_any_cpu(const cpumask_t *cpus_allowed, u64 flags) __ksym;
7171
bool scx_bpf_task_running(const struct task_struct *p) __ksym;
7272
s32 scx_bpf_task_cpu(const struct task_struct *p) __ksym;
7373
struct rq *scx_bpf_cpu_rq(s32 cpu) __ksym;
74-
struct cgroup *scx_bpf_task_cgroup(struct task_struct *p) __ksym;
74+
struct cgroup *scx_bpf_task_cgroup(struct task_struct *p) __ksym __weak;
7575

7676
/*
7777
* Use the following as @it__iter when calling

0 commit comments

Comments
 (0)