]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
log: fix the formatting when dumping thread IDs. 53465/head
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 4 May 2021 19:15:56 +0000 (19:15 +0000)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Sat, 14 Oct 2023 07:58:45 +0000 (14:58 +0700)
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>
(cherry picked from commit 14706f9a568b0fe8994edc81583872ba135523ec)

src/log/Log.cc

index f57f01adde0c0a3dca31126bbf2863ba524896e7..569816cac24dc6cd69e4a6b3afb97ca26c649550 100644 (file)
@@ -486,7 +486,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);
   }