ftrace preempt_depth字段未更新

问题描述

我编写了一个示例程序来测试ftrace输出的preempt-depth字段。

来自ftrace文档:

preempt-depthpreempt_disabled

的级别

我的示例代码:

#include <linux/kernel.h>
#include <linux/module.h>
MODULE_LICENSE("GPL");


static int test_hello_init(void)
{

    trace_printk("%s: In init\n",__func__);
    preempt_disable();
    trace_printk("Disabled preemption:%d\n",smp_processor_id());
    preempt_enable();
    trace_printk("Enabled preemption:%d\n",smp_processor_id());
    return 0;

}
static void test_hello_exit(void)
{
    trace_printk("%s: In exit\n",__func__);
}

module_init(test_hello_init);
module_exit(test_hello_exit);

在跟踪文件中输出:

insmod-27709 [003] .... 155744.793916: test_hello_init: test_hello_init: In init
insmod-27709 [003] .... 155744.793918: test_hello_init: Disabled preemption:3
insmod-27709 [003] .... 155744.793919: test_hello_init: Enabled preemption:3
                      ^
                      should be a number indicating preempt-depth

为什么preempt-depth字段为空?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...