Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf scripts python: exported-sql-viewer.py: Use new 'has_calls' column

If the new 'has_calls' column is present, use it with the call graph and
call tree to select only comms that have calls.

Committer testing:

Just started the exported-sql-view.py and accessed all the reports, no
backtraces.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/20190710085810.1650-17-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Adrian Hunter and committed by
Arnaldo Carvalho de Melo
26c11206 26688729

+8 -2
+8 -2
tools/perf/scripts/python/exported-sql-viewer.py
··· 623 623 super(CallGraphRootItem, self).__init__(glb, params, 0, None) 624 624 self.dbid = 0 625 625 self.query_done = True 626 + if_has_calls = "" 627 + if IsSelectable(glb.db, "comms", columns = "has_calls"): 628 + if_has_calls = " WHERE has_calls = TRUE" 626 629 query = QSqlQuery(glb.db) 627 - QueryExec(query, "SELECT id, comm FROM comms") 630 + QueryExec(query, "SELECT id, comm FROM comms" + if_has_calls) 628 631 while query.next(): 629 632 if not query.value(0): 630 633 continue ··· 903 900 super(CallTreeRootItem, self).__init__(glb, params, 0, None) 904 901 self.dbid = 0 905 902 self.query_done = True 903 + if_has_calls = "" 904 + if IsSelectable(glb.db, "comms", columns = "has_calls"): 905 + if_has_calls = " WHERE has_calls = TRUE" 906 906 query = QSqlQuery(glb.db) 907 - QueryExec(query, "SELECT id, comm FROM comms") 907 + QueryExec(query, "SELECT id, comm FROM comms" + if_has_calls) 908 908 while query.next(): 909 909 if not query.value(0): 910 910 continue