History

perf scripts python: export-to-sqlite.py: Export calls parent_id

Export to the 'calls' table the newly created 'parent_id'.

Adrian Hunter committed 7 years ago

Commit 8ce9a721 parent f4358871 file · +8 −4Browse 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+8−4
@@ -222,7 +222,8 @@ if perf_db_export_calls: · 221 unmodified lines
222222 'call_id bigint,'
223223 'return_id bigint,'
224224 'parent_call_path_id bigint,'
225− 'flags integer)')
225+ 'flags integer,'
226+ 'parent_id bigint)')
226227
227228 # printf was added to sqlite in version 3.8.3
228229 sqlite_has_printf = False
@@ -321,7 +322,8 @@ if perf_db_export_calls: · 92 unmodified lines
321322 'call_id,'
322323 'return_id,'
323324 'CASE WHEN flags=0 THEN \'\' WHEN flags=1 THEN \'no call\' WHEN flags=2 THEN \'no return\' WHEN flags=3 THEN \'no call/return\' WHEN flags=6 THEN \'jump\' ELSE flags END AS flags,'
324− 'parent_call_path_id'
325+ 'parent_call_path_id,'
326+ 'parent_id'
325327 ' FROM calls INNER JOIN call_paths ON call_paths.id = call_path_id')
326328
327329 do_query(query, 'CREATE VIEW samples_view AS '
@@ -373,7 +375,7 @@ if perf_db_export_calls or perf_db_export_callchains: · 45 unmodified lines
373375 call_path_query.prepare("INSERT INTO call_paths VALUES (?, ?, ?, ?)")
374376 if perf_db_export_calls:
375377 call_query = QSqlQuery(db)
376− call_query.prepare("INSERT INTO calls VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")
378+ call_query.prepare("INSERT INTO calls VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")
377379
378380 def trace_begin():
379381 print datetime.datetime.today(), "Writing records..."
@@ -388,6 +390,7 @@ def trace_begin(): · 8 unmodified lines
388390 sample_table(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
389391 if perf_db_export_calls or perf_db_export_callchains:
390392 call_path_table(0, 0, 0, 0)
393+ call_return_table(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
391394
392395 unhandled_count = 0
393396
@@ -397,6 +400,7 @@ def trace_end(): · 3 unmodified lines
397400 print datetime.datetime.today(), "Adding indexes"
398401 if perf_db_export_calls:
399402 do_query(query, 'CREATE INDEX pcpid_idx ON calls (parent_call_path_id)')
403+ do_query(query, 'CREATE INDEX pid_idx ON calls (parent_id)')
400404
401405 if (unhandled_count):
402406 print datetime.datetime.today(), "Warning: ", unhandled_count, " unhandled events"
@@ -452,4 +456,4 @@ def call_path_table(*x): · 49 unmodified lines
452456 bind_exec(call_path_query, 4, x)
453457
454458 def call_return_table(*x):
455− bind_exec(call_query, 11, x)
459+ bind_exec(call_query, 12, x)

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