Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp869520ybl; Wed, 11 Dec 2019 08:45:08 -0800 (PST) X-Google-Smtp-Source: APXvYqztLK4tmTzU2kyxWHU+UapB4tw9BYi1sm70YhBnAkhis9y3/vP3eRu5wEy3Udb60I4FpWTn X-Received: by 2002:a05:6830:1047:: with SMTP id b7mr3103737otp.77.1576082708751; Wed, 11 Dec 2019 08:45:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576082708; cv=none; d=google.com; s=arc-20160816; b=1KPYPDDOfZ2KwgCQSr0rnig7L0lwTxSmLrZAiEL0Gl9ZENOjzB5d9jnfCiY2WEgW1L 0ToyXRnSmMWPtoSsWOlCRDVnkqLHDIjp16WqExZwE5mJcJ+8JhTGm9sHDzxa49Pyc/yW BSm1DU0hHya3n+pl/UwJmmaFKLqORBnMP+B9Drm0UmBT483ykK4o924x1dEmzldSael9 APhdqaE/bELiB87izoWVoUVThan9s3npRukjbcrd9dqhzw6qHVw0iywtZT5nhM40lQUt jYAp5RCcWdGlG6QrpqtuiNVppBzZht6OhsiENkzLbm/uKByHgifXMo5WxqaibWvN46+t vsCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4Z1FVRFQ50vXRWTYPUnnUVU1zxsPhjp7Y/pa04394V8=; b=jbXEHZOA/9ZE8cq37AUOsBe3YGd8iGYFuf6ROIsp2UbhD2lmMCbyamT5iJlSAgJfqQ TEtbnmevvjZPp+/TPSjT7ayHMZwX40xe1VoTOTzDzKuQJef1l3uAfP412BjRORSvONd2 tVVMtYYbBDwxQuoLgGmt/up83ixLIwIQZDdjg3lRQ+T9fXjW5cuIN2GHw9kkqwzHyYf+ G9XBfvWFAHZMFTmRr+nZzCe5lIOIfrvFvP7eGCx6zUqd7buPvXKbxtUvjKNn2UnhJcoW cm1GafmxvuRUZ40ENfEg6Z5bSFwMlSQzBGxeQRPCq84u8OeceKRffmno8wmPSsBVNzDg 5wFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0EazbO5q; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v145si1395782oia.68.2019.12.11.08.44.50; Wed, 11 Dec 2019 08:45:08 -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; dkim=pass header.i=@kernel.org header.s=default header.b=0EazbO5q; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730927AbfLKPL1 (ORCPT + 99 others); Wed, 11 Dec 2019 10:11:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:59970 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729797AbfLKPLZ (ORCPT ); Wed, 11 Dec 2019 10:11:25 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 483F522B48; Wed, 11 Dec 2019 15:11:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077084; bh=iCe981dpQcbeniIuJo78yCB5icEWgktPbevCe92sIE4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0EazbO5qBnKV5m1s07bSuR3gyCqzGFekAg3kJQ+dqt3Q4YP5SQqtiVbq9BTSs2oNm NxC2nRqL+Egt3K1RwNPw7M3GfpJlzEojFi3EuqIf55U9dPfsG4+QFPXJgsrhqRRrEe +Gt4ejIRNoCN83j3lLpcywY/6wWmUgpHDzyi1NBE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Adrian Hunter , Jiri Olsa , Arnaldo Carvalho de Melo Subject: [PATCH 5.3 003/105] perf scripts python: exported-sql-viewer.py: Fix use of TRUE with SQLite Date: Wed, 11 Dec 2019 16:04:52 +0100 Message-Id: <20191211150222.212877093@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150221.153659747@linuxfoundation.org> References: <20191211150221.153659747@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Adrian Hunter commit af833988c088d3fed3e7188e7c3dd9ca17178dc3 upstream. Prior to version 3.23 SQLite does not support TRUE or FALSE, so always use 1 and 0 for SQLite. Fixes: 26c11206f433 ("perf scripts python: exported-sql-viewer.py: Use new 'has_calls' column") Signed-off-by: Adrian Hunter Cc: Jiri Olsa Cc: stable@vger.kernel.org # v5.3+ Link: http://lore.kernel.org/lkml/20191113120206.26957-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo [Adrian: backported to v5.3, v5.4] Signed-off-by: Adrian Hunter Signed-off-by: Greg Kroah-Hartman --- tools/perf/scripts/python/exported-sql-viewer.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) --- a/tools/perf/scripts/python/exported-sql-viewer.py +++ b/tools/perf/scripts/python/exported-sql-viewer.py @@ -625,7 +625,7 @@ class CallGraphRootItem(CallGraphLevelIt self.query_done = True if_has_calls = "" if IsSelectable(glb.db, "comms", columns = "has_calls"): - if_has_calls = " WHERE has_calls = TRUE" + if_has_calls = " WHERE has_calls = " + glb.dbref.TRUE query = QSqlQuery(glb.db) QueryExec(query, "SELECT id, comm FROM comms" + if_has_calls) while query.next(): @@ -905,7 +905,7 @@ class CallTreeRootItem(CallGraphLevelIte self.query_done = True if_has_calls = "" if IsSelectable(glb.db, "comms", columns = "has_calls"): - if_has_calls = " WHERE has_calls = TRUE" + if_has_calls = " WHERE has_calls = " + glb.dbref.TRUE query = QSqlQuery(glb.db) QueryExec(query, "SELECT id, comm FROM comms" + if_has_calls) while query.next(): @@ -3509,6 +3509,12 @@ class DBRef(): def __init__(self, is_sqlite3, dbname): self.is_sqlite3 = is_sqlite3 self.dbname = dbname + self.TRUE = "TRUE" + self.FALSE = "FALSE" + # SQLite prior to version 3.23 does not support TRUE and FALSE + if self.is_sqlite3: + self.TRUE = "1" + self.FALSE = "0" def Open(self, connection_name): dbname = self.dbname