Skip to main content
 首页 » 操作系统

Linux dynamic_debug和pr_debug()打印_高通平台

2022年07月19日251duanxz

一、dynamic_debug讲解

待补充...

二、pr_debug打印

1. 在 arch/arm64/configs/defconfig 中使能 CONFIG_DYNAMIC_DEBUG

CONFIG_DYNAMIC_DEBUG=y

2. 比如要打开 core_ctl.c 中的 pr_debug() 打印的信息,执行:

# echo -n "file core_ctl.c +p" > /sys/kernel/debug/dynamic_debug/control

注:这里使用到了debugfs, Qcom平台user版本默认是不带debugfs的,因此要使用userdebug版本

3. 验证

# dmesg -c | grep core_ctl 
[21263.219736] core_ctl: Trying to adjust group 4 from 2 to 3 
[21263.225962] core_ctl: Trying to adjust group 7 from 0 to 1 
[21263.225967] core_ctl: Trying to unisolate CPU7

本文参考链接:https://www.cnblogs.com/hellokitty2/p/14746489.html