diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2019-05-06 06:04:12 -0400 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2019-05-06 06:04:12 -0400 |
| commit | fb4e0592654adb31bc6f3a738d6499b816a655d6 (patch) | |
| tree | e6edaf18cf3a7f49e93fb51de5a47f4b9e786f53 /tools/perf/scripts/python | |
| parent | 471ba0e686cb13752bc1ff3216c54b69a2d250ea (diff) | |
| parent | 16e32c3cde7763ab875b9030b443ecbc8e352d8a (diff) | |
Merge tag 'irqchip-5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/core
Pull irqchip updates from Marc Zyngier
- The huge (and terrifying) TI INTR/INTA set of drivers
- Rewrite of the stm32mp1-exti driver as a platform driver
- Update the IOMMU MSI mapping API to be RT friendly
- A number of cleanups and other low impact fixes
Diffstat (limited to 'tools/perf/scripts/python')
| -rwxr-xr-x | tools/perf/scripts/python/exported-sql-viewer.py | 77 |
1 files changed, 63 insertions, 14 deletions
diff --git a/tools/perf/scripts/python/exported-sql-viewer.py b/tools/perf/scripts/python/exported-sql-viewer.py index e38518cdcbc3..74ef92f1d19a 100755 --- a/tools/perf/scripts/python/exported-sql-viewer.py +++ b/tools/perf/scripts/python/exported-sql-viewer.py | |||
| @@ -107,6 +107,7 @@ import os | |||
| 107 | from PySide.QtCore import * | 107 | from PySide.QtCore import * |
| 108 | from PySide.QtGui import * | 108 | from PySide.QtGui import * |
| 109 | from PySide.QtSql import * | 109 | from PySide.QtSql import * |
| 110 | pyside_version_1 = True | ||
| 110 | from decimal import * | 111 | from decimal import * |
| 111 | from ctypes import * | 112 | from ctypes import * |
| 112 | from multiprocessing import Process, Array, Value, Event | 113 | from multiprocessing import Process, Array, Value, Event |
| @@ -1526,6 +1527,19 @@ def BranchDataPrep(query): | |||
| 1526 | " (" + dsoname(query.value(15)) + ")") | 1527 | " (" + dsoname(query.value(15)) + ")") |
| 1527 | return data | 1528 | return data |
| 1528 | 1529 | ||
| 1530 | def BranchDataPrepWA(query): | ||
| 1531 | data = [] | ||
| 1532 | data.append(query.value(0)) | ||
| 1533 | # Workaround pyside failing to handle large integers (i.e. time) in python3 by converting to a string | ||
| 1534 | data.append("{:>19}".format(query.value(1))) | ||
| 1535 | for i in xrange(2, 8): | ||
| 1536 | data.append(query.value(i)) | ||
| 1537 | data.append(tohex(query.value(8)).rjust(16) + " " + query.value(9) + offstr(query.value(10)) + | ||
| 1538 | " (" + dsoname(query.value(11)) + ")" + " -> " + | ||
| 1539 | tohex(query.value(12)) + " " + query.value(13) + offstr(query.value(14)) + | ||
| 1540 | " (" + dsoname(query.value(15)) + ")") | ||
| 1541 | return data | ||
| 1542 | |||
| 1529 | # Branch data model | 1543 | # Branch data model |
| 1530 | 1544 | ||
| 1531 | class BranchModel(TreeModel): | 1545 | class BranchModel(TreeModel): |
| @@ -1553,7 +1567,11 @@ class BranchModel(TreeModel): | |||
| 1553 | " AND evsel_id = " + str(self.event_id) + | 1567 | " AND evsel_id = " + str(self.event_id) + |
| 1554 | " ORDER BY samples.id" | 1568 | " ORDER BY samples.id" |
| 1555 | " LIMIT " + str(glb_chunk_sz)) | 1569 | " LIMIT " + str(glb_chunk_sz)) |
| 1556 | self.fetcher = SQLFetcher(glb, sql, BranchDataPrep, self.AddSample) | 1570 | if pyside_version_1 and sys.version_info[0] == 3: |
| 1571 | prep = BranchDataPrepWA | ||
| 1572 | else: | ||
| 1573 | prep = BranchDataPrep | ||
| 1574 | self.fetcher = SQLFetcher(glb, sql, prep, self.AddSample) | ||
| 1557 | self.fetcher.done.connect(self.Update) | 1575 | self.fetcher.done.connect(self.Update) |
| 1558 | self.fetcher.Fetch(glb_chunk_sz) | 1576 | self.fetcher.Fetch(glb_chunk_sz) |
| 1559 | 1577 | ||
| @@ -2079,14 +2097,6 @@ def IsSelectable(db, table, sql = ""): | |||
| 2079 | return False | 2097 | return False |
| 2080 | return True | 2098 | return True |
| 2081 | 2099 | ||
| 2082 | # SQL data preparation | ||
| 2083 | |||
| 2084 | def SQLTableDataPrep(query, count): | ||
| 2085 | data = [] | ||
| 2086 | for i in xrange(count): | ||
| 2087 | data.append(query.value(i)) | ||
| 2088 | return data | ||
| 2089 | |||
| 2090 | # SQL table data model item | 2100 | # SQL table data model item |
| 2091 | 2101 | ||
| 2092 | class SQLTableItem(): | 2102 | class SQLTableItem(): |
| @@ -2110,7 +2120,7 @@ class SQLTableModel(TableModel): | |||
| 2110 | self.more = True | 2120 | self.more = True |
| 2111 | self.populated = 0 | 2121 | self.populated = 0 |
| 2112 | self.column_headers = column_headers | 2122 | self.column_headers = column_headers |
| 2113 | self.fetcher = SQLFetcher(glb, sql, lambda x, y=len(column_headers): SQLTableDataPrep(x, y), self.AddSample) | 2123 | self.fetcher = SQLFetcher(glb, sql, lambda x, y=len(column_headers): self.SQLTableDataPrep(x, y), self.AddSample) |
| 2114 | self.fetcher.done.connect(self.Update) | 2124 | self.fetcher.done.connect(self.Update) |
| 2115 | self.fetcher.Fetch(glb_chunk_sz) | 2125 | self.fetcher.Fetch(glb_chunk_sz) |
| 2116 | 2126 | ||
| @@ -2154,6 +2164,12 @@ class SQLTableModel(TableModel): | |||
| 2154 | def columnHeader(self, column): | 2164 | def columnHeader(self, column): |
| 2155 | return self.column_headers[column] | 2165 | return self.column_headers[column] |
| 2156 | 2166 | ||
| 2167 | def SQLTableDataPrep(self, query, count): | ||
| 2168 | data = [] | ||
| 2169 | for i in xrange(count): | ||
| 2170 | data.append(query.value(i)) | ||
| 2171 | return data | ||
| 2172 | |||
| 2157 | # SQL automatic table data model | 2173 | # SQL automatic table data model |
| 2158 | 2174 | ||
| 2159 | class SQLAutoTableModel(SQLTableModel): | 2175 | class SQLAutoTableModel(SQLTableModel): |
| @@ -2182,8 +2198,32 @@ class SQLAutoTableModel(SQLTableModel): | |||
| 2182 | QueryExec(query, "SELECT column_name FROM information_schema.columns WHERE table_schema = '" + schema + "' and table_name = '" + select_table_name + "'") | 2198 | QueryExec(query, "SELECT column_name FROM information_schema.columns WHERE table_schema = '" + schema + "' and table_name = '" + select_table_name + "'") |
| 2183 | while query.next(): | 2199 | while query.next(): |
| 2184 | column_headers.append(query.value(0)) | 2200 | column_headers.append(query.value(0)) |
| 2201 | if pyside_version_1 and sys.version_info[0] == 3: | ||
| 2202 | if table_name == "samples_view": | ||
| 2203 | self.SQLTableDataPrep = self.samples_view_DataPrep | ||
| 2204 | if table_name == "samples": | ||
| 2205 | self.SQLTableDataPrep = self.samples_DataPrep | ||
| 2185 | super(SQLAutoTableModel, self).__init__(glb, sql, column_headers, parent) | 2206 | super(SQLAutoTableModel, self).__init__(glb, sql, column_headers, parent) |
| 2186 | 2207 | ||
| 2208 | def samples_view_DataPrep(self, query, count): | ||
| 2209 | data = [] | ||
| 2210 | data.append(query.value(0)) | ||
| 2211 | # Workaround pyside failing to handle large integers (i.e. time) in python3 by converting to a string | ||
| 2212 | data.append("{:>19}".format(query.value(1))) | ||
| 2213 | for i in xrange(2, count): | ||
| 2214 | data.append(query.value(i)) | ||
| 2215 | return data | ||
| 2216 | |||
| 2217 | def samples_DataPrep(self, query, count): | ||
| 2218 | data = [] | ||
| 2219 | for i in xrange(9): | ||
| 2220 | data.append(query.value(i)) | ||
| 2221 | # Workaround pyside failing to handle large integers (i.e. time) in python3 by converting to a string | ||
| 2222 | data.append("{:>19}".format(query.value(9))) | ||
| 2223 | for i in xrange(10, count): | ||
| 2224 | data.append(query.value(i)) | ||
| 2225 | return data | ||
| 2226 | |||
| 2187 | # Base class for custom ResizeColumnsToContents | 2227 | # Base class for custom ResizeColumnsToContents |
| 2188 | 2228 | ||
| 2189 | class ResizeColumnsToContentsBase(QObject): | 2229 | class ResizeColumnsToContentsBase(QObject): |
| @@ -2868,9 +2908,13 @@ class LibXED(): | |||
| 2868 | ok = self.xed_format_context(2, inst.xedp, inst.bufferp, sizeof(inst.buffer), ip, 0, 0) | 2908 | ok = self.xed_format_context(2, inst.xedp, inst.bufferp, sizeof(inst.buffer), ip, 0, 0) |
| 2869 | if not ok: | 2909 | if not ok: |
| 2870 | return 0, "" | 2910 | return 0, "" |
| 2911 | if sys.version_info[0] == 2: | ||
| 2912 | result = inst.buffer.value | ||
| 2913 | else: | ||
| 2914 | result = inst.buffer.value.decode() | ||
| 2871 | # Return instruction length and the disassembled instruction text | 2915 | # Return instruction length and the disassembled instruction text |
| 2872 | # For now, assume the length is in byte 166 | 2916 | # For now, assume the length is in byte 166 |
| 2873 | return inst.xedd[166], inst.buffer.value | 2917 | return inst.xedd[166], result |
| 2874 | 2918 | ||
| 2875 | def TryOpen(file_name): | 2919 | def TryOpen(file_name): |
| 2876 | try: | 2920 | try: |
| @@ -2886,9 +2930,14 @@ def Is64Bit(f): | |||
| 2886 | header = f.read(7) | 2930 | header = f.read(7) |
| 2887 | f.seek(pos) | 2931 | f.seek(pos) |
| 2888 | magic = header[0:4] | 2932 | magic = header[0:4] |
| 2889 | eclass = ord(header[4]) | 2933 | if sys.version_info[0] == 2: |
| 2890 | encoding = ord(header[5]) | 2934 | eclass = ord(header[4]) |
| 2891 | version = ord(header[6]) | 2935 | encoding = ord(header[5]) |
| 2936 | version = ord(header[6]) | ||
| 2937 | else: | ||
| 2938 | eclass = header[4] | ||
| 2939 | encoding = header[5] | ||
| 2940 | version = header[6] | ||
| 2892 | if magic == chr(127) + "ELF" and eclass > 0 and eclass < 3 and encoding > 0 and encoding < 3 and version == 1: | 2941 | if magic == chr(127) + "ELF" and eclass > 0 and eclass < 3 and encoding > 0 and encoding < 3 and version == 1: |
| 2893 | result = True if eclass == 2 else False | 2942 | result = True if eclass == 2 else False |
| 2894 | return result | 2943 | return result |
