Skip to content

Commit

Permalink
perf scripts python: exported-sql-viewer.py: Move view creation
Browse files Browse the repository at this point in the history
As preparation for adding support for copying to clipboard, create view
in TreeWindowBase instead of derived classes.

Committer testing:

Tested using an old .db used to test some older patches:

  $ python ~acme/libexec/perf-core/scripts/python/exported-sql-viewer.py ~/c/adrian.hunter/simple-retpoline.db

Nothing breaks.

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/20190503120828.25326-3-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 May 15, 2019
1 parent ca138a7 commit be6e747
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tools/perf/scripts/python/exported-sql-viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,9 +877,10 @@ def __init__(self, parent=None):
super(TreeWindowBase, self).__init__(parent)

self.model = None
self.view = None
self.find_bar = None

self.view = QTreeView()

def DisplayFound(self, ids):
if not len(ids):
return False
Expand Down Expand Up @@ -921,7 +922,6 @@ def __init__(self, glb, parent=None):

self.model = LookupCreateModel("Context-Sensitive Call Graph", lambda x=glb: CallGraphModel(x))

self.view = QTreeView()
self.view.setModel(self.model)

for c, w in ((0, 250), (1, 100), (2, 60), (3, 70), (4, 70), (5, 100)):
Expand All @@ -944,7 +944,6 @@ def __init__(self, glb, parent=None):

self.model = LookupCreateModel("Call Tree", lambda x=glb: CallTreeModel(x))

self.view = QTreeView()
self.view.setModel(self.model)

for c, w in ((0, 230), (1, 100), (2, 100), (3, 70), (4, 70), (5, 100)):
Expand Down

0 comments on commit be6e747

Please sign in to comment.