From: Radoslaw Zarzynski Date: Tue, 4 May 2021 19:15:56 +0000 (+0000) Subject: log: fix the formatting when dumping thread IDs. X-Git-Tag: v16.2.15~28^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6fbe8effe057c77e13081c8b692dc49711bf8eb3;p=ceph.git log: fix the formatting when dumping thread IDs. 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 (cherry picked from commit 14706f9a568b0fe8994edc81583872ba135523ec) --- diff --git a/src/log/Log.cc b/src/log/Log.cc index f57f01adde0c..569816cac24d 100644 --- a/src/log/Log.cc +++ b/src/log/Log.cc @@ -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); }