Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4850546rdb; Fri, 15 Sep 2023 14:29:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHiver+wGJOlCs6IXCK/7s6HgOUQxCOJhCvebb0rm1HOZBeojT85bU9Aps4c5arep67mk/+ X-Received: by 2002:a05:6a20:428a:b0:13e:7439:1449 with SMTP id o10-20020a056a20428a00b0013e74391449mr3712855pzj.0.1694813356154; Fri, 15 Sep 2023 14:29:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694813356; cv=none; d=google.com; s=arc-20160816; b=E514zadkrFr5X+IfQuUFmyTBVbs8cGLFJinHADjLX6E0zY7z8ZYVKVY/LlJw7jWAXf GfhzEnvhPYepipP+i61eSUuO5pvOFnTephBK3TESiv98upr5ygmrFg9sRxt6LCQLn+XU hpKQ0ngELTMhb/yahOgKbuXEX4oZnyx64wd89uB4DMLRVksdt8379lcsKxQAO9vYu1Rc /F2SmrH8H77XprvZDmSFPUdLeWHNmLmZQSNmzdhJwKeDkiqQOnjdp3JUDC5SelG93pKd c2FJxx1odJgwPmIBHbEs+wEszimTN01k2vgo0EdN49+M4RxCnq6OLmbUOKEadgcwpW0e Jthw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:thread-index:content-language :content-transfer-encoding:mime-version:message-id:date:subject :in-reply-to:references:cc:to:from:dkim-signature; bh=7teTS75eyEcS4dZgXo+EcQywzkucHFzMxSjJFBdTG8Y=; fh=oASl+yp/jJPPnypdrl4qP0MRrF6AZ9pKweO/l2KSXbg=; b=iBYNa0Pkij3rtolLIt3j+RYkJvmrwaNnrUw6wy2BWN+lmaldqlQTEkBdaWl9A/ZXzI HsalKtt3OHGcaPwCjX9woHE/MGOyo/ABYkNLzxTutGNjrDSm81hLuFeKXzL+V0dmAxje b/q5WLqqouViCymeqYJcG3kC14McQdxTUz4qOXTnwNCFw/o1Uy4YAyccQ9yYc+UxLdP1 vMVslJzDReBAUfw5r75NkCEBSU9yj90JYFSbw3ZNEHW/f1N9gKgYG4gWFsdZzoNPPx+6 IfsDzY8ySUc6mChDGDBU3iTvNCQWDMUuEAUoaA+EOV4jHReOvjE1bQGmzPqtcui7KCSl V75A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@telus.net header.s=google header.b=gQFM8VAp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=telus.net Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id a21-20020a63e855000000b00566022bbcafsi3683277pgk.566.2023.09.15.14.29.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 14:29:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@telus.net header.s=google header.b=gQFM8VAp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=telus.net Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 09FF28075141; Fri, 15 Sep 2023 14:16:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237338AbjIOVQY (ORCPT + 99 others); Fri, 15 Sep 2023 17:16:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237637AbjIOVPu (ORCPT ); Fri, 15 Sep 2023 17:15:50 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B37CE50 for ; Fri, 15 Sep 2023 14:15:03 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1bf5c314a57so21854685ad.1 for ; Fri, 15 Sep 2023 14:15:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telus.net; s=google; t=1694812502; x=1695417302; darn=vger.kernel.org; h=thread-index:content-language:content-transfer-encoding :mime-version:message-id:date:subject:in-reply-to:references:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=7teTS75eyEcS4dZgXo+EcQywzkucHFzMxSjJFBdTG8Y=; b=gQFM8VApOidWK0tDq0dRoHGzmCkfDoMbNV8gns2ba5RfW/7ZRoB3EquxOCaI7mBvsb Ux2wCnc1eXaIeLe3O6HH/GVq3xIwewSTNpTJRmMwd1HIDWm8UMfqq/m1zHBcXNT2Xu6g 9y1ZugZuykwcnH2MAz36QkBqxlv38SmbxMIq3u44DYlWhyKIBy2yjokC2Kuzi9N5wpyk baBPSAVjQBfqFad3c663Yc1itkgf3S97BKToEhcGq19bSnLeccFMarPQ9oRglVqZ0I4p TqsgNILa/uJ3SUzaNmpQITFeFB61MfZ9Zf46mEX1PpyiPJX8c8vwNaMcCuNM5gxQAl3m od+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694812502; x=1695417302; h=thread-index:content-language:content-transfer-encoding :mime-version:message-id:date:subject:in-reply-to:references:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7teTS75eyEcS4dZgXo+EcQywzkucHFzMxSjJFBdTG8Y=; b=L/fdxdsSZnBS86Q4ADvF6/5vhrx4+nLKcPOu5RNy8yRQsbp/JXpjy0ENGom4Gp/djt 15W4xL61ZIi4hPwpZnXiWRJ61CCNx37MEfnqplrEek8gQj5iGFOzis+G8A1WcZa2w1vB GTOpYfaynfvRVyenATDEosN9e8H1iS/HSpWLHy8w9dVbDqJCHhdtIJAASg/1RwNHJu9D 9YZsbjZJioXbuljm6JVC91kUbW0Z1OhJ8SGhsdO8NXg8zqlzSy1471sRE7OQ1CMHx3P4 qm9pmZ0hr6wUjCgExiyHlm+hgJ+TgZ/oGVqhlrEdJ7RX7vewsB442HTO4eE8a9DirZNW nR0A== X-Gm-Message-State: AOJu0YzmG8Y+JgZH7Ow9HXpTOXYRO+jkGpbJ6yeEWXbOlwcYpzndsUPC 65KElfssii7PD+462MFbnL1siA== X-Received: by 2002:a17:902:ea0f:b0:1bf:557c:5a2c with SMTP id s15-20020a170902ea0f00b001bf557c5a2cmr3127053plg.44.1694812502564; Fri, 15 Sep 2023 14:15:02 -0700 (PDT) Received: from DougS18 (s66-183-142-209.bc.hsia.telus.net. [66.183.142.209]) by smtp.gmail.com with ESMTPSA id jk15-20020a170903330f00b001b9fef7f454sm1478417plb.73.2023.09.15.14.15.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Sep 2023 14:15:01 -0700 (PDT) From: "Doug Smythies" To: "'Swapnil Sapkal'" , , , , Cc: , , , , , , , , , "'Srinivas Pandruvada'" , "Doug Smythies" References: <20230915104057.132210-1-swapnil.sapkal@amd.com> <20230915104057.132210-3-swapnil.sapkal@amd.com> In-Reply-To: <20230915104057.132210-3-swapnil.sapkal@amd.com> Subject: RE: [PATCH 2/2] tools/power/x86/intel_pstate_tracer: Use pygnuplot package for Gnuplot Date: Fri, 15 Sep 2023 14:15:03 -0700 Message-ID: <00b201d9e819$b2447e80$16cd7b80$@telus.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Content-Language: en-ca Thread-Index: AQKwVkrK5CGttHhKf0ienv16Lobu0QKE+b5trlszgRA= X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 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 (fry.vger.email [0.0.0.0]); Fri, 15 Sep 2023 14:16:55 -0700 (PDT) On 2023.09.15 03:41 Swapnil Sapkal wrote: > In intel_pstate_tracer.py, Gnuplot is used to generate 2D plots. > In current implementation this tracer gives error while importing > the module because Gnuplot is imported from package Gnuplot-py which > does not support python 3.x. Fix this by using pygnuplot package to > import this module. As described in the prerequisites section, the package name is distribution dependant. On my distribution the original package name is phython3-gnuplot, and it is working fine. sys.version_info(major=3, minor=8, micro=10, releaselevel='final', serial=0) I don't currently have python3-pygnuplot installed, and so this patch breaks the intel_pstate_tracer for me. So, I installed the python3-pygnuplot package, and it still didn't work, as there still wasn't a pygnuplot module to import. So, I found something called PyGnuplot.py and so changed to that and got further. But then it got upset with: File "./intel_pstate_tracer.py.amd", line 298, in common_gnuplot_settings g_plot = gnuplot.Gnuplot(persist=1) NameError: name 'gnuplot' is not defined I gave up and returned to the unpatched intel_pstate_tracer.py And checked that is still worked fine. It did. So, I do not accept this proposed patch. Not really related, but for a few years now I have been meaning to change the minimum python version prerequisite to >= 3.0 and to change the shebang line from this: #!/usr/bin/env python To this: #!/usr/bin/env python3 I have to use the latter version on my distro. Back when I looked into it, things were inconsistent, so I didn't know what to do. The kernel tree has 52 .py files of the latter shebang and 11 of the former. ... Doug > Signed-off-by: Swapnil Sapkal > --- > tools/power/x86/amd_pstate_tracer/amd_pstate_trace.py | 1 - > tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py | 4 ++-- > 2 files changed, 2 insertions(+), 3 deletions(-) > > diff --git a/tools/power/x86/amd_pstate_tracer/amd_pstate_trace.py b/tools/power/x86/amd_pstate_tracer/amd_pstate_trace.py > index 2448bb07973f..14f8d81f91de 100755 > --- a/tools/power/x86/amd_pstate_tracer/amd_pstate_trace.py > +++ b/tools/power/x86/amd_pstate_tracer/amd_pstate_trace.py > @@ -27,7 +27,6 @@ import re > import signal > import sys > import getopt > -import Gnuplot > from numpy import * > from decimal import * > sys.path.append(os.path.join(os.path.dirname(__file__), '../intel_pstate_tracer')) > diff --git a/tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py b/tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py > index ec3323100e1a..68412abdd7d4 100755 > --- a/tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py > +++ b/tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py > @@ -32,7 +32,7 @@ import re > import signal > import sys > import getopt > -import Gnuplot > +from pygnuplot import gnuplot > from numpy import * > from decimal import * > > @@ -295,7 +295,7 @@ def common_all_gnuplot_settings(output_png): > def common_gnuplot_settings(): > """ common gnuplot settings. """ > > - g_plot = Gnuplot.Gnuplot(persist=1) > + g_plot = gnuplot.Gnuplot(persist=1) > # The following line is for rigor only. It seems to be assumed for .csv files > g_plot('set datafile separator \",\"') > g_plot('set ytics nomirror') > -- > 2.34.1