From 14706f9a568b0fe8994edc81583872ba135523ec Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Tue, 4 May 2021 19:15:56 +0000 Subject: [PATCH] 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 --- src/log/Log.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/log/Log.cc b/src/log/Log.cc index 98c9bfce68e..de99a3dd4ee 100644 --- a/src/log/Log.cc +++ b/src/log/Log.cc @@ -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); } -- 2.47.3