From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 34739FBE7 for ; Mon, 15 May 2023 17:29:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C135C433D2; Mon, 15 May 2023 17:29:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1684171791; bh=w1jTZOrqbsu/LNImxaqRXBXXWvrVtgOAWa9jG7JIQUM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zULjug6KzkIywK/4Gif3Sg/elLPmrFKgmw6V6oAWrvtFEaFzCc38upuHkK8gCaKpR BKBGRTZqD/Fe5sg6I9w2pYLkOuRR0gotnls+IbTKRZ0y3P5CoBkQu8ZoEhEMRSYGoQ +pnpgGMxJdYK9obt5iY5Jh1+3kXcGSBhXZV1xwpI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Roman Lozko , Adrian Hunter , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 5.15 049/134] perf scripts intel-pt-events.py: Fix IPC output for Python 2 Date: Mon, 15 May 2023 18:28:46 +0200 Message-Id: <20230515161704.781668679@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230515161702.887638251@linuxfoundation.org> References: <20230515161702.887638251@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Roman Lozko [ Upstream commit 1f64cfdebfe0494264271e8d7a3a47faf5f58ec7 ] 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: Sasha Levin --- 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 66452a8ec3586..ed6f614f2724d 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 os import sys -- 2.39.2