From f8972737e0f3a56d329d0924e5837133b3997cfe Mon Sep 17 00:00:00 2001 From: Anup Sharma Date: Mon, 23 Dec 2024 22:52:27 +0530 Subject: [PATCH] tools/klockstat: Remove Byte String Prefix in Output Byte strings are printed directly, leading to output with the 'b' prefix example: Caller Avg Spin Count Max spin Total spin b'ep_poll+0x16b' 1096 26576 8180 29145121 b'drm_fb_helper_damage_work+0x97' 1705 32 2870 54580 b'process_one_work+0x178' 1325 55 2520 72879 b'ext4_evict_inode+0x283' 1625 11 2400 17880 This fix decode the byte strings After fix: Caller Avg Spin Count Max spin Total spin process_one_work+0x178 1569 24 3530 37657 ep_poll+0x16b 1037 12 3090 12450 kthread+0xf2 2336 3 2830 7010 rcu_tasks_kthread+0xa4 1642 5 2490 8210 Signed-off-by: Anup Sharma --- tools/klockstat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/klockstat.py b/tools/klockstat.py index 9599bfd3929e..2a53315d58eb 100755 --- a/tools/klockstat.py +++ b/tools/klockstat.py @@ -431,7 +431,7 @@ def display(sort, maxs, totals, counts): avg = totals[k].value / counts[k].value - print("%40s %10lu %6lu %10lu %10lu" % (caller, avg, counts[k].value, maxs[k].value, totals[k].value)) + print("%40s %10lu %6lu %10lu %10lu" % (caller.decode('utf-8', 'replace'), avg, counts[k].value, maxs[k].value, totals[k].value)) for addr in stack[2:args.stacks]: print("%40s" % b.ksym(addr, show_offset=True))