History

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.

Adrian Hunter committed 7 years ago

Commit ecc8c991 parent 4650c7b1 file · +2 −0Browse files

Showing the changes to tools/perf/scripts/python (1 of 1 file). Show all

Unified · Split

tools/perf/scripts/python/export-to-sqlite.py+2−0
@@ -606,6 +606,8 @@ def trace_end(): · 605 unmodified lines
606606 if perf_db_export_calls:
607607 do_query(query, 'CREATE INDEX pcpid_idx ON calls (parent_call_path_id)')
608608 do_query(query, 'CREATE INDEX pid_idx ON calls (parent_id)')
609+ do_query(query, 'ALTER TABLE comms ADD has_calls boolean')
610+ do_query(query, 'UPDATE comms SET has_calls = 1 WHERE comms.id IN (SELECT DISTINCT comm_id FROM calls)')
609611
610612 printdate("Dropping unused tables")
611613 if is_table_empty("ptwrite"):

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t