From nobody Tue Dec 16 17:00:59 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AF8DC4167B for ; Fri, 1 Dec 2023 05:36:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377472AbjLAFgu (ORCPT ); Fri, 1 Dec 2023 00:36:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229505AbjLAFgs (ORCPT ); Fri, 1 Dec 2023 00:36:48 -0500 Received: from mail-m49198.qiye.163.com (mail-m49198.qiye.163.com [45.254.49.198]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B10A1703 for ; Thu, 30 Nov 2023 21:36:51 -0800 (PST) Received: from localhost.localdomain (unknown [111.52.6.202]) by mail-m121145.qiye.163.com (Hmail) with ESMTPA id DBB7E8000B5; Fri, 1 Dec 2023 13:36:06 +0800 (CST) From: Hu Haowen <2023002089@link.tyut.edu.cn> To: gregkh@linuxfoundation.org, akpm@linux-foundation.org Cc: Hu Haowen <2023002089@link.tyut.edu.cn>, masahiroy@kernel.org, ndesaulniers@google.com, n.schier@avm.de, ojeda@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] scripts/show_delta: reformat code Date: Fri, 1 Dec 2023 13:35:40 +0800 Message-Id: <20231201053540.9534-1-2023002089@link.tyut.edu.cn> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWS1ZQUlXWQ8JGhUIEh9ZQVkZQ0JMVhlLHUIZQ0wdSE1JTFUTARMWGhIXJBQOD1 lXWRgSC1lBWUpKSlVOSVVNVUlLSVlXWRYaDxIVHRRZQVlLVUtVS1VLWQY+ X-HM-Tid: 0a8c23e08a49b03akuuudbb7e8000b5 X-HM-MType: 10 X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6Py46Mhw6DDw2SxUuKjRLHh8q ORowCwNVSlVKTEtKT0tDQk1DSE9NVTMWGhIXVUlLSUhLS0lLQ0I7FxIVEFUPAg4PVR4fDlUYFUVZ V1kSC1lBWUpKSlVOSVVNVUlLSVlXWQgBWUFISktMNwY+ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Correct some lines in irregular coding style to make them look more harmonious and fit the common coding regulations in Python. Signed-off-by: Hu Haowen <2023002089@link.tyut.edu.cn> --- scripts/show_delta | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/show_delta b/scripts/show_delta index 291ad65e3089..33446adce74b 100755 --- a/scripts/show_delta +++ b/scripts/show_delta @@ -13,7 +13,7 @@ import sys import string =20 def usage(): - print ("""usage: show_delta [] + print("""usage: show_delta [] =20 This program parses the output from a set of printk message lines which have time data prefixed because the CONFIG_PRINTK_TIME option is set, or @@ -46,7 +46,7 @@ def get_time(line): raise ValueError =20 # split on closing bracket - (time_str, rest) =3D string.split(line[1:],']',1) + (time_str, rest) =3D string.split(line[1:], ']', 1) time =3D string.atof(time_str) =20 #print "time=3D", time @@ -81,9 +81,9 @@ def main(): base_str =3D "" filein =3D "" for arg in sys.argv[1:]: - if arg=3D=3D"-b": - base_str =3D sys.argv[sys.argv.index("-b")+1] - elif arg=3D=3D"-h": + if arg =3D=3D "-b": + base_str =3D sys.argv[sys.argv.index("-b") + 1] + elif arg =3D=3D "-h": usage() else: filein =3D arg @@ -92,7 +92,7 @@ def main(): usage() =20 try: - lines =3D open(filein,"r").readlines() + lines =3D open(filein, "r").readlines() except: print ("Problem opening file: %s" % filein) sys.exit(1) @@ -111,19 +111,19 @@ def main(): (time, rest) =3D get_time(line) except: continue - if string.find(rest, base_str)=3D=3D1: + if string.find(rest, base_str) =3D=3D 1: base_time =3D time found =3D 1 # stop at first match break if not found: - print ('Couldn\'t find line matching base pattern "%s"' % base_str) + print('Couldn\'t find line matching base pattern "%s"' % base_str) sys.exit(1) else: base_time =3D 0.0 =20 for line in lines: - print (convert_line(line, base_time),) + print(convert_line(line, base_time),) =20 if __name__ =3D=3D "__main__": main() --=20 2.34.1