History log of /linux-master/tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py
Revision Date Author Comments
# e68cb15b 17-Sep-2023 Doug Smythies <dsmythies@telus.net>

tools/power/x86/intel_pstate_tracer: python minimum version

Change the minimum python version from 2.7 to 3.6.
Remove a 2.X backwards compatibility line.

Signed-off-by: Doug Smythies <dsmythies@telus.net>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Tested-by: Swapnil Sapkal <Swapnil.Sapkal@amd.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# cf3e0251 30-Jan-2023 Ross Zwisler <zwisler@chromium.org>

PM: tools: use canonical ftrace path

The canonical location for the tracefs filesystem is at /sys/kernel/tracing.

But, from Documentation/trace/ftrace.rst:

Before 4.1, all ftrace tracing control files were within the debugfs
file system, which is typically located at /sys/kernel/debug/tracing.
For backward compatibility, when mounting the debugfs file system,
the tracefs file system will be automatically mounted at:

/sys/kernel/debug/tracing

A few scripts in tools/power still refer to this older debugfs path, so
let's update them to avoid confusion.

Signed-off-by: Ross Zwisler <zwisler@google.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# ab3ff9f1 08-Mar-2022 Jinzhou Su <Jinzhou.Su@amd.com>

tools/power/x86/intel_pstate_tracer: make tracer as a module

Make intel_pstate_tracer as a module. Other trace event can import
this module to analyze their trace data.

Signed-off-by: Jinzhou Su <Jinzhou.Su@amd.com>
Acked-by: Doug Smythies <dsmythies@telus.net>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# c25ce589 23-Nov-2020 Finn Behrens <me@kloenk.de>

tweewide: Fix most Shebang lines

Change every shebang which does not need an argument to use /usr/bin/env.
This is needed as not every distro has everything under /usr/bin,
sometimes not even bash.

Signed-off-by: Finn Behrens <me@kloenk.de>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 2f6bdb05 26-Mar-2020 Doug Smythies <doug.smythies@gmail.com>

tools/power/x86/intel_pstate_tracer: fix a broken y-axis scale

A fixed y-axis scale was missed during a change to autoscale.

Correct it.

Fixes: 709bd70d070ee ("tools/power/x86/intel_pstate_tracer: change several graphs to autoscale y-axis")
Signed-off-by: Doug Smythies <dsmythies@telus.net>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 709bd70d 27-Jan-2020 Doug Smythies <doug.smythies@gmail.com>

tools/power/x86/intel_pstate_tracer: change several graphs to autoscale y-axis

Processors have exceeded some of the fixed y-axis scale maximum values.
Change them to autoscale the y-axis.

Signed-off-by: Doug Smythies <dsmythies@telus.net>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# e749e09d 27-Jan-2020 Doug Smythies <doug.smythies@gmail.com>

tools/power/x86/intel_pstate_tracer: changes for python 3 compatibility

Some syntax needs to be more rigorous for python 3.
Backwards compatibility tested with python 2.7

Signed-off-by: Doug Smythies <dsmythies@telus.net>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 6c8f392c 04-Jun-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 466

Based on 1 normalized pattern(s):

license__ = gpl version 2

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

has been chosen to add the SPDX identifier to this file.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Enrico Weigelt <info@metux.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081202.640009675@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 66354690 18-Dec-2018 Doug Smythies <doug.smythies@gmail.com>

tools/power/x86/intel_pstate_tracer: Fix non root execution for post processing a trace file

This script is supposed to be allowed to run with regular user
privileges if a previously captured trace is being post processed.

Commit fbe313884d7d (tools/power/x86/intel_pstate_tracer: Free the
trace buffer memory) introduced a bug that breaks that option.

Commit 35459105deb2 (tools/power/x86/intel_pstate_tracer: Add
optional setting of trace buffer memory allocation) moved the code
but kept the bug.

This patch fixes the issue.

Fixes: 35459105deb2 (tools/power/x86/intel_pstate_tracer: Add optional ...)
Signed-off-by: Doug Smythies <dsmythies@telus.net>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 35459105 04-May-2018 Doug Smythies <doug.smythies@gmail.com>

tools/power/x86/intel_pstate_tracer: Add optional setting of trace buffer memory allocation

Allow the user to override the default trace buffer memory allocation
by adding a command line option to override the default.

The patch also:

Adds a SIGINT (i.e. CTRL C exit) handler,
so that things can be cleaned up before exit.

Moves the postion of some other cleanup from after to
before the potential "No valid data to plot" exit.

Replaces all quit() calls with sys.exit, because
quit() is not supposed to be used in scripts.

Signed-off-by: Doug Smythies <dsmythies@telus.net>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# fbe31388 05-Jan-2018 Doug Smythies <doug.smythies@gmail.com>

tools/power/x86/intel_pstate_tracer: Free the trace buffer memory

The trace buffer memory should be, mostly, freed after
the buffer has been output.

This patch is required before a future patch that will allow
the user to override the default, and specify the trace buffer
memory allocation as a command line option.

Signed-off-by: Doug Smythies <dsmythies@telus.net>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 010a522c 17-Apr-2017 Doug Smythies <doug.smythies@gmail.com>

tools/power/x86/intel_pstate_tracer: Adjust directory ownership

The intel_pstate_tracer.py script only needs to be run as root
when it is also used to actually acquire the trace data that
it will post process. Otherwise it is generally preferable
that it be run as a regular user.
If run the first time as root the results directory will be
incorrect for any subsequent run as a regular user. For any run
as root the specific testname subdirectory will not allow any
subsequent file saves by a regular user. Typically, and for example,
the regular user might be attempting to save a .csv file converted to
a spreadsheet with added calculations or graphs.

Set the directories and files owner and groups IDs to be the regular
user, if required.

Signed-off-by: Doug Smythies <dsmythies@telus.net>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 48385dd7 13-Feb-2017 Doug Smythies <doug.smythies@gmail.com>

tools/power/x86: Debug utility for intel_pstate driver

This utility can be used to debug and tune the performance of the
intel_pstate driver.

This utility can be used in two ways:

- If there is Linux trace file with pstate_sample events enabled, then
this utility can parse the trace file and generate performance plots.

- If user has not specified a trace file as input via command line
parameters, then this utility enables and collects trace data for a
user-specified interval and generates performance plots.

Signed-off-by: Doug Smythies <dsmythies@telus.net>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>