Conversation
1ca2cb7 to
35f56af
Compare
|
Could you please elaborate a little on the issue that this PR is supposed to fix? |
Currently trying to use zolspinup on a system where sd_mod module is compiled as a module fails with the following error: bpf: sd_resume_runtime is not found in vmlinux BTF ... Exception: Failed to load BPF program b'kfunc__vmlinux__sd_resume_runtime': No such file or directory This is because when the target function is in a module, the eBPF program must use MODULE_KFUNC_PROBE instead of KFUNC_PROBE. This commit adds support for both cases by checking whether sd_mod is loaded as a module and if yes, using MODULE_KFUNC_PROBE-based eBPF program. sd_mod is compiled as a module in popular Linux distributions by default, such as on Debian Bookworm and Trixie (BLK_DEV_SD=m).
35f56af to
a45fcbc
Compare
|
@geppi I am sorry for producing poor PR and commit description the first time. I've now updated both to include full information about what the problem was. Please let me know if I could improve them more. |
|
@geppi Just a friendly ping :-) |
|
Sorry, I'm currently a little bit swamped. It's not forgotten. |
geppi
left a comment
There was a problem hiding this comment.
This would be a nice improvement.
However, in this form the PR does create a large diff for a small change in the BPF program strings.
I would prefer a diff that highlights what really had to be changed to implement the improvement.
| ) | ||
| else: | ||
| eBPF_program = ZpoolRpmManager.eBPF_resume_monitor | ||
| eBPF_program = self.__get_eBPF_resume_monitor() |
There was a problem hiding this comment.
The conditional replace operation on the strings could be directly performed in the start_monitor method in the above if/else statement like
)
else:
if self.__is_sd_mod_module:
eBPF_program = ZpoolRpmManager.eBPF_resume_monitor.replace('KFUNC_PROBE(', 'MODULE_KFUNC_PROBE(sd_mod, ')
else:
eBPF_program = ZpoolRpmManager.eBPF_resume_monitor
Also adding a log message in the init method that tells when the module was detected would be nice.
Currently trying to use zolspinup on a system where sd_mod module is compiled as a module fails with the following error:
This is because when the target function is in a module, the eBPF program must use MODULE_KFUNC_PROBE instead of KFUNC_PROBE.
This commit adds support for both cases by checking whether sd_mod is loaded as a module and if yes, using MODULE_KFUNC_PROBE-based eBPF program.
sd_mod is compiled as a module in popular Linux distributions by default, such as on Debian Bookworm and Trixie (BLK_DEV_SD=m).