perf scripts python: export-to-sqlite.py: Export switch events
authorAdrian Hunter <adrian.hunter@intel.com>
Wed, 10 Jul 2019 08:58:09 +0000 (11:58 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 10 Jul 2019 15:37:35 +0000 (12:37 -0300)
commit37c1f991b1bcdbe268b99b22e265738f4209f4f4
treefa01cdef1f32fed6244c39f4566565be7abf4c43
parentabde8722d9b0a317935506d9824e26f1aef6c24a
perf scripts python: export-to-sqlite.py: Export switch events

Export switch events to a new table 'context_switches' and create a view
'context_switches_view'. The table and view will show automatically in
the exported-sql-viewer.py script.

If the table ends up empty, then it and the view are dropped.

Committer testing:

Use the exported-sql-viewer.py and look at "Tables" ->
"context_switches":

  id  machine_id  time             cpu  thread_out_id  comm_out_id  thread_in_id  comm_in_id  flags
  1   1           187836111885918  7    1              1            2             2           3
  2   1           187836111889369  7    1              1            2             2           0
  3   1           187836112464618  7    2              3            1             1           1
  4   1           187836112465511  7    2              3            1             1           0

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-21-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/scripts/python/export-to-sqlite.py