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

perf scripts python: export-to-sqlite.py: Export all sample flags

Add sample flags to the SQLite database definition and export.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: https://lore.kernel.org/r/20220124084201.2699795-24-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
761836cb c096fff6

+11 -8
+11 -8
tools/perf/scripts/python/export-to-sqlite.py
··· 223 223 'in_tx boolean,' 224 224 'call_path_id bigint,' 225 225 'insn_count bigint,' 226 - 'cyc_count bigint)') 226 + 'cyc_count bigint,' 227 + 'flags integer)') 227 228 else: 228 229 do_query(query, 'CREATE TABLE samples (' 229 230 'id integer NOT NULL PRIMARY KEY,' ··· 250 249 'in_tx boolean,' 251 250 'call_path_id bigint,' 252 251 'insn_count bigint,' 253 - 'cyc_count bigint)') 252 + 'cyc_count bigint,' 253 + 'flags integer)') 254 254 255 255 if perf_db_export_calls or perf_db_export_callchains: 256 256 do_query(query, 'CREATE TABLE call_paths (' ··· 444 442 'in_tx,' 445 443 'insn_count,' 446 444 'cyc_count,' 447 - 'CASE WHEN cyc_count=0 THEN CAST(0 AS FLOAT) ELSE ROUND(CAST(insn_count AS FLOAT) / cyc_count, 2) END AS IPC' 445 + 'CASE WHEN cyc_count=0 THEN CAST(0 AS FLOAT) ELSE ROUND(CAST(insn_count AS FLOAT) / cyc_count, 2) END AS IPC,' 446 + 'flags' 448 447 ' FROM samples') 449 448 450 449 do_query(query, 'CREATE VIEW ptwrite_view AS ' ··· 587 584 branch_type_query.prepare("INSERT INTO branch_types VALUES (?, ?)") 588 585 sample_query = QSqlQuery(db) 589 586 if branches: 590 - sample_query.prepare("INSERT INTO samples VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)") 587 + sample_query.prepare("INSERT INTO samples VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)") 591 588 else: 592 - sample_query.prepare("INSERT INTO samples VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)") 589 + sample_query.prepare("INSERT INTO samples VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)") 593 590 if perf_db_export_calls or perf_db_export_callchains: 594 591 call_path_query = QSqlQuery(db) 595 592 call_path_query.prepare("INSERT INTO call_paths VALUES (?, ?, ?, ?)") ··· 621 618 comm_table(0, "unknown", 0, 0, 0) 622 619 dso_table(0, 0, "unknown", "unknown", "") 623 620 symbol_table(0, 0, 0, 0, 0, "unknown") 624 - sample_table(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) 621 + sample_table(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) 625 622 if perf_db_export_calls or perf_db_export_callchains: 626 623 call_path_table(0, 0, 0, 0) 627 624 call_return_table(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) ··· 706 703 if branches: 707 704 for xx in x[0:15]: 708 705 sample_query.addBindValue(str(xx)) 709 - for xx in x[19:24]: 706 + for xx in x[19:25]: 710 707 sample_query.addBindValue(str(xx)) 711 708 do_query_(sample_query) 712 709 else: 713 - bind_exec(sample_query, 24, x) 710 + bind_exec(sample_query, 25, x) 714 711 715 712 def call_path_table(*x): 716 713 bind_exec(call_path_query, 4, x)