Commit d19bafd9 authored by Artem Bityutskiy's avatar Artem Bityutskiy

UBI: add PID to debugging prints

Also, use single dbg_msg() macro for all prints.
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent 40e4d0c1
...@@ -39,8 +39,9 @@ ...@@ -39,8 +39,9 @@
#ifdef CONFIG_MTD_UBI_DEBUG_MSG #ifdef CONFIG_MTD_UBI_DEBUG_MSG
/* Generic debugging message */ /* Generic debugging message */
#define dbg_msg(fmt, ...) \ #define dbg_msg(fmt, ...) \
printk(KERN_DEBUG "UBI DBG: %s: " fmt "\n", __FUNCTION__, ##__VA_ARGS__) printk(KERN_DEBUG "UBI DBG (pid %d): %s: " fmt "\n", \
current->pid, __FUNCTION__, ##__VA_ARGS__)
#define ubi_dbg_dump_stack() dump_stack() #define ubi_dbg_dump_stack() dump_stack()
...@@ -76,36 +77,28 @@ void ubi_dbg_dump_mkvol_req(const struct ubi_mkvol_req *req); ...@@ -76,36 +77,28 @@ void ubi_dbg_dump_mkvol_req(const struct ubi_mkvol_req *req);
#ifdef CONFIG_MTD_UBI_DEBUG_MSG_EBA #ifdef CONFIG_MTD_UBI_DEBUG_MSG_EBA
/* Messages from the eraseblock association unit */ /* Messages from the eraseblock association unit */
#define dbg_eba(fmt, ...) \ #define dbg_eba(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
printk(KERN_DEBUG "UBI DBG eba: %s: " fmt "\n", __FUNCTION__, \
##__VA_ARGS__)
#else #else
#define dbg_eba(fmt, ...) ({}) #define dbg_eba(fmt, ...) ({})
#endif #endif
#ifdef CONFIG_MTD_UBI_DEBUG_MSG_WL #ifdef CONFIG_MTD_UBI_DEBUG_MSG_WL
/* Messages from the wear-leveling unit */ /* Messages from the wear-leveling unit */
#define dbg_wl(fmt, ...) \ #define dbg_wl(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
printk(KERN_DEBUG "UBI DBG wl: %s: " fmt "\n", __FUNCTION__, \
##__VA_ARGS__)
#else #else
#define dbg_wl(fmt, ...) ({}) #define dbg_wl(fmt, ...) ({})
#endif #endif
#ifdef CONFIG_MTD_UBI_DEBUG_MSG_IO #ifdef CONFIG_MTD_UBI_DEBUG_MSG_IO
/* Messages from the input/output unit */ /* Messages from the input/output unit */
#define dbg_io(fmt, ...) \ #define dbg_io(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
printk(KERN_DEBUG "UBI DBG io: %s: " fmt "\n", __FUNCTION__, \
##__VA_ARGS__)
#else #else
#define dbg_io(fmt, ...) ({}) #define dbg_io(fmt, ...) ({})
#endif #endif
#ifdef CONFIG_MTD_UBI_DEBUG_MSG_BLD #ifdef CONFIG_MTD_UBI_DEBUG_MSG_BLD
/* Initialization and build messages */ /* Initialization and build messages */
#define dbg_bld(fmt, ...) \ #define dbg_bld(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
printk(KERN_DEBUG "UBI DBG bld: %s: " fmt "\n", __FUNCTION__, \
##__VA_ARGS__)
#else #else
#define dbg_bld(fmt, ...) ({}) #define dbg_bld(fmt, ...) ({})
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment