-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Byte String Prefix in Output #5179
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you change the commit title like below, similar to other tools, it will make it easier to view the git log later.
"tools/klockstat: ~~"
tools/klockstat.py
Outdated
@@ -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'), avg, counts[k].value, maxs[k].value, totals[k].value)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you provide a second argument to prevent a UnicodeDecodeError, similar to how other tools handle it?
caller.decode('utf-8', 'replace')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ekyooo thanks for the review, I have updated the PR. Do let me know if anything else is required.
d0b2b1b
to
fba9b78
Compare
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 <[email protected]>
fba9b78
to
f897273
Compare
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