AnsweredAssumed Answered

[iMX25][PDK 1.6] How to activate pr_debug function?

Question asked by Franz TRIERWEILER on Dec 1, 2009
Latest reply on Jun 25, 2010 by Franz TRIERWEILER

Hello,

 

The PDK 1.6 contains a SIM card driver with debug capabilities.

 

The SIM card driver is in imx_sim.c (/rpm/BUILD/linux...../driver/char). The fact is that I am trying to debug the imx_sim.c source file for this SIM interface. mxc_sim is a SIM driver. In order to achieve this, I would like to enable pr_debug (...) output to my console when this driver is running and watch all debug messages displayed.

The kernel.h shows the pr_debug macro like this:

 /* If you are writing a driver, please use dev_dbg instead */ #if
 defined(CONFIG_DYNAMIC_PRINTK_DEBUG)
 #define pr_debug(fmt, ...) do { \
   dynamic_pr_debug(pr_fmt(fmt), ##__VA_ARGS__); \
    } while (0)
 #elif defined(DEBUG)
 #define pr_debug(fmt, ...) \
    printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) #else #define
 pr_debug(fmt, ...) \
    ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; })
 #endif


By browsing the LTIB menus, I found out (by searching in kernel hacking the label CONFIG_DYNAMIC_PRINTK_DEBUG) that I could select enable dynamic printk() call support option. The fact is that this options is enabled by writing the modules names in a file called debugfs which should be located in dynamic_printk/modules.

 

My questions are:

1- Is that mandatory to have the driver compiled and loaded as a module (<M>) (instead of part of the core kernel<*>)?

2- Where is the debugfs module? I cannot find the dynamic_printk/modules, the documentation is unclear on that topic.

 

Best Regards,

Franz

Outcomes