* [PATCH] perf scripts python: exported-sql-viewer.py: Fix use of TRUE with SQLite
@ 2019-11-13 12:02 Adrian Hunter
2019-11-13 12:15 ` Arnaldo Carvalho de Melo
2019-11-19 16:56 ` [tip: perf/core] " tip-bot2 for Adrian Hunter
0 siblings, 2 replies; 5+ messages in thread
From: Adrian Hunter @ 2019-11-13 12:02 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo; +Cc: Jiri Olsa, linux-kernel
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 <adrian.hunter@intel.com>
Cc: stable@vger.kernel.org
---
tools/perf/scripts/python/exported-sql-viewer.py | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/tools/perf/scripts/python/exported-sql-viewer.py b/tools/perf/scripts/python/exported-sql-viewer.py
index ebc6a2e5eae9..26d7be785288 100755
--- a/tools/perf/scripts/python/exported-sql-viewer.py
+++ b/tools/perf/scripts/python/exported-sql-viewer.py
@@ -637,7 +637,7 @@ class CallGraphRootItem(CallGraphLevelItemBase):
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():
@@ -918,7 +918,7 @@ class CallTreeRootItem(CallGraphLevelItemBase):
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():
@@ -1290,7 +1290,7 @@ class SwitchGraphData(GraphData):
QueryExec(query, "SELECT id, c_time"
" FROM comms"
" WHERE c_thread_id = " + str(thread_id) +
- " AND exec_flag = TRUE"
+ " AND exec_flag = " + self.collection.glb.dbref.TRUE +
" AND c_time >= " + str(start_time) +
" AND c_time <= " + str(end_time) +
" ORDER BY c_time, id")
@@ -5016,6 +5016,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
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] perf scripts python: exported-sql-viewer.py: Fix use of TRUE with SQLite
2019-11-13 12:02 [PATCH] perf scripts python: exported-sql-viewer.py: Fix use of TRUE with SQLite Adrian Hunter
@ 2019-11-13 12:15 ` Arnaldo Carvalho de Melo
2019-11-13 12:28 ` Adrian Hunter
2019-11-19 16:56 ` [tip: perf/core] " tip-bot2 for Adrian Hunter
1 sibling, 1 reply; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2019-11-13 12:15 UTC (permalink / raw)
To: Adrian Hunter; +Cc: Jiri Olsa, linux-kernel
Em Wed, Nov 13, 2019 at 02:02:06PM +0200, Adrian Hunter escreveu:
> 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 <adrian.hunter@intel.com>
> Cc: stable@vger.kernel.org
Thanks, applied and added the first tag with that fixed cset:
Cc: stable@vger.kernel.org # v5.3+
[acme@quaco perf]$ git tag --contains 26c11206f433 | grep ^v[3-9] | head
v5.3
v5.3-rc1
v5.3-rc2
v5.3-rc3
v5.3-rc4
v5.3-rc5
v5.3-rc6
v5.3-rc7
v5.3-rc8
v5.4-rc1
[acme@quaco perf]$
- Arnaldo
> ---
> tools/perf/scripts/python/exported-sql-viewer.py | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/tools/perf/scripts/python/exported-sql-viewer.py b/tools/perf/scripts/python/exported-sql-viewer.py
> index ebc6a2e5eae9..26d7be785288 100755
> --- a/tools/perf/scripts/python/exported-sql-viewer.py
> +++ b/tools/perf/scripts/python/exported-sql-viewer.py
> @@ -637,7 +637,7 @@ class CallGraphRootItem(CallGraphLevelItemBase):
> 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():
> @@ -918,7 +918,7 @@ class CallTreeRootItem(CallGraphLevelItemBase):
> 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():
> @@ -1290,7 +1290,7 @@ class SwitchGraphData(GraphData):
> QueryExec(query, "SELECT id, c_time"
> " FROM comms"
> " WHERE c_thread_id = " + str(thread_id) +
> - " AND exec_flag = TRUE"
> + " AND exec_flag = " + self.collection.glb.dbref.TRUE +
> " AND c_time >= " + str(start_time) +
> " AND c_time <= " + str(end_time) +
> " ORDER BY c_time, id")
> @@ -5016,6 +5016,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
> --
> 2.17.1
--
- Arnaldo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] perf scripts python: exported-sql-viewer.py: Fix use of TRUE with SQLite
2019-11-13 12:15 ` Arnaldo Carvalho de Melo
@ 2019-11-13 12:28 ` Adrian Hunter
2019-11-13 12:58 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 5+ messages in thread
From: Adrian Hunter @ 2019-11-13 12:28 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo; +Cc: Jiri Olsa, linux-kernel
On 13/11/19 2:15 PM, Arnaldo Carvalho de Melo wrote:
> Em Wed, Nov 13, 2019 at 02:02:06PM +0200, Adrian Hunter escreveu:
>> 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 <adrian.hunter@intel.com>
>> Cc: stable@vger.kernel.org
>
> Thanks, applied and added the first tag with that fixed cset:
>
> Cc: stable@vger.kernel.org # v5.3+
Thanks, but I just noticed it doesn't apply to 5.3 or 5.4-rc7, sorry :-(.
I guess the Fixes and stable tags should be dropped and I will send the
stable patch separately.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] perf scripts python: exported-sql-viewer.py: Fix use of TRUE with SQLite
2019-11-13 12:28 ` Adrian Hunter
@ 2019-11-13 12:58 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2019-11-13 12:58 UTC (permalink / raw)
To: Adrian Hunter; +Cc: Arnaldo Carvalho de Melo, Jiri Olsa, linux-kernel
Em Wed, Nov 13, 2019 at 02:28:24PM +0200, Adrian Hunter escreveu:
> On 13/11/19 2:15 PM, Arnaldo Carvalho de Melo wrote:
> > Em Wed, Nov 13, 2019 at 02:02:06PM +0200, Adrian Hunter escreveu:
> >> 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 <adrian.hunter@intel.com>
> >> Cc: stable@vger.kernel.org
> >
> > Thanks, applied and added the first tag with that fixed cset:
> >
> > Cc: stable@vger.kernel.org # v5.3+
>
> Thanks, but I just noticed it doesn't apply to 5.3 or 5.4-rc7, sorry :-(.
> I guess the Fixes and stable tags should be dropped and I will send the
> stable patch separately.
Humm, I think this is still appropriate, i.e. the fixes/stables should
not be taken literally as being the patch to apply to those older
versions, just that this patch addresses a problem that was introduced
at that tag and that affects the stable kernels since tag v5.3.
Which in turn makes people try to apply it, if it fails, then the stable
guys ask for guidance.
Of course you can be proactive and do what you say you'll do, i.e. test
it and provide patches for the stable kernels, taking into account
whatever adjustments needed due to this code having been touched after
that problem.
So I'm keeping the fixes and cc stable lines,
Thanks,
- Arnaldo
^ permalink raw reply [flat|nested] 5+ messages in thread
* [tip: perf/core] perf scripts python: exported-sql-viewer.py: Fix use of TRUE with SQLite
2019-11-13 12:02 [PATCH] perf scripts python: exported-sql-viewer.py: Fix use of TRUE with SQLite Adrian Hunter
2019-11-13 12:15 ` Arnaldo Carvalho de Melo
@ 2019-11-19 16:56 ` tip-bot2 for Adrian Hunter
1 sibling, 0 replies; 5+ messages in thread
From: tip-bot2 for Adrian Hunter @ 2019-11-19 16:56 UTC (permalink / raw)
To: linux-tip-commits
Cc: Adrian Hunter, Jiri Olsa, stable, #, v5.3+,
Arnaldo Carvalho de Melo, Ingo Molnar, Borislav Petkov,
linux-kernel
The following commit has been merged into the perf/core branch of tip:
Commit-ID: af833988c088d3fed3e7188e7c3dd9ca17178dc3
Gitweb: https://git.kernel.org/tip/af833988c088d3fed3e7188e7c3dd9ca17178dc3
Author: Adrian Hunter <adrian.hunter@intel.com>
AuthorDate: Wed, 13 Nov 2019 14:02:06 +02:00
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitterDate: Wed, 13 Nov 2019 09:13:16 -03:00
perf scripts python: exported-sql-viewer.py: Fix use of TRUE with SQLite
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 <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
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 <acme@redhat.com>
---
tools/perf/scripts/python/exported-sql-viewer.py | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/tools/perf/scripts/python/exported-sql-viewer.py b/tools/perf/scripts/python/exported-sql-viewer.py
index ebc6a2e..26d7be7 100755
--- a/tools/perf/scripts/python/exported-sql-viewer.py
+++ b/tools/perf/scripts/python/exported-sql-viewer.py
@@ -637,7 +637,7 @@ class CallGraphRootItem(CallGraphLevelItemBase):
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():
@@ -918,7 +918,7 @@ class CallTreeRootItem(CallGraphLevelItemBase):
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():
@@ -1290,7 +1290,7 @@ class SwitchGraphData(GraphData):
QueryExec(query, "SELECT id, c_time"
" FROM comms"
" WHERE c_thread_id = " + str(thread_id) +
- " AND exec_flag = TRUE"
+ " AND exec_flag = " + self.collection.glb.dbref.TRUE +
" AND c_time >= " + str(start_time) +
" AND c_time <= " + str(end_time) +
" ORDER BY c_time, id")
@@ -5016,6 +5016,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
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-11-19 16:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-13 12:02 [PATCH] perf scripts python: exported-sql-viewer.py: Fix use of TRUE with SQLite Adrian Hunter
2019-11-13 12:15 ` Arnaldo Carvalho de Melo
2019-11-13 12:28 ` Adrian Hunter
2019-11-13 12:58 ` Arnaldo Carvalho de Melo
2019-11-19 16:56 ` [tip: perf/core] " tip-bot2 for Adrian Hunter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox