From patchwork Tue Jan 28 03:59:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Smythies X-Patchwork-Id: 11353511 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 078BC13A4 for ; Tue, 28 Jan 2020 04:00:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D071624656 for ; Tue, 28 Jan 2020 04:00:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Dqy5ePLQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726444AbgA1EA3 (ORCPT ); Mon, 27 Jan 2020 23:00:29 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:35004 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726443AbgA1EA2 (ORCPT ); Mon, 27 Jan 2020 23:00:28 -0500 Received: by mail-pg1-f194.google.com with SMTP id l24so6267124pgk.2; Mon, 27 Jan 2020 20:00:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mRvZ4+zNuGgoPLNJrb+Azqj+S6OggUFM688SUmeIEAk=; b=Dqy5ePLQT5J60BJWWahsTF6pJUCTaobq2ue+sb4ZP3dgkfjUlaUG76r3YQUOjqM4G6 lNdIXJj6IA+KETfRHKGNEMKiFMoYo/GEMBvceM9D56ZKfEHRk8IyIecnuJzOi+pUjB1d 8dC2nFrLN9B40qtEyQMcY2Qs70wZPZH7MUXkP6r8K7b9P0qJV+qFOCOhmusOsxwodKNn Ql91fdXRCmwmNpwhn8bnF3hwKK814DTlhfJ7ztN14TEic+bejFYeh2BveddMqrgpmd6Z T2PQJZOxanJHMZKxevphg0I01Cx38ohsPlk+TZtrDbjhZViFFgjbYKwssL1wRwg4sGmt aijw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mRvZ4+zNuGgoPLNJrb+Azqj+S6OggUFM688SUmeIEAk=; b=SJjqHepEWc9gzLAgvN2vTSt9mHUMAfzSGmAkWwkJuTgHN9LZy0DVPJ4T9MIpCJcHqD dhnyFCc8B5JaqU9KPbf8PhdHtvWCWfiveX6zFi8Lxd4LhTD/A60QP2NSZx2mC0Uyov/b PBANduh6Ood0FM4767OwUPlLkliGGxLd/T69zudjuxbYhrmu2UbLmIsWkiOkBQp7G1jz E+qlkmlcAsAC+qwAssRfziuEYFjWRQ0JoCHAfuxqWZiuRubIkEujrnqDtSHdwPeqmofN 72UX7/an/FpxLas+mcIlWl/Km1aAbtM3zqXzm+A4gM1TymRjeXVDxIKdrjNnU1X1GwMh f/rQ== X-Gm-Message-State: APjAAAWwf6oSemGbA81GRpkQx5QQvgdSZZmu6mgUxAdpzF/MHioeYE+G xui3QBejyNrSqdWswTxp090= X-Google-Smtp-Source: APXvYqy2RrWYHpQ6ECBSu3tGZexknI4VsQ2y68/A+AbwzZw2TO2fO0+rl+GUpOWwPHdwsqWA0mWThA== X-Received: by 2002:a63:111e:: with SMTP id g30mr23742161pgl.251.1580184028057; Mon, 27 Jan 2020 20:00:28 -0800 (PST) Received: from s15.smythies.com (mail.smythies.com. [173.180.45.4]) by smtp.gmail.com with ESMTPSA id d22sm17464489pgg.52.2020.01.27.20.00.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2020 20:00:27 -0800 (PST) From: Doug Smythies X-Google-Original-From: Doug Smythies To: dsmythies@telus.net, srinivas.pandruvada@linux.intel.com, rjw@rjwysocki.net, len.brown@intel.com Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH 1/2] tools/power/x86/intel_pstate_tracer: changes for python 3 compatibility Date: Mon, 27 Jan 2020 19:59:56 -0800 Message-Id: <20200128035957.2577561-2-dsmythies@telus.net> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200128035957.2577561-1-dsmythies@telus.net> References: <20200128035957.2577561-1-dsmythies@telus.net> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Some syntax needs to be more rigorous for python 3. Backwards compatibility tested with python 2.7 Signed-off-by: Doug Smythies --- .../intel_pstate_tracer.py | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) 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 2d6d342b148f..1351975d0769 100755 --- a/tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py +++ b/tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py @@ -11,11 +11,11 @@ then this utility enables and collects trace data for a user specified interval and generates performance plots. Prerequisites: - Python version 2.7.x + Python version 2.7.x or higher gnuplot 5.0 or higher - gnuplot-py 1.8 + gnuplot-py 1.8 or higher (Most of the distributions have these required packages. They may be called - gnuplot-py, phython-gnuplot. ) + gnuplot-py, phython-gnuplot or phython3-gnuplot, gnuplot-nox, ... ) HWP (Hardware P-States are disabled) Kernel config for Linux trace is enabled @@ -181,7 +181,7 @@ def plot_pstate_cpu_with_sample(): g_plot('set xlabel "Samples"') g_plot('set ylabel "P-State"') g_plot('set title "{} : cpu pstate vs. sample : {:%F %H:%M}"'.format(testname, datetime.now())) - title_list = subprocess.check_output('ls cpu???.csv | sed -e \'s/.csv//\'',shell=True).replace('\n', ' ') + title_list = subprocess.check_output('ls cpu???.csv | sed -e \'s/.csv//\'',shell=True).decode('utf-8').replace('\n', ' ') plot_str = "plot for [i in title_list] i.'.csv' using {:d}:{:d} pt 7 ps 1 title i".format(C_SAMPLE, C_TO) g_plot('title_list = "{}"'.format(title_list)) g_plot(plot_str) @@ -198,7 +198,7 @@ def plot_pstate_cpu(): # the following command is really cool, but doesn't work with the CPU masking option because it aborts on the first missing file. # plot_str = 'plot for [i=0:*] file=sprintf("cpu%03d.csv",i) title_s=sprintf("cpu%03d",i) file using 16:7 pt 7 ps 1 title title_s' # - title_list = subprocess.check_output('ls cpu???.csv | sed -e \'s/.csv//\'',shell=True).replace('\n', ' ') + title_list = subprocess.check_output('ls cpu???.csv | sed -e \'s/.csv//\'',shell=True).decode('utf-8').replace('\n', ' ') plot_str = "plot for [i in title_list] i.'.csv' using {:d}:{:d} pt 7 ps 1 title i".format(C_ELAPSED, C_TO) g_plot('title_list = "{}"'.format(title_list)) g_plot(plot_str) @@ -212,7 +212,7 @@ def plot_load_cpu(): g_plot('set ylabel "CPU load (percent)"') g_plot('set title "{} : cpu loads : {:%F %H:%M}"'.format(testname, datetime.now())) - title_list = subprocess.check_output('ls cpu???.csv | sed -e \'s/.csv//\'',shell=True).replace('\n', ' ') + title_list = subprocess.check_output('ls cpu???.csv | sed -e \'s/.csv//\'',shell=True).decode('utf-8').replace('\n', ' ') plot_str = "plot for [i in title_list] i.'.csv' using {:d}:{:d} pt 7 ps 1 title i".format(C_ELAPSED, C_LOAD) g_plot('title_list = "{}"'.format(title_list)) g_plot(plot_str) @@ -226,7 +226,7 @@ def plot_frequency_cpu(): g_plot('set ylabel "CPU Frequency (GHz)"') g_plot('set title "{} : cpu frequencies : {:%F %H:%M}"'.format(testname, datetime.now())) - title_list = subprocess.check_output('ls cpu???.csv | sed -e \'s/.csv//\'',shell=True).replace('\n', ' ') + title_list = subprocess.check_output('ls cpu???.csv | sed -e \'s/.csv//\'',shell=True).decode('utf-8').replace('\n', ' ') plot_str = "plot for [i in title_list] i.'.csv' using {:d}:{:d} pt 7 ps 1 title i".format(C_ELAPSED, C_FREQ) g_plot('title_list = "{}"'.format(title_list)) g_plot(plot_str) @@ -241,7 +241,7 @@ def plot_duration_cpu(): g_plot('set ylabel "Timer Duration (MilliSeconds)"') g_plot('set title "{} : cpu durations : {:%F %H:%M}"'.format(testname, datetime.now())) - title_list = subprocess.check_output('ls cpu???.csv | sed -e \'s/.csv//\'',shell=True).replace('\n', ' ') + title_list = subprocess.check_output('ls cpu???.csv | sed -e \'s/.csv//\'',shell=True).decode('utf-8').replace('\n', ' ') plot_str = "plot for [i in title_list] i.'.csv' using {:d}:{:d} pt 7 ps 1 title i".format(C_ELAPSED, C_DURATION) g_plot('title_list = "{}"'.format(title_list)) g_plot(plot_str) @@ -255,7 +255,7 @@ def plot_scaled_cpu(): g_plot('set ylabel "Scaled Busy (Unitless)"') g_plot('set title "{} : cpu scaled busy : {:%F %H:%M}"'.format(testname, datetime.now())) - title_list = subprocess.check_output('ls cpu???.csv | sed -e \'s/.csv//\'',shell=True).replace('\n', ' ') + title_list = subprocess.check_output('ls cpu???.csv | sed -e \'s/.csv//\'',shell=True).decode('utf-8').replace('\n', ' ') plot_str = "plot for [i in title_list] i.'.csv' using {:d}:{:d} pt 7 ps 1 title i".format(C_ELAPSED, C_SCALED) g_plot('title_list = "{}"'.format(title_list)) g_plot(plot_str) @@ -269,7 +269,7 @@ def plot_boost_cpu(): g_plot('set ylabel "CPU IO Boost (percent)"') g_plot('set title "{} : cpu io boost : {:%F %H:%M}"'.format(testname, datetime.now())) - title_list = subprocess.check_output('ls cpu???.csv | sed -e \'s/.csv//\'',shell=True).replace('\n', ' ') + title_list = subprocess.check_output('ls cpu???.csv | sed -e \'s/.csv//\'',shell=True).decode('utf-8').replace('\n', ' ') plot_str = "plot for [i in title_list] i.'.csv' using {:d}:{:d} pt 7 ps 1 title i".format(C_ELAPSED, C_BOOST) g_plot('title_list = "{}"'.format(title_list)) g_plot(plot_str) @@ -283,7 +283,7 @@ def plot_ghz_cpu(): g_plot('set ylabel "TSC Frequency (GHz)"') g_plot('set title "{} : cpu TSC Frequencies (Sanity check calculation) : {:%F %H:%M}"'.format(testname, datetime.now())) - title_list = subprocess.check_output('ls cpu???.csv | sed -e \'s/.csv//\'',shell=True).replace('\n', ' ') + title_list = subprocess.check_output('ls cpu???.csv | sed -e \'s/.csv//\'',shell=True).decode('utf-8').replace('\n', ' ') plot_str = "plot for [i in title_list] i.'.csv' using {:d}:{:d} pt 7 ps 1 title i".format(C_ELAPSED, C_GHZ) g_plot('title_list = "{}"'.format(title_list)) g_plot(plot_str) From patchwork Tue Jan 28 03:59:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Smythies X-Patchwork-Id: 11353513 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5452A13A4 for ; Tue, 28 Jan 2020 04:00:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 28D142467F for ; Tue, 28 Jan 2020 04:00:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rSpGlQB2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726650AbgA1EAg (ORCPT ); Mon, 27 Jan 2020 23:00:36 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:45462 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726443AbgA1EAg (ORCPT ); Mon, 27 Jan 2020 23:00:36 -0500 Received: by mail-pg1-f195.google.com with SMTP id b9so6242340pgk.12; Mon, 27 Jan 2020 20:00:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VaV+TCz+P8SwfgAEkIAIx0NiElaucyvHYe3YKrATciA=; b=rSpGlQB2sMAkmSJjAkD9CNOH28jCMb9IkZJTlzDgrwR2L4UaC/ryVxcS5bdz96i1Yw gGeupO8OLaXX9p1OSnyQ6b9D6kdbKd++JWKLqkl27/ZAu9Rwtb94etA9u2AZBlYwrVdP BnWDgieM5/Mhqjbbxd0GenTXxxEoBawsx7FhGV1QcNYuE7ZOMlxx8GmXO9+WQfnsoG8E W2OIK2yRo5B0PqUTDEnJ9/uAoXE/byHZGJ2tQQoPGltkIrb7CRaQR9yhQK5avKGc1F9X 5LAijHqL9M/80ioFXZFROdIDVCfFl57vjn71hHJhqChE1vPqvRXALHyln/BNaYhpQ5ih cgZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VaV+TCz+P8SwfgAEkIAIx0NiElaucyvHYe3YKrATciA=; b=n+7MaPh0oOIHQifvIkk6Zqv3LhM3gTvdbUqhKZyqppPp2lXwBJFcf9whQS8TWjLGNl xl6GoNCeAMkl+mwYHodNyqGhYNy9TRz+moljmV69RaVf1LTYQA5JlLitoWhAKOCYpdjj I39/+1SKre6ToyKbfkD7bXdacX67UQI6hZlS5/byoyGx3AWZy3alZxXTZsUM+fWtDLul LfZ/foX3V3iTadBNvz0UW3vaTvbpHmMYkZRhwtuOTGK+9LWgKPs8dzU/KHvlY+yoq/KF Xr3kXEbmxq61y+xm9Bm3nTmHGbiQ49u4/sZI3L5551QhMZd1Ist0lr0+Bpf3TkzlrUhy B7FQ== X-Gm-Message-State: APjAAAUrWnlDF3sd1PkpQZrvwdgPkExEZBfEq4IfBYlPHUKTZlGC/Ehq 8ivByuv8Qkb8sYvFeVJzZGI= X-Google-Smtp-Source: APXvYqwXQxM2zxpQ7MQLAjsdHMmmrFjrITL8x6OZXVpX7DLFQb1VnqnhoVeZV+rdVn10nrVFk9u8PA== X-Received: by 2002:aa7:8191:: with SMTP id g17mr2019186pfi.25.1580184035437; Mon, 27 Jan 2020 20:00:35 -0800 (PST) Received: from s15.smythies.com (mail.smythies.com. [173.180.45.4]) by smtp.gmail.com with ESMTPSA id d22sm17464489pgg.52.2020.01.27.20.00.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2020 20:00:34 -0800 (PST) From: Doug Smythies X-Google-Original-From: Doug Smythies To: dsmythies@telus.net, srinivas.pandruvada@linux.intel.com, rjw@rjwysocki.net, len.brown@intel.com Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH 2/2] tools/power/x86/intel_pstate_tracer: change several graphs to autoscale y-axis Date: Mon, 27 Jan 2020 19:59:57 -0800 Message-Id: <20200128035957.2577561-3-dsmythies@telus.net> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200128035957.2577561-1-dsmythies@telus.net> References: <20200128035957.2577561-1-dsmythies@telus.net> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Processors have exceeded some of the fixed y-axis scale maximum values. Change them to autoscale the y-axis. Signed-off-by: Doug Smythies --- .../intel_pstate_tracer/intel_pstate_tracer.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) 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 1351975d0769..256199c7a182 100755 --- a/tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py +++ b/tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py @@ -104,7 +104,7 @@ def plot_perf_busy_with_sample(cpu_index): if os.path.exists(file_name): output_png = "cpu%03d_perf_busy_vs_samples.png" % cpu_index g_plot = common_all_gnuplot_settings(output_png) - g_plot('set yrange [0:40]') +# autoscale this one, no set y1 range g_plot('set y2range [0:200]') g_plot('set y2tics 0, 10') g_plot('set title "{} : cpu perf busy vs. sample : CPU {:0>3} : {:%F %H:%M}"'.format(testname, cpu_index, datetime.now())) @@ -125,7 +125,7 @@ def plot_perf_busy(cpu_index): if os.path.exists(file_name): output_png = "cpu%03d_perf_busy.png" % cpu_index g_plot = common_all_gnuplot_settings(output_png) - g_plot('set yrange [0:40]') +# autoscale this one, no set y1 range g_plot('set y2range [0:200]') g_plot('set y2tics 0, 10') g_plot('set title "{} : perf busy : CPU {:0>3} : {:%F %H:%M}"'.format(testname, cpu_index, datetime.now())) @@ -144,9 +144,7 @@ def plot_durations(cpu_index): if os.path.exists(file_name): output_png = "cpu%03d_durations.png" % cpu_index g_plot = common_all_gnuplot_settings(output_png) -# Should autoscale be used here? Should seconds be used here? - g_plot('set yrange [0:5000]') - g_plot('set ytics 0, 500') +# autoscale this one, no set y range g_plot('set title "{} : durations : CPU {:0>3} : {:%F %H:%M}"'.format(testname, cpu_index, datetime.now())) g_plot('set ylabel "Timer Duration (MilliSeconds)"') # override common @@ -176,7 +174,7 @@ def plot_pstate_cpu_with_sample(): if os.path.exists('cpu.csv'): output_png = 'all_cpu_pstates_vs_samples.png' g_plot = common_all_gnuplot_settings(output_png) - g_plot('set yrange [0:40]') +# autoscale this one, no set y range # override common g_plot('set xlabel "Samples"') g_plot('set ylabel "P-State"') @@ -191,7 +189,7 @@ def plot_pstate_cpu(): output_png = 'all_cpu_pstates.png' g_plot = common_all_gnuplot_settings(output_png) - g_plot('set yrange [0:40]') +# autoscale this one, no set y range g_plot('set ylabel "P-State"') g_plot('set title "{} : cpu pstates : {:%F %H:%M}"'.format(testname, datetime.now())) @@ -222,7 +220,7 @@ def plot_frequency_cpu(): output_png = 'all_cpu_frequencies.png' g_plot = common_all_gnuplot_settings(output_png) - g_plot('set yrange [0:4]') +# autoscale this one, no set y range g_plot('set ylabel "CPU Frequency (GHz)"') g_plot('set title "{} : cpu frequencies : {:%F %H:%M}"'.format(testname, datetime.now())) @@ -236,7 +234,7 @@ def plot_duration_cpu(): output_png = 'all_cpu_durations.png' g_plot = common_all_gnuplot_settings(output_png) - g_plot('set yrange [0:5000]') +# autoscale this one, no set y range g_plot('set ytics 0, 500') g_plot('set ylabel "Timer Duration (MilliSeconds)"') g_plot('set title "{} : cpu durations : {:%F %H:%M}"'.format(testname, datetime.now()))