]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
log: fix the formatting when dumping thread IDs. 41155/head
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 4 May 2021 19:15:56 +0000 (19:15 +0000)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 4 May 2021 19:23:50 +0000 (19:23 +0000)
When switching to `fmt::format()` we accidentaly changed
the format of how we dump threads ID in `Log::dump_recent()`.
This commit rectifies that.

Fixes: https://tracker.ceph.com/issues/50653
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/log/Log.cc

index 98c9bfce68efbadcb07a2bc9908778e47926fc3d..de99a3dd4ee813149bf1759f10ef9fefc70774dc 100644 (file)
@@ -409,7 +409,9 @@ void Log::dump_recent()
   {
     char pthread_name[16] = {0}; //limited by 16B include terminating null byte.
     ceph_pthread_getname(pthread_id, pthread_name, sizeof(pthread_name));
-    _log_message(fmt::format("  {} / {}",
+    // we want the ID to be printed in the same format as we use for a log entry.
+    // The reason is easier grepping.
+    _log_message(fmt::format("  {:x} / {}",
                             tid_to_int(pthread_id), pthread_name), true);
   }