diff options
Diffstat (limited to 'tools/perf/scripts/python')
| -rwxr-xr-x | tools/perf/scripts/python/exported-sql-viewer.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/perf/scripts/python/exported-sql-viewer.py b/tools/perf/scripts/python/exported-sql-viewer.py index c20b510ace8f..58a95241ff70 100755 --- a/tools/perf/scripts/python/exported-sql-viewer.py +++ b/tools/perf/scripts/python/exported-sql-viewer.py | |||
| @@ -1786,6 +1786,16 @@ def GetEventList(db): | |||
| 1786 | events.append(query.value(0)) | 1786 | events.append(query.value(0)) |
| 1787 | return events | 1787 | return events |
| 1788 | 1788 | ||
| 1789 | # Is a table selectable | ||
| 1790 | |||
| 1791 | def IsSelectable(db, table): | ||
| 1792 | query = QSqlQuery(db) | ||
| 1793 | try: | ||
| 1794 | QueryExec(query, "SELECT * FROM " + table + " LIMIT 1") | ||
| 1795 | except: | ||
| 1796 | return False | ||
| 1797 | return True | ||
| 1798 | |||
| 1789 | # SQL data preparation | 1799 | # SQL data preparation |
| 1790 | 1800 | ||
| 1791 | def SQLTableDataPrep(query, count): | 1801 | def SQLTableDataPrep(query, count): |
| @@ -2298,7 +2308,8 @@ class MainWindow(QMainWindow): | |||
| 2298 | edit_menu.addAction(CreateAction("&Enlarge Font", "Make text bigger", self.EnlargeFont, self, [QKeySequence("Ctrl++")])) | 2308 | edit_menu.addAction(CreateAction("&Enlarge Font", "Make text bigger", self.EnlargeFont, self, [QKeySequence("Ctrl++")])) |
| 2299 | 2309 | ||
| 2300 | reports_menu = menu.addMenu("&Reports") | 2310 | reports_menu = menu.addMenu("&Reports") |
| 2301 | reports_menu.addAction(CreateAction("Context-Sensitive Call &Graph", "Create a new window containing a context-sensitive call graph", self.NewCallGraph, self)) | 2311 | if IsSelectable(glb.db, "calls"): |
| 2312 | reports_menu.addAction(CreateAction("Context-Sensitive Call &Graph", "Create a new window containing a context-sensitive call graph", self.NewCallGraph, self)) | ||
| 2302 | 2313 | ||
| 2303 | self.EventMenu(GetEventList(glb.db), reports_menu) | 2314 | self.EventMenu(GetEventList(glb.db), reports_menu) |
| 2304 | 2315 | ||
