Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1708900imu; Thu, 17 Jan 2019 01:51:57 -0800 (PST) X-Google-Smtp-Source: ALg8bN7XMHMH/E8F/bpMALxT75ZbTtBMcJs2CBJLvv4rJTsBUCrAJOGCpGgBMavFbQF3xeR2HeBv X-Received: by 2002:a65:624c:: with SMTP id q12mr12862674pgv.379.1547718716999; Thu, 17 Jan 2019 01:51:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547718716; cv=none; d=google.com; s=arc-20160816; b=lrrkIwAMwTC6jf3piSrNGK83iwRhqQBzvcnH9F2dHPGg5xBJJBsDam/JkJAOG84grj 2XuCE9t+UFhexvLcqFcxzCLRtgnVgr9dAbLfHs1b/EXij176+jRo2ZPCG3W80aveaF0e ScwnBVcqrpsOez+GmwgujbrDs43KqbwVDXvZg/NN+i94tn0cLQlrqsKlVWCmTFuiNzws I3yRpcFjPF9oUuEg7NGd6gtzxO5t/RMudeWuoVd9C+18ejaweSx9m0U0XFBe1z7H6KQO bm7FmCMLJO+c/7pMdERak6tNTvKTtsmncQT6oQjq4dJAZlbSibQBszPPnfJaK2/ij07J nAcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from; bh=IE1r/26CgtC2UAsaKyju6SS0RNOhHbnZqskzgS5KTfo=; b=jhKmIw9M/kDB6jqPO4sf/SVF5oqZYDg7j3hB960zW0GvH2rMfMnpu3NqGM2Yi3reRZ IIN44cx1Z4NRr+BtEBjcvv097imi3Df7o7vcFUv0NbqkVKXQuee8vyRiSAgae8yL4uCN 6SweKoHGnQ0OkHAAYDu92U8t1bYt2jA8Wqmo+4zjy4bWJm+/xnJD9Fl9wUllV771gmzA WSE0mF6p5MLb71RGVomrvGDFJOsXzM6NGIeqBlJR+4fHMc14kTcdtMTLKNttV9mR5ENc HboHk2Q0Y9JOqSaRpNg/fmvDt4ukFS7TrlCYdeYapXXQZ4HSPT98Sb2Axn/t3Oh3DIH8 6ggg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y13si1201347pgj.157.2019.01.17.01.51.41; Thu, 17 Jan 2019 01:51:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728923AbfAQJqH (ORCPT + 99 others); Thu, 17 Jan 2019 04:46:07 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:34808 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728578AbfAQJqE (ORCPT ); Thu, 17 Jan 2019 04:46:04 -0500 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id x0H9iF0R041368 for ; Thu, 17 Jan 2019 04:46:03 -0500 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 2q2nt0mc32-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 17 Jan 2019 04:46:02 -0500 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 17 Jan 2019 09:46:01 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 17 Jan 2019 09:45:56 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x0H9jtsx9109772 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 17 Jan 2019 09:45:55 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BD42A11C050; Thu, 17 Jan 2019 09:45:55 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5CF1311C052; Thu, 17 Jan 2019 09:45:54 +0000 (GMT) Received: from oc1548405160.ibm.com (unknown [9.124.35.202]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 17 Jan 2019 09:45:54 +0000 (GMT) From: Seeteena Thoufeek To: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, linux-kernel@vger.kernel.org Cc: s1seetee@linux.vnet.ibm.com Subject: [PATCH v2] perf scripts python: Add Python 3 support to export-to-sqlite.py Date: Thu, 17 Jan 2019 15:15:31 +0530 X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1547718344-27382-1-git-send-email-s1seetee@linux.vnet.ibm.com> References: <1547718344-27382-1-git-send-email-s1seetee@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19011709-0008-0000-0000-000002B2360D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19011709-0009-0000-0000-0000221E527F Message-Id: <1547718344-27382-4-git-send-email-s1seetee@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-01-17_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901170072 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Support both Python 2 and Python 3 in export-to-sqlite.py. ``print`` is now a function rather than a statement. This should have no functional change. Signed-off-by: Seeteena Thoufeek Reviewed-by: Ravi Bangoria --- tools/perf/scripts/python/export-to-sqlite.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/perf/scripts/python/export-to-sqlite.py b/tools/perf/scripts/python/export-to-sqlite.py index 245caf2..66be899 100644 --- a/tools/perf/scripts/python/export-to-sqlite.py +++ b/tools/perf/scripts/python/export-to-sqlite.py @@ -9,6 +9,7 @@ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # more details. +from __future__ import print_function import os import sys @@ -100,7 +101,7 @@ def do_query_(q): return raise Exception("Query failed: " + q.lastError().text()) -print datetime.datetime.today(), "Creating database..." +print(datetime.datetime.today(), "Creating database...") db_exists = False try: @@ -376,7 +377,7 @@ if perf_db_export_calls: call_query.prepare("INSERT INTO calls VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)") def trace_begin(): - print datetime.datetime.today(), "Writing records..." + print(datetime.datetime.today(), "Writing records...") do_query(query, 'BEGIN TRANSACTION') # id == 0 means unknown. It is easier to create records for them than replace the zeroes with NULLs evsel_table(0, "unknown") @@ -394,13 +395,13 @@ unhandled_count = 0 def trace_end(): do_query(query, 'END TRANSACTION') - print datetime.datetime.today(), "Adding indexes" + print(datetime.datetime.today(), "Adding indexes") if perf_db_export_calls: do_query(query, 'CREATE INDEX pcpid_idx ON calls (parent_call_path_id)') if (unhandled_count): - print datetime.datetime.today(), "Warning: ", unhandled_count, " unhandled events" - print datetime.datetime.today(), "Done" + print(datetime.datetime.today(), "Warning: ", unhandled_count, " unhandled events") + print(datetime.datetime.today(), "Done") def trace_unhandled(event_name, context, event_fields_dict): global unhandled_count -- 1.8.3.1