From nobody Fri Feb 13 00:13:59 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39854191489 for ; Thu, 2 Jan 2025 15:25:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735831529; cv=none; b=ZQ3iFiX1VmN7EyKTo7y67IvBuzm1AVPIeDEvT5UL2BnM7wMVqg06xZmNAPrUVFbKZ1Hu5pdcOUBw2RsuYMu8WmA4PnfkrWLvCArryBFbUw9owPGPbeR95rSgbdmVF21WhQX+/G6ZSLH/PrCuURK8rkmzlJG1jT5xEy8J6xx8YYo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735831529; c=relaxed/simple; bh=vzsfEdcPiMK07kI/9lx2/eSDQCg+x02C/vBhznITqrY=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=OBjwg3xV2I7AShQE7MQQZ2Q1XOwvl3KkAa0fQPTDpNh0QTFl+lmZsA2FwZMH1qBxSh1n7djUdhU7y8Bll4SRbw+maEOQUWhOyflxBlDvTsqeVlyauZvAGXSc8934QpsMENWNbTqaTnsfq15BYNa+YQZ30eHMvs413nhSlZ7kTMY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBC43C4CED1; Thu, 2 Jan 2025 15:25:28 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98) (envelope-from ) id 1tTN5x-00000005D1t-1Mml; Thu, 02 Jan 2025 10:26:45 -0500 Message-ID: <20250102152645.180764247@goodmis.org> User-Agent: quilt/0.68 Date: Thu, 02 Jan 2025 10:26:25 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Tomas Glozar , John Kacur , Juri Lelli , Thomas Gleixner , Gabriele Monaco Subject: [for-next][PATCH 1/8] verification/dot2k: Fix template directory detection References: <20250102152624.158129997@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Gabriele Monaco dot2k can be run as installed (e.g. make install) or from the kernel tree. In the former case it looks for templates in a known location; in the latter, the PWD has to be `/tools/verification` to properly import python modules. The current version looks for the template in a wrong directory in this latter case. This patch adjusts the directory where dot2k looks for templates if run from the kernel tree (i.e. not installed). Additionally we fix a few simple pylint warnings in boolean expressions. Cc: Juri Lelli Cc: Thomas Gleixner Cc: John Kacur Link: https://lore.kernel.org/20241227144752.362911-2-gmonaco@redhat.com Signed-off-by: Gabriele Monaco Signed-off-by: Steven Rostedt (Google) --- tools/verification/dot2/dot2k.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/verification/dot2/dot2k.py b/tools/verification/dot2/dot= 2k.py index 016550fccf1f..f6d02e3406a3 100644 --- a/tools/verification/dot2/dot2k.py +++ b/tools/verification/dot2/dot2k.py @@ -14,14 +14,14 @@ import os =20 class dot2k(Dot2c): monitor_types =3D { "global" : 1, "per_cpu" : 2, "per_task" : 3 } - monitor_templates_dir =3D "dot2k/rv_templates/" + monitor_templates_dir =3D "dot2/dot2k_templates/" monitor_type =3D "per_cpu" =20 def __init__(self, file_path, MonitorType): super().__init__(file_path) =20 self.monitor_type =3D self.monitor_types.get(MonitorType) - if self.monitor_type =3D=3D None: + if self.monitor_type is None: raise Exception("Unknown monitor type: %s" % MonitorType) =20 self.monitor_type =3D MonitorType @@ -31,7 +31,7 @@ class dot2k(Dot2c): =20 def __fill_rv_templates_dir(self): =20 - if os.path.exists(self.monitor_templates_dir) =3D=3D True: + if os.path.exists(self.monitor_templates_dir): return =20 if platform.system() !=3D "Linux": @@ -39,11 +39,11 @@ class dot2k(Dot2c): =20 kernel_path =3D "/lib/modules/%s/build/tools/verification/dot2/dot= 2k_templates/" % (platform.release()) =20 - if os.path.exists(kernel_path) =3D=3D True: + if os.path.exists(kernel_path): self.monitor_templates_dir =3D kernel_path return =20 - if os.path.exists("/usr/share/dot2/dot2k_templates/") =3D=3D True: + if os.path.exists("/usr/share/dot2/dot2k_templates/"): self.monitor_templates_dir =3D "/usr/share/dot2/dot2k_template= s/" return =20 @@ -98,7 +98,7 @@ class dot2k(Dot2c): def fill_main_c(self): main_c =3D self.main_c min_type =3D self.get_minimun_type() - nr_events =3D self.events.__len__() + nr_events =3D len(self.events) tracepoint_handlers =3D self.fill_tracepoint_handlers_skel() tracepoint_attach =3D self.fill_tracepoint_attach_probe() tracepoint_detach =3D self.fill_tracepoint_detach_helper() @@ -160,8 +160,8 @@ class dot2k(Dot2c): =20 def __get_main_name(self): path =3D "%s/%s" % (self.name, "main.c") - if os.path.exists(path) =3D=3D False: - return "main.c" + if not os.path.exists(path): + return "main.c" return "__main.c" =20 def print_files(self): --=20 2.45.2