Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp811958rdb; Thu, 30 Nov 2023 21:37:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IFr6H3I/BhWiFcEEcIJ4UnQICwOk+kV0oyzM76KaMHagF3pq73nyEGhRXfuwNsKYxPoHU03 X-Received: by 2002:a17:90a:c68a:b0:285:c04e:d69b with SMTP id n10-20020a17090ac68a00b00285c04ed69bmr16649183pjt.25.1701409022587; Thu, 30 Nov 2023 21:37:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701409022; cv=none; d=google.com; s=arc-20160816; b=wS8pIvmoipgn2a5kKyMzsCX/XynC57uSuxCSY+A9YYv3VZbehTsd/Q1K35ZcoT97Pi f33PaWi54IvUceLPEkvOrBeazin7IG6lnMqkeU6N9LckUwhCFTyFPBRYbaeooTgesmHM o5lEGEnNHHPhy6TNgVmzyd7bginZjbWKkXstxraH+G8ITq3dBDX9Kw0g+MIE5JBRuUU4 2tbEtk/IU9Mdxi84/wNjczHxCUS6sBtElrd81AZ5UtZJ5o/yaJEt8ha/Vh9k2JTp290y 2T+l4uV6xiBKKEjfI1Rdd/UaTFmVo3Ikhn4kIsWlD5cVUfMyFhJlJcpsIRcqUUJK5Hlm Snxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=HESwLHHdHt3Wm3/PvCiwVqfG0CrrAPykoQCh+VuXM6w=; fh=IpIYOUWU7dZWcCfeFiN8fVROeERAyGdV2dC8GHX6iF4=; b=le3fmTcjzrx4GDqBdpDia48cE/OU1YEI8Tw6HYe9OmXm7FJy84YeOFXzAVezD0ERK8 231xXhR/3KzeFz50V4aEm9HDE9dtymUMR4bMOXyVsSejYErbzNgA2GUohgbGQAJjH5um m2BcGGpJwJR/QqtQNCaynY3DoNHqCvyi3wUQAqOWZoToX3ChJ7wH9z1/4xmGKhEKuQzS XVIFRost4QUtl/fUqAd54FHCKUwuVH/RRUGghC5+2PgKgZgnUK6kGpTCVVEls/Ui6gQz 43UNO6BhEz6CsHOGjke7eYaOa8k1DiL0y8m7Sp44rv40b0vk3A2EIEw76A8t/l7iWrAt PEOA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=link.tyut.edu.cn Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id g8-20020a17090a9b8800b00285105c440esi2795061pjp.120.2023.11.30.21.37.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 21:37:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=link.tyut.edu.cn Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 2E71680DFF78; Thu, 30 Nov 2023 21:37:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377402AbjLAFgu (ORCPT + 99 others); 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: 8bit X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWS1ZQUlXWQ8JGhUIEh9ZQVkZQ0JMVhlLHUIZQ0wdSE1JTFUTARMWGhIXJBQOD1 lXWRgSC1lBWUpKSlVOSVVNVUlLSVlXWRYaDxIVHRRZQVlLVUtVS1VLWQY+ X-HM-Tid: 0a8c23e08a49b03akuuudbb7e8000b5 X-HM-MType: 10 X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6Py46Mhw6DDw2SxUuKjRLHh8q ORowCwNVSlVKTEtKT0tDQk1DSE9NVTMWGhIXVUlLSUhLS0lLQ0I7FxIVEFUPAg4PVR4fDlUYFUVZ V1kSC1lBWUpKSlVOSVVNVUlLSVlXWQgBWUFISktMNwY+ X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 30 Nov 2023 21:37:00 -0800 (PST) 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 def usage(): - print ("""usage: show_delta [] + print("""usage: show_delta [] 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 # split on closing bracket - (time_str, rest) = string.split(line[1:],']',1) + (time_str, rest) = string.split(line[1:], ']', 1) time = string.atof(time_str) #print "time=", time @@ -81,9 +81,9 @@ def main(): base_str = "" filein = "" for arg in sys.argv[1:]: - if arg=="-b": - base_str = sys.argv[sys.argv.index("-b")+1] - elif arg=="-h": + if arg == "-b": + base_str = sys.argv[sys.argv.index("-b") + 1] + elif arg == "-h": usage() else: filein = arg @@ -92,7 +92,7 @@ def main(): usage() try: - lines = open(filein,"r").readlines() + lines = open(filein, "r").readlines() except: print ("Problem opening file: %s" % filein) sys.exit(1) @@ -111,19 +111,19 @@ def main(): (time, rest) = get_time(line) except: continue - if string.find(rest, base_str)==1: + if string.find(rest, base_str) == 1: base_time = time found = 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 = 0.0 for line in lines: - print (convert_line(line, base_time),) + print(convert_line(line, base_time),) if __name__ == "__main__": main() -- 2.34.1