diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2019-07-08 01:52:31 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-07-09 09:13:27 -0400 |
commit | d8d051df9f906232715282cc0570c94273b197bc (patch) | |
tree | 7f1a54f17b592e8c522066837649d9286e6d84f0 /tools/perf/scripts/python | |
parent | ceb75476db1617a88cc29b09839acacb69aa076e (diff) |
perf scripts python: export-to-postgresql.py: Fix DROP VIEW power_events_view
PostgreSQL can error if power_events_view is not dropped before its
dependent tables e.g.
Exception: Query failed: ERROR: cannot drop table mwait because other
objects depend on it
DETAIL: view power_events_view depends on table mwait
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Fixes: aba44287a224 ("perf scripts python: export-to-postgresql.py: Export Intel PT power and ptwrite events")
Link: http://lkml.kernel.org/r/20190708055232.5032-2-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python')
-rw-r--r-- | tools/perf/scripts/python/export-to-postgresql.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/scripts/python/export-to-postgresql.py b/tools/perf/scripts/python/export-to-postgresql.py index 4447f0d7c754..92713d93e956 100644 --- a/tools/perf/scripts/python/export-to-postgresql.py +++ b/tools/perf/scripts/python/export-to-postgresql.py | |||
@@ -898,11 +898,11 @@ def trace_end(): | |||
898 | if is_table_empty("ptwrite"): | 898 | if is_table_empty("ptwrite"): |
899 | drop("ptwrite") | 899 | drop("ptwrite") |
900 | if is_table_empty("mwait") and is_table_empty("pwre") and is_table_empty("exstop") and is_table_empty("pwrx"): | 900 | if is_table_empty("mwait") and is_table_empty("pwre") and is_table_empty("exstop") and is_table_empty("pwrx"): |
901 | do_query(query, 'DROP VIEW power_events_view'); | ||
901 | drop("mwait") | 902 | drop("mwait") |
902 | drop("pwre") | 903 | drop("pwre") |
903 | drop("exstop") | 904 | drop("exstop") |
904 | drop("pwrx") | 905 | drop("pwrx") |
905 | do_query(query, 'DROP VIEW power_events_view'); | ||
906 | if is_table_empty("cbr"): | 906 | if is_table_empty("cbr"): |
907 | drop("cbr") | 907 | drop("cbr") |
908 | 908 | ||