kallsyms是否具有内核功能的所有符号

kallsyms是否具有内核功能的所有符号

本文介绍了kallsyms是否具有内核功能的所有符号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Linux内核中,我想探究内核功能effective_prio().它定义为static.当我在 kallsyms 中搜索它的符号时,找不到它. kallsyms 是否具有内核功能的所有符号?如果没有,哪些符号不包括在内?

In the Linux kernel I want to probe the kernel function effective_prio(). It defined as static.When I go to search the symbol of it in the kallsyms I cannot find it. Does kallsyms have all the symbol of the kernel functions? If not, which symbols are not included?

推荐答案

对于在/proc/kallsyms中不出现的功能,有两种可能性:

There are two possibilities for a function not appearing in /proc/kallsyms:

  1. 如果该功能被标记为static,并且编译器决定内联该功能(带有或不带有inline关键字)
  2. 如果一个配置选项或另一个#define从编译中删除了一个函数,例如:

  1. If the function is marked as static, and the compiler decides to inline the function (with or without the inline keyword)
  2. If a config option or another #define removes a function from being compiled, e.g.:

#ifdef CONFIG_OPT
void foo(void) {
}
#endif

据我所知,如果一个功能没有出现在/proc/kallsyms中,则不可能从模块中调用或探测它.但是,/proc/kallsyms包含内核的所有功能,而不仅仅是通过EXPORT_SYMBOL/EXPORT_SYMBOL_GPL导出的功能.

As far as I know, if a function does not appear in /proc/kallsyms, it is not possible to call or probe it from a module.However, /proc/kallsyms contains all functions of the kernel, not just the ones exported via EXPORT_SYMBOL/EXPORT_SYMBOL_GPL.

这篇关于kallsyms是否具有内核功能的所有符号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-02 02:44