[lkml]   [2019]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 16/28] perf scripts python: Add has_calls column to comms table
From: Adrian Hunter <>

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 script
to select only comms with calls.

Committer notes:

Running the worked without warnings and using the worked as before.

Signed-off-by: Adrian Hunter <>
Tested-by: Arnaldo Carvalho de Melo <>
Cc: Jiri Olsa <>
Signed-off-by: Arnaldo Carvalho de Melo <>
tools/perf/scripts/python/ | 2 ++
1 file changed, 2 insertions(+)

diff --git a/tools/perf/scripts/python/ b/tools/perf/scripts/python/
index 97aa66dd2fe1..9156f6a1e5f0 100644
--- a/tools/perf/scripts/python/
+++ b/tools/perf/scripts/python/
@@ -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 IN (SELECT DISTINCT comm_id FROM calls)')

printdate("Dropping unused tables")
if is_table_empty("ptwrite"):
 \ /
  Last update: 2019-07-15 23:13    [W:0.090 / U:2.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site