This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Enabling dev_dbg prints in the kernel 3.12



Hi Experts,

How to enable the dev_dbg prints in the dmesg of the Linux kernel version 3.12 of LInux SDK 7.0 ?

Regards,

Lyf

  • Please refer to the kernel document in the kernel source: 

    Documentation/dynamic-debug-howto.txt

  • Hi Bin,

    Thanks for the reply.


    I could see the reference document containing

    <debugfs>/dynamic_debug/control. For example, if you want to enable printing from source file 'svcsock.c', line 1603 you simply do: nullarbor:~ # echo 'file svcsock.c line 1603 +p' > <debugfs>/dynamic_debug/control If you make a mistake with the syntax, the write will fail thus: nullarbor:~ # echo 'file svcsock.c wtf 1 +p' > <debugfs>/dynamic_debug/control

    Where is this <debugfs> located ?

    Also when I try to mount the debugfs

    mount: mounting none on /sys/kernel/debug failed: Device or resource busy

    is displayed.

    The current directory of debug fs in my terminal is as follows

    root@am335x-evm:~# ls /sys/kernel/debug/
    asoc hid musb-hdrc.1.auto suspend_stats
    bdi iio pinctrl ti-st
    bluetooth kprobes pm_debug ubi
    clk memblock pwm ubifs
    dma_buf mmc0 regmap usb
    extfrag mmc1 regulator wakeup_sources
    gpio musb-hdrc.0.auto sleep_time



  • Hi Lyf,

    mount: mounting none on /sys/kernel/debug failed: Device or resource busy

    Where is this <debugfs> located ?

    Use "mount" command to check that where "debugfs" mounted and the message seems to be debugfs got mounted already.

  • Hi Titus,

    Consider I have the debug file system mounted at

    /sys/kernel/debug/

    I would like to add the debug prints for the file drivers/usb/serial/usb_serial.c

    How can I do this ?

    Regards,

    Lyf

  • # echo 'file usb_serial.c =p' > /sys/kernel/debug/dynamic_debug/control