From c2f3982ecf39abf6f77000e638e0791a421413ef Mon Sep 17 00:00:00 2001 From: Michael Petlan Date: Tue, 5 Sep 2023 12:32:48 +0200 Subject: [PATCH] perf scripts intel-pt-events.py: Fix IPC output for Python 2 Bugzilla: https://bugzilla.redhat.com/2233483 upstream ======== commit 1f64cfdebfe0494264271e8d7a3a47faf5f58ec7 Author: Roman Lozko Date: Fri Mar 10 15:04:45 2023 +0000 description =========== Integers are not converted to floats during division in Python 2 which results in incorrect IPC values. Fix by switching to new division behavior. Fixes: a483e64c0b62e93a ("perf scripting python: intel-pt-events.py: Add --insn-trace and --src-trace") Signed-off-by: Roman Lozko Acked-by: Adrian Hunter Cc: Adrian Hunter Link: https://lore.kernel.org/r/20230310150445.2925841-1-lozko.roma@gmail.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Michael Petlan --- tools/perf/scripts/python/intel-pt-events.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/scripts/python/intel-pt-events.py b/tools/perf/scripts/python/intel-pt-events.py index 08862a2582f4..1c76368f13c1 100644 --- a/tools/perf/scripts/python/intel-pt-events.py +++ b/tools/perf/scripts/python/intel-pt-events.py @@ -11,7 +11,7 @@ # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # more details. -from __future__ import print_function +from __future__ import division, print_function import io import os