summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stat-cpi.py
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2026-09-25 23:20:13 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2026-09-26 20:54:54 +0200
commit0d0f9e540d940a48b91cbea1657794d44b25aedf (patch)
treec278c28d2ce50a88dfaaae897161d0ad385aa01e /tools/perf/scripts/python/stat-cpi.py
parent5084b5f91a70e0aa2811c7c894ac19424bfc4194 (diff)
downloadlinux-next-0d0f9e540d940a48b91cbea1657794d44b25aedf.tar.gz
linux-next-0d0f9e540d940a48b91cbea1657794d44b25aedf.zip
perf: Remove libpython support and legacy Python scripts
Remove embedded Python interpreter support (libpython) from perf, as all Python scripts have been migrated to standalone scripts using the perf Python extension module. Changes include: - Remove libpython detection and build flags from Makefile.config. - Remove legacy Python script installation rules from Makefile.perf. - Delete tools/perf/util/scripting-engines/trace-event-python.c and tools/perf/scripts/python/Perf-Trace-Util/Context.c. - Remove Python scripting engine registration from trace-event-scripting.c. - Remove libpython from the supported features list in builtin-check.c and Documentation/perf-check.txt. - Delete the legacy Python scripts and bin wrappers in tools/perf/scripts/python/ and update shell tests. Assisted-by: Antigravity:gemini-3.1-pro Signed-off-by: Ian Rogers <irogers@google.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/stat-cpi.py')
-rw-r--r--tools/perf/scripts/python/stat-cpi.py79
1 files changed, 0 insertions, 79 deletions
diff --git a/tools/perf/scripts/python/stat-cpi.py b/tools/perf/scripts/python/stat-cpi.py
deleted file mode 100644
index 01fa933ff3cf..000000000000
--- a/tools/perf/scripts/python/stat-cpi.py
+++ /dev/null
@@ -1,79 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-
-from __future__ import print_function
-
-data = {}
-times = []
-threads = []
-cpus = []
-
-def get_key(time, event, cpu, thread):
- return "%d-%s-%d-%d" % (time, event, cpu, thread)
-
-def store_key(time, cpu, thread):
- if (time not in times):
- times.append(time)
-
- if (cpu not in cpus):
- cpus.append(cpu)
-
- if (thread not in threads):
- threads.append(thread)
-
-def store(time, event, cpu, thread, val, ena, run):
- #print("event %s cpu %d, thread %d, time %d, val %d, ena %d, run %d" %
- # (event, cpu, thread, time, val, ena, run))
-
- store_key(time, cpu, thread)
- key = get_key(time, event, cpu, thread)
- data[key] = [ val, ena, run]
-
-def get(time, event, cpu, thread):
- key = get_key(time, event, cpu, thread)
- return data[key][0]
-
-def stat__cycles_k(cpu, thread, time, val, ena, run):
- store(time, "cycles", cpu, thread, val, ena, run);
-
-def stat__instructions_k(cpu, thread, time, val, ena, run):
- store(time, "instructions", cpu, thread, val, ena, run);
-
-def stat__cycles_u(cpu, thread, time, val, ena, run):
- store(time, "cycles", cpu, thread, val, ena, run);
-
-def stat__instructions_u(cpu, thread, time, val, ena, run):
- store(time, "instructions", cpu, thread, val, ena, run);
-
-def stat__cycles(cpu, thread, time, val, ena, run):
- store(time, "cycles", cpu, thread, val, ena, run);
-
-def stat__instructions(cpu, thread, time, val, ena, run):
- store(time, "instructions", cpu, thread, val, ena, run);
-
-def stat__interval(time):
- for cpu in cpus:
- for thread in threads:
- cyc = get(time, "cycles", cpu, thread)
- ins = get(time, "instructions", cpu, thread)
- cpi = 0
-
- if ins != 0:
- cpi = cyc/float(ins)
-
- print("%15f: cpu %d, thread %d -> cpi %f (%d/%d)" % (time/(float(1000000000)), cpu, thread, cpi, cyc, ins))
-
-def trace_end():
- pass
-# XXX trace_end callback could be used as an alternative place
-# to compute same values as in the script above:
-#
-# for time in times:
-# for cpu in cpus:
-# for thread in threads:
-# cyc = get(time, "cycles", cpu, thread)
-# ins = get(time, "instructions", cpu, thread)
-#
-# if ins != 0:
-# cpi = cyc/float(ins)
-#
-# print("time %.9f, cpu %d, thread %d -> cpi %f" % (time/(float(1000000000)), cpu, thread, cpi))