Skip to content

Commit d19bafd

Browse files
Artem BityutskiyArtem Bityutskiy
authored andcommitted
UBI: add PID to debugging prints
Also, use single dbg_msg() macro for all prints. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
1 parent 40e4d0c commit d19bafd

1 file changed

Lines changed: 7 additions & 14 deletions

File tree

‎drivers/mtd/ubi/debug.h‎

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@
3939

4040
#ifdef CONFIG_MTD_UBI_DEBUG_MSG
4141
/* Generic debugging message */
42-
#define dbg_msg(fmt, ...) \
43-
printk(KERN_DEBUG "UBI DBG: %s: " fmt "\n", __FUNCTION__, ##__VA_ARGS__)
42+
#define dbg_msg(fmt, ...) \
43+
printk(KERN_DEBUG "UBI DBG (pid %d): %s: " fmt "\n", \
44+
current->pid, __FUNCTION__, ##__VA_ARGS__)
4445

4546
#define ubi_dbg_dump_stack() dump_stack()
4647

@@ -76,36 +77,28 @@ void ubi_dbg_dump_mkvol_req(const struct ubi_mkvol_req *req);
7677

7778
#ifdef CONFIG_MTD_UBI_DEBUG_MSG_EBA
7879
/* Messages from the eraseblock association unit */
79-
#define dbg_eba(fmt, ...) \
80-
printk(KERN_DEBUG "UBI DBG eba: %s: " fmt "\n", __FUNCTION__, \
81-
##__VA_ARGS__)
80+
#define dbg_eba(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
8281
#else
8382
#define dbg_eba(fmt, ...) ({})
8483
#endif
8584

8685
#ifdef CONFIG_MTD_UBI_DEBUG_MSG_WL
8786
/* Messages from the wear-leveling unit */
88-
#define dbg_wl(fmt, ...) \
89-
printk(KERN_DEBUG "UBI DBG wl: %s: " fmt "\n", __FUNCTION__, \
90-
##__VA_ARGS__)
87+
#define dbg_wl(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
9188
#else
9289
#define dbg_wl(fmt, ...) ({})
9390
#endif
9491

9592
#ifdef CONFIG_MTD_UBI_DEBUG_MSG_IO
9693
/* Messages from the input/output unit */
97-
#define dbg_io(fmt, ...) \
98-
printk(KERN_DEBUG "UBI DBG io: %s: " fmt "\n", __FUNCTION__, \
99-
##__VA_ARGS__)
94+
#define dbg_io(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
10095
#else
10196
#define dbg_io(fmt, ...) ({})
10297
#endif
10398

10499
#ifdef CONFIG_MTD_UBI_DEBUG_MSG_BLD
105100
/* Initialization and build messages */
106-
#define dbg_bld(fmt, ...) \
107-
printk(KERN_DEBUG "UBI DBG bld: %s: " fmt "\n", __FUNCTION__, \
108-
##__VA_ARGS__)
101+
#define dbg_bld(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
109102
#else
110103
#define dbg_bld(fmt, ...) ({})
111104
#endif

0 commit comments

Comments
 (0)