From patchwork Tue Sep 12 06:07:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gray X-Patchwork-Id: 140516 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1147293vqi; Fri, 15 Sep 2023 08:57:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHGFB28z3C/CcM0nXVpNbdCAqh+6UMXgjQHg8sLKhJ2Zur7v7+4HCnTCjj8TF/6vc+wQTU+ X-Received: by 2002:a05:6a00:179b:b0:68f:b7f6:f1df with SMTP id s27-20020a056a00179b00b0068fb7f6f1dfmr2400888pfg.5.1694793430165; Fri, 15 Sep 2023 08:57:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694793430; cv=none; d=google.com; s=arc-20160816; b=kSKvbN4OBpVERsi6Lfxkw6m4IHIy8cjYYkvHvly2sXo01NKPfPo8D6bHt5Cr9Y4Hp7 AhBSZOQv1k5I/B758aBAMhJqy2GoVhCuQDR+4+NnEwPGu0ESpSmZdc53yIjzKptOyNl3 4dV0QvX4amLSAzPShEiNiUF1sTBcWjcIqBN3Rtg20TTZg7KdK3wnRkvQ0bdI8iIiJK0b Mn2SgX4/I5Qd9/9Puckd7R8JRccRVl0AIHPzp7zjfDP1gMcwkVP4bAybPyIkxq8+6Hca VjQBraeVlQKghhNrEfLsjtE6qRUOda44cZRkgXZApVGPTSpeXqW+x/tQFjmOVfpWs342 SfRg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=AHbcqJ2CieRG9hp04VV8TGkxNE1F6nI9dc1SB21bi+c=; fh=iXnGog/S+cxG51hz3+a6seiRv5742LjMh//2j1hYtKc=; b=E/Uw7pxZQqG4dyH3AMYRll5Z9CzqlK7C0/Fu49SRdVSgQSYIfqPu6oDZJuyAId/hjT g1QZtaabAY4DxzRrDfZbnOnY52T1rgTXl6rxgX7jKVZ+/rOfsVc5BEyCGb8kGJ8ZGQc6 TSZxOhJCJiJ/fqmyyl8RPSxV0qLx5rSdsxZeG1bA3xf3peQZD1hWfCIdEHvhHtFt4RzA Qa64dqcYTfvx6SxvTwjHngTcunwsWWhGHNJdXYkWFsRfmnxkZeSR8tMsYhxbDPJbe8q6 EURwgnMkDytNY/wRgLAfyuQ6xjGhtysOelWhExUu4bW4x4vgV7fY4PQPEym13kbof8qB 7fyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=KL+HGGv6; 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=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id cr7-20020a056a000f0700b0068e29a05fa4si3446974pfb.326.2023.09.15.08.57.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 08:57:10 -0700 (PDT) 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; dkim=pass header.i=@ibm.com header.s=pp1 header.b=KL+HGGv6; 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=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 9A43183A98C4; Mon, 11 Sep 2023 23:09:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.8 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230351AbjILGJh (ORCPT + 39 others); Tue, 12 Sep 2023 02:09:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229907AbjILGJF (ORCPT ); Tue, 12 Sep 2023 02:09:05 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97CD31703; Mon, 11 Sep 2023 23:08:55 -0700 (PDT) Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38C5mYkm022911; Tue, 12 Sep 2023 06:08:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=AHbcqJ2CieRG9hp04VV8TGkxNE1F6nI9dc1SB21bi+c=; b=KL+HGGv6nI2bTy7njwn26PxsHbyEE1JS45DdUTWZ8bBeBB6Yj2aG4RzaFZ8rNn8JHjq6 33w3Hk4LaJnp/RA7mIsjf7cFTcn2czaKsJB5NuIGmpRL1kux2V354quKyHE1xcstH0Eg tMQ+gndQfl8DXw/cqpukXILWeSOwZJHCbUJ0UyHEfg9G8644BXDs4nw+/FE8HezRGpxN buLU/gANH6WviS3YEL6oze0+hEJUql3t1foFx2TrdChLf51BVD3jy+lYMyp6bGgqi7c5 n7lQ/H69ONCv/hlh7o0kvJ8yU95dyajmY0vdOkvuSTly264aa2kvQupcsmq8MCRQtfbH yA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3t2gmraq03-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Sep 2023 06:08:20 +0000 Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 38C67JsQ018554; Tue, 12 Sep 2023 06:08:19 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3t2gmrapy9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Sep 2023 06:08:19 +0000 Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 38C5K8rl012005; Tue, 12 Sep 2023 06:08:17 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3t15r1r6ap-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Sep 2023 06:08:17 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 38C68GcO28705526 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 Sep 2023 06:08:16 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0E64620040; Tue, 12 Sep 2023 06:08:16 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7FA5520043; Tue, 12 Sep 2023 06:08:15 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 12 Sep 2023 06:08:15 +0000 (GMT) Received: from bgray-lenovo-p15.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 5956060595; Tue, 12 Sep 2023 16:08:13 +1000 (AEST) From: Benjamin Gray To: linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, llvm@lists.linux.dev, linux-pm@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: Jonathan Corbet , Ian Abbott , H Hartley Sweeten , Nathan Chancellor , Nick Desaulniers , Tom Rix , Jan Kiszka , Kieran Bingham , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , linux-perf-users@vger.kernel.org, Todd E Brandt , Andrii Nakryiko , Mykola Lysenko , Shuah Khan , Benjamin Gray Subject: [PATCH v2 4/7] scripts: fix Python string escapes Date: Tue, 12 Sep 2023 16:07:58 +1000 Message-ID: <20230912060801.95533-5-bgray@linux.ibm.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230912060801.95533-1-bgray@linux.ibm.com> References: <20230912060801.95533-1-bgray@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: A2TrB0HujiOs_UwzMmju5UXnpzVKn05t X-Proofpoint-ORIG-GUID: 3euzVgIOZ-4yQSvwXOSBFMDwLp03uWEg X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-12_03,2023-09-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 priorityscore=1501 bulkscore=0 lowpriorityscore=0 phishscore=0 malwarescore=0 suspectscore=0 clxscore=1015 mlxscore=0 spamscore=0 adultscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309120050 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]); Mon, 11 Sep 2023 23:09:42 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777119716187079972 X-GMAIL-MSGID: 1777119716187079972 Python 3.6 introduced a DeprecationWarning for invalid escape sequences. This is upgraded to a SyntaxWarning in Python 3.12, and will eventually be a syntax error. Fix these now to get ahead of it before it's an error. Signed-off-by: Benjamin Gray --- scripts/clang-tools/gen_compile_commands.py | 2 +- scripts/gdb/linux/symbols.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/clang-tools/gen_compile_commands.py b/scripts/clang-tools/gen_compile_commands.py index a84cc5737c2c..649a80005c83 100755 --- a/scripts/clang-tools/gen_compile_commands.py +++ b/scripts/clang-tools/gen_compile_commands.py @@ -170,7 +170,7 @@ def process_line(root_directory, command_prefix, file_path): # escape the pound sign '#', either as '\#' or '$(pound)' (depending on the # kernel version). The compile_commands.json file is not interepreted # by Make, so this code replaces the escaped version with '#'. - prefix = command_prefix.replace('\#', '#').replace('$(pound)', '#') + prefix = command_prefix.replace('\\#', '#').replace('$(pound)', '#') # Use os.path.abspath() to normalize the path resolving '.' and '..' . abs_path = os.path.abspath(os.path.join(root_directory, file_path)) diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py index 5179edd1b627..2a55c4b83306 100644 --- a/scripts/gdb/linux/symbols.py +++ b/scripts/gdb/linux/symbols.py @@ -82,7 +82,7 @@ lx-symbols command.""" self.module_files_updated = True def _get_module_file(self, module_name): - module_pattern = ".*/{0}\.ko(?:.debug)?$".format( + module_pattern = r".*/{0}\.ko(?:.debug)?$".format( module_name.replace("_", r"[_\-]")) for name in self.module_files: if re.match(module_pattern, name) and os.path.exists(name):