hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py
....@@ -1,4 +1,5 @@
1
-#!/usr/bin/python
1
+#!/usr/bin/env python
2
+# SPDX-License-Identifier: GPL-2.0-only
23 # -*- coding: utf-8 -*-
34 #
45 """ This utility can be used to debug and tune the performance of the
....@@ -103,7 +104,7 @@
103104 if os.path.exists(file_name):
104105 output_png = "cpu%03d_perf_busy_vs_samples.png" % cpu_index
105106 g_plot = common_all_gnuplot_settings(output_png)
106
- g_plot('set yrange [0:40]')
107
+# autoscale this one, no set y1 range
107108 g_plot('set y2range [0:200]')
108109 g_plot('set y2tics 0, 10')
109110 g_plot('set title "{} : cpu perf busy vs. sample : CPU {:0>3} : {:%F %H:%M}"'.format(testname, cpu_index, datetime.now()))
....@@ -124,7 +125,7 @@
124125 if os.path.exists(file_name):
125126 output_png = "cpu%03d_perf_busy.png" % cpu_index
126127 g_plot = common_all_gnuplot_settings(output_png)
127
- g_plot('set yrange [0:40]')
128
+# autoscale this one, no set y1 range
128129 g_plot('set y2range [0:200]')
129130 g_plot('set y2tics 0, 10')
130131 g_plot('set title "{} : perf busy : CPU {:0>3} : {:%F %H:%M}"'.format(testname, cpu_index, datetime.now()))
....@@ -143,9 +144,7 @@
143144 if os.path.exists(file_name):
144145 output_png = "cpu%03d_durations.png" % cpu_index
145146 g_plot = common_all_gnuplot_settings(output_png)
146
-# Should autoscale be used here? Should seconds be used here?
147
- g_plot('set yrange [0:5000]')
148
- g_plot('set ytics 0, 500')
147
+# autoscale this one, no set y range
149148 g_plot('set title "{} : durations : CPU {:0>3} : {:%F %H:%M}"'.format(testname, cpu_index, datetime.now()))
150149 g_plot('set ylabel "Timer Duration (MilliSeconds)"')
151150 # override common
....@@ -175,7 +174,7 @@
175174 if os.path.exists('cpu.csv'):
176175 output_png = 'all_cpu_pstates_vs_samples.png'
177176 g_plot = common_all_gnuplot_settings(output_png)
178
- g_plot('set yrange [0:40]')
177
+# autoscale this one, no set y range
179178 # override common
180179 g_plot('set xlabel "Samples"')
181180 g_plot('set ylabel "P-State"')
....@@ -190,7 +189,7 @@
190189
191190 output_png = 'all_cpu_pstates.png'
192191 g_plot = common_all_gnuplot_settings(output_png)
193
- g_plot('set yrange [0:40]')
192
+# autoscale this one, no set y range
194193 g_plot('set ylabel "P-State"')
195194 g_plot('set title "{} : cpu pstates : {:%F %H:%M}"'.format(testname, datetime.now()))
196195
....@@ -221,7 +220,7 @@
221220
222221 output_png = 'all_cpu_frequencies.png'
223222 g_plot = common_all_gnuplot_settings(output_png)
224
- g_plot('set yrange [0:4]')
223
+# autoscale this one, no set y range
225224 g_plot('set ylabel "CPU Frequency (GHz)"')
226225 g_plot('set title "{} : cpu frequencies : {:%F %H:%M}"'.format(testname, datetime.now()))
227226
....@@ -235,8 +234,7 @@
235234
236235 output_png = 'all_cpu_durations.png'
237236 g_plot = common_all_gnuplot_settings(output_png)
238
- g_plot('set yrange [0:5000]')
239
- g_plot('set ytics 0, 500')
237
+# autoscale this one, no set y range
240238 g_plot('set ylabel "Timer Duration (MilliSeconds)"')
241239 g_plot('set title "{} : cpu durations : {:%F %H:%M}"'.format(testname, datetime.now()))
242240