aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python/exported-sql-viewer.py
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2019-05-03 08:08:23 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-05-15 15:36:47 -0400
commit4b2084537e5f3b58337bce894391fb63bf3b0e28 (patch)
treee2abbb971d5946b9fd71a235de720a9f1ce9f75b /tools/perf/scripts/python/exported-sql-viewer.py
parentbe6e747136a4dc8aad99259e47fd6f7362a43996 (diff)
perf scripts python: exported-sql-viewer.py: Fix error when shrinking / enlarging font
Fix the following error if shrink / enlarge font is used with the help window. Traceback (most recent call last): File "tools/perf/scripts/python/exported-sql-viewer.py", line 2791, in ShrinkFont ShrinkFont(win.view) AttributeError: 'HelpWindow' object has no attribute 'view' Committer testing: Before, matches above output: $ python ~acme/libexec/perf-core/scripts/python/exported-sql-viewer.py ~/c/adrian.hunter/simple-retpoline.db Traceback (most recent call last): File "/home/acme/libexec/perf-core/scripts/python/exported-sql-viewer.py", line 2780, in EnlargeFont EnlargeFont(win.view) AttributeError: 'HelpWindow' object has no attribute 'view' $ After: No more tracebacks, but the fonts don't get enlarged, which is kinda frustrating... 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-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
-rwxr-xr-xtools/perf/scripts/python/exported-sql-viewer.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/tools/perf/scripts/python/exported-sql-viewer.py b/tools/perf/scripts/python/exported-sql-viewer.py
index db4655168ab1..fd073e4af8da 100755
--- a/tools/perf/scripts/python/exported-sql-viewer.py
+++ b/tools/perf/scripts/python/exported-sql-viewer.py
@@ -2755,6 +2755,14 @@ class MainWindow(QMainWindow):
2755 help_menu = menu.addMenu("&Help") 2755 help_menu = menu.addMenu("&Help")
2756 help_menu.addAction(CreateAction("&Exported SQL Viewer Help", "Helpful information", self.Help, self, QKeySequence.HelpContents)) 2756 help_menu.addAction(CreateAction("&Exported SQL Viewer Help", "Helpful information", self.Help, self, QKeySequence.HelpContents))
2757 2757
2758 def Try(self, fn):
2759 win = self.mdi_area.activeSubWindow()
2760 if win:
2761 try:
2762 fn(win.view)
2763 except:
2764 pass
2765
2758 def Find(self): 2766 def Find(self):
2759 win = self.mdi_area.activeSubWindow() 2767 win = self.mdi_area.activeSubWindow()
2760 if win: 2768 if win:
@@ -2772,12 +2780,10 @@ class MainWindow(QMainWindow):
2772 pass 2780 pass
2773 2781
2774 def ShrinkFont(self): 2782 def ShrinkFont(self):
2775 win = self.mdi_area.activeSubWindow() 2783 self.Try(ShrinkFont)
2776 ShrinkFont(win.view)
2777 2784
2778 def EnlargeFont(self): 2785 def EnlargeFont(self):
2779 win = self.mdi_area.activeSubWindow() 2786 self.Try(EnlargeFont)
2780 EnlargeFont(win.view)
2781 2787
2782 def EventMenu(self, events, reports_menu): 2788 def EventMenu(self, events, reports_menu):
2783 branches_events = 0 2789 branches_events = 0