[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-ecc8c9984dae9812a10936cb9c74957b68075e07@git.kernel.org>
Date: Wed, 17 Jul 2019 15:59:49 -0700
From: tip-bot for Adrian Hunter <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: mingo@...nel.org, jolsa@...hat.com, acme@...hat.com,
tglx@...utronix.de, hpa@...or.com, linux-kernel@...r.kernel.org,
adrian.hunter@...el.com
Subject: [tip:perf/urgent] perf scripts python: export-to-sqlite.py: Add
has_calls column to comms table
Commit-ID: ecc8c9984dae9812a10936cb9c74957b68075e07
Gitweb: https://git.kernel.org/tip/ecc8c9984dae9812a10936cb9c74957b68075e07
Author: Adrian Hunter <adrian.hunter@...el.com>
AuthorDate: Wed, 10 Jul 2019 11:58:02 +0300
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Wed, 10 Jul 2019 12:23:55 -0300
perf scripts python: export-to-sqlite.py: Add has_calls column to comms table
Now that a thread's current comm is exported, it shows up in the call
graph and call tree even if it has no calls. That can happen because the
calls are recorded against the main thread's initial comm.
Add a table column to make it easy for the exported-sql-viewer.py script
to select only comms with calls.
Committer notes:
Running the export-to-sqlite.py worked without warnings and using the
exported-sql-viewer.py worked as before.
Signed-off-by: Adrian Hunter <adrian.hunter@...el.com>
Tested-by: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Link: http://lkml.kernel.org/r/20190710085810.1650-14-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/scripts/python/export-to-sqlite.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/perf/scripts/python/export-to-sqlite.py b/tools/perf/scripts/python/export-to-sqlite.py
index 97aa66dd2fe1..9156f6a1e5f0 100644
--- a/tools/perf/scripts/python/export-to-sqlite.py
+++ b/tools/perf/scripts/python/export-to-sqlite.py
@@ -606,6 +606,8 @@ def trace_end():
if perf_db_export_calls:
do_query(query, 'CREATE INDEX pcpid_idx ON calls (parent_call_path_id)')
do_query(query, 'CREATE INDEX pid_idx ON calls (parent_id)')
+ do_query(query, 'ALTER TABLE comms ADD has_calls boolean')
+ do_query(query, 'UPDATE comms SET has_calls = 1 WHERE comms.id IN (SELECT DISTINCT comm_id FROM calls)')
printdate("Dropping unused tables")
if is_table_empty("ptwrite"):
Powered by blists - more mailing lists