From: Kieran Bingham Date: Mon, 23 May 2016 23:25:21 +0000 (-0700) Subject: scripts/gdb: decode bytestream on dmesg for Python3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b3b08429857b209d8bb9785a15b8247421bf4973;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git scripts/gdb: decode bytestream on dmesg for Python3 The recent fixes to lx-dmesg, now allow the command to print successfully on Python3, however the python interpreter wraps the bytes for each line with a b'' marker. To remove this, we need to decode the line, where .decode() will default to 'UTF-8' Link: http://lkml.kernel.org/r/d67ccf93f2479c94cb3399262b9b796e0dbefcf2.1462865983.git.jan.kiszka@siemens.com Signed-off-by: Kieran Bingham Acked-by: Dom Cote Tested-by: Dom Cote Signed-off-by: Jan Kiszka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/gdb/linux/dmesg.py b/scripts/gdb/linux/dmesg.py index 04d6719067f2..f9b92ece7834 100644 --- a/scripts/gdb/linux/dmesg.py +++ b/scripts/gdb/linux/dmesg.py @@ -51,10 +51,10 @@ class LxDmesg(gdb.Command): continue text_len = utils.read_u16(log_buf[pos + 10:pos + 12]) - text = log_buf[pos + 16:pos + 16 + text_len] + text = log_buf[pos + 16:pos + 16 + text_len].decode() time_stamp = utils.read_u64(log_buf[pos:pos + 8]) - for line in memoryview(text).tobytes().splitlines(): + for line in text.splitlines(): gdb.write("[{time:12.6f}] {line}\n".format( time=time_stamp / 1000000000.0, line=line))