Skip to content

Commit

Permalink
perf scripts python: export-to-sqlite.py: Export comm details
Browse files Browse the repository at this point in the history
Add table columns for thread id, comm start time and exec flag.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/20190710085810.1650-10-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Adrian Hunter authored and Arnaldo Carvalho de Melo committed Jul 10, 2019
1 parent 8ebf5cc commit 41085f2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tools/perf/scripts/python/export-to-sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ def do_query_(q):
'tid integer)')
do_query(query, 'CREATE TABLE comms ('
'id integer NOT NULL PRIMARY KEY,'
'comm varchar(16))')
'comm varchar(16),'
'c_thread_id bigint,'
'c_time bigint,'
'exec_flag boolean)')
do_query(query, 'CREATE TABLE comm_threads ('
'id integer NOT NULL PRIMARY KEY,'
'comm_id bigint,'
Expand Down Expand Up @@ -536,7 +539,7 @@ def emit_to_hex(x):
thread_query = QSqlQuery(db)
thread_query.prepare("INSERT INTO threads VALUES (?, ?, ?, ?, ?)")
comm_query = QSqlQuery(db)
comm_query.prepare("INSERT INTO comms VALUES (?, ?)")
comm_query.prepare("INSERT INTO comms VALUES (?, ?, ?, ?, ?)")
comm_thread_query = QSqlQuery(db)
comm_thread_query.prepare("INSERT INTO comm_threads VALUES (?, ?, ?)")
dso_query = QSqlQuery(db)
Expand Down Expand Up @@ -576,7 +579,7 @@ def trace_begin():
evsel_table(0, "unknown")
machine_table(0, 0, "unknown")
thread_table(0, 0, 0, -1, -1)
comm_table(0, "unknown")
comm_table(0, "unknown", 0, 0, 0)
dso_table(0, 0, "unknown", "unknown", "")
symbol_table(0, 0, 0, 0, 0, "unknown")
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)
Expand Down Expand Up @@ -642,7 +645,7 @@ def thread_table(*x):
bind_exec(thread_query, 5, x)

def comm_table(*x):
bind_exec(comm_query, 2, x)
bind_exec(comm_query, 5, x)

def comm_thread_table(*x):
bind_exec(comm_thread_query, 3, x)
Expand Down

0 comments on commit 41085f2

Please sign in to comment.