Skip to contentSkip to conversation

ceph: add process/thread ID into debug output

PATCH In review Viacheslav Dubeyko 2 participants 2 messages Feb 6, 2025

Subsystems (2)
lore
Share & tools
lore

Viacheslav Dubeyko

author maintainer
#0 lore raw

PATCH 1/1 ceph: add process/thread ID into debug output

From: Viacheslav Dubeyko <[email protected]>

Process/Thread ID (pid) is crucial and essential info during the debug and bug fix. It is really hard to analyze the debug output without these details. This patch addes PID info into the debug output.

---
 include/linux/ceph/ceph_debug.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
include/linux/ceph/ceph_debug.h +5 -3
index 5f904591fa5f..6292db198f61 100644
@@ -16,13 +16,15 @@
 
 # if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
 #  define dout(fmt, ...)						\
-	pr_debug("%.*s %12.12s:%-4d : " fmt,				\
+	pr_debug("pid %d %.*s %12.12s:%-4d : " fmt,			\
+		 current->pid,						\
 		 8 - (int)sizeof(KBUILD_MODNAME), "    ",		\
 		 kbasename(__FILE__), __LINE__, ##__VA_ARGS__)
 #  define doutc(client, fmt, ...)					\
-	pr_debug("%.*s %12.12s:%-4d : [%pU %llu] " fmt,			\
+	pr_debug("pid %d %.*s %12.12s:%-4d %s() : [%pU %llu] " fmt,	\
+		 current->pid,						\
 		 8 - (int)sizeof(KBUILD_MODNAME), "    ",		\
-		 kbasename(__FILE__), __LINE__,				\
+		 kbasename(__FILE__), __LINE__, __func__,		\
 		 &client->fsid, client->monc.auth->global_id,		\
 		 ##__VA_ARGS__)
 # else
Signature · 1 line
2.48.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 39 lines · Viacheslav Dubeyko

From: Viacheslav Dubeyko <[email protected]>

Process/Thread ID (pid) is crucial and essential info during the debug and bug fix. It is really hard to analyze the debug output without these details. This patch addes PID info into the debug output.

---
 include/linux/ceph/ceph_debug.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
include/linux/ceph/ceph_debug.h +5 -4
index 5f904591fa5f..6292db198f61 100644
@@ -16,13 +16,15 @@
 
 # if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
 #  define dout(fmt, ...)                                               \
-       pr_debug("%.*s %12.12s:%-4d : " fmt,                            \
+       pr_debug("pid %d %.*s %12.12s:%-4d : " fmt,                     \
+                current->pid,                                          \
                 8 - (int)sizeof(KBUILD_MODNAME), "    ",               \
                 kbasename(__FILE__), __LINE__, ##__VA_ARGS__)
 #  define doutc(client, fmt, ...)                                      \
-       pr_debug("%.*s %12.12s:%-4d : [%pU %llu] " fmt,                 \
+       pr_debug("pid %d %.*s %12.12s:%-4d %s() : [%pU %llu] " fmt,     \
+                current->pid,                                          \
                 8 - (int)sizeof(KBUILD_MODNAME), "    ",               \
-                kbasename(__FILE__), __LINE__,                         \
+                kbasename(__FILE__), __LINE__, __func__,               \
                 &client->fsid, client->monc.auth->global_id,           \
                 ##__VA_ARGS__)
 # else
--

2.48.0