英文:
Kprobe BPF programs execution order
问题
Is there a reliable way to explicitly specify BPF kprobe programs execution order (without kretprobes).
For example, when I name programs like kprobe__<func>_1
and kprobe__<func>_2
, I get an execution order like kprobe__<func>_2
-> kprobe__<func>_1
, that is in backward order. Does the order of programs loading or its name make sense? I can't find any documentation about that and don't know how to make sure that my programs will be executed in the order I really need on whole kernels.
I was just trying to rename my functions with suffixes [n]
, where n
is a strictly positive number (including zero), and it works but doesn't guarantee that it will work on all kernels the same.
英文:
Is there a reliable way to explicitly specify BPF kprobe programs execution order (without kretprobes).
For example, when I name programs like kprobe__<func>_1
and kprobe__<func>_2
I get an execution order like kprobe__<func>_2
-> kprobe__<func>_1
, that is in backward order. Does the order of programs loading or it's name makes sense? I can't find any documentation about that and don't know how to make sure that my programs will be executed in order I really need on whole kernels.
I was just trying to rename my functions with suffixes _[n]
, where n
is strighly positive number (including zero), and it works, but doesn't gives sure that it will work on whole kernels same.
答案1
得分: 1
以下是要翻译的内容:
无法保证kprobe程序的特定执行顺序,因为在不同的内核版本中,排序可能会有所不同。即使依赖命名约定或程序加载的顺序也不能保证特定的执行顺序。
因此,建议设计独立于彼此执行顺序的kprobe程序,或将它们合并为一个程序。
英文:
It is not possible to guarantee a particular execution order of kprobe programs since the ordering can vary across different kernel versions. Even relying on naming conventions or the order in which the programs were loaded does not guarantee a specific execution order.
Therefore, it is advisable to design kprobe programs that are independent of each other's order of execution or combine them into one.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论