From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932723AbeEHV2h (ORCPT ); Tue, 8 May 2018 17:28:37 -0400 Received: from a8-57.smtp-out.amazonses.com ([54.240.8.57]:37892 "EHLO a8-57.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756050AbeEHV1w (ORCPT ); Tue, 8 May 2018 17:27:52 -0400 From: Jeremy Cline To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo Cc: Alexander Shishkin , Jiri Olsa , Namhyung Kim , "Herton R . Krzesinski" , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Jeremy Cline Subject: [PATCH 7/8] perf scripts python: Add Python 3 support to stat-cpi.py Date: Tue, 8 May 2018 21:27:51 +0000 Message-ID: <0100016341a74569-b9ac2ac6-f99b-41ed-be0d-f7cb3c69e6de-000000@email.amazonses.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: References: X-SES-Outgoing: 2018.05.08-54.240.8.57 Feedback-ID: 1.us-east-1.z18Isoc/FaoPOvCyJyi1mnTt8STwoRuibXVNoUcvG6g=:AmazonSES Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Support both Python 2 and Python 3 in stat-cpi.py. This should have no functional change. Signed-off-by: Jeremy Cline --- tools/perf/scripts/python/stat-cpi.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/perf/scripts/python/stat-cpi.py b/tools/perf/scripts/python/stat-cpi.py index 8410672efb8b..fc53a03da412 100644 --- a/tools/perf/scripts/python/stat-cpi.py +++ b/tools/perf/scripts/python/stat-cpi.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # SPDX-License-Identifier: GPL-2.0 +from __future__ import print_function + data = {} times = [] threads = [] @@ -59,7 +61,8 @@ def stat__interval(time): 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) + print("%15f: cpu %d, thread %d -> cpi %f (%d/%d)" % + (time/(float(1000000000)), cpu, thread, cpi, cyc, ins)) def trace_end(): pass -- 2.17.0