From 55dcd2ee5a6183c748c0dd553a9400bc7de768a1 Mon Sep 17 00:00:00 2001 From: xingfeng2510 Date: Sun, 13 Mar 2022 18:13:57 +0800 Subject: [PATCH] tools: Fix bytes<->str mixing in python3 --- tools/btrfsdist.py | 2 +- tools/hardirqs.py | 2 +- tools/xfsdist.py | 2 +- tools/zfsdist.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/btrfsdist.py b/tools/btrfsdist.py index 72ea304a284e..a9bf6e49e11a 100755 --- a/tools/btrfsdist.py +++ b/tools/btrfsdist.py @@ -231,7 +231,7 @@ if args.interval and (not args.notimestamp): print(strftime("%H:%M:%S:")) - dist.print_log2_hist(label, "operation") + dist.print_log2_hist(label, "operation", section_print_fn=bytes.decode) dist.clear() countdown -= 1 diff --git a/tools/hardirqs.py b/tools/hardirqs.py index 4e373d9cde6c..239d813952e1 100755 --- a/tools/hardirqs.py +++ b/tools/hardirqs.py @@ -241,7 +241,7 @@ print("%-8s\n" % strftime("%H:%M:%S"), end="") if args.dist: - dist.print_log2_hist(label, "hardirq") + dist.print_log2_hist(label, "hardirq", section_print_fn=bytes.decode) else: print("%-26s %11s" % ("HARDIRQ", "TOTAL_" + label)) for k, v in sorted(dist.items(), key=lambda dist: dist[1].value): diff --git a/tools/xfsdist.py b/tools/xfsdist.py index 58f73afd6202..163c2207e985 100755 --- a/tools/xfsdist.py +++ b/tools/xfsdist.py @@ -169,7 +169,7 @@ if args.interval and (not args.notimestamp): print(strftime("%H:%M:%S:")) - dist.print_log2_hist(label, "operation") + dist.print_log2_hist(label, "operation", section_print_fn=bytes.decode) dist.clear() countdown -= 1 diff --git a/tools/zfsdist.py b/tools/zfsdist.py index a30671daf463..f9c229c78ec0 100755 --- a/tools/zfsdist.py +++ b/tools/zfsdist.py @@ -183,7 +183,7 @@ if args.interval and (not args.notimestamp): print(strftime("%H:%M:%S:")) - dist.print_log2_hist(label, "operation") + dist.print_log2_hist(label, "operation", section_print_fn=bytes.decode) dist.clear() countdown -= 1