From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51F2DC7EE26 for ; Mon, 15 May 2023 17:09:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243659AbjEORJY (ORCPT ); Mon, 15 May 2023 13:09:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243423AbjEORJC (ORCPT ); Mon, 15 May 2023 13:09:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1261D83DB for ; Mon, 15 May 2023 10:07:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4EB9D62B02 for ; Mon, 15 May 2023 17:06:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3BF08C433D2; Mon, 15 May 2023 17:06:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1684170403; bh=j61/6o4U+iwvdS7N+EPzVJbSrqu9xZba2xWoo5S8exw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KBmx1Rz1BR+ojHWdD0ebcClpJcs1w1inLA8+kQl75zR20TlgJfzkIpOnK1u3ggUBP ksGjOctdlUclHNuSO76nSi2bI76f974tAdqiRPBQ5u8cheI1WwN7Uc6LUq1XqbxKsP jgsUAZz7ywhzlDUipZ+IUixHBA5YzdbSiOiz7dVg= 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 6.1 091/239] perf scripts intel-pt-events.py: Fix IPC output for Python 2 Date: Mon, 15 May 2023 18:25:54 +0200 Message-Id: <20230515161724.402644039@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230515161721.545370111@linuxfoundation.org> References: <20230515161721.545370111@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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 6be7fd8fd6158..8058b2fc2b686 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