pyside2 is the future for pyside support. Note pyside use Qt4 whereas pyside2 uses Qt5.
Showing the changes to tools/perf/scripts/python (1 of 1 file). Show all
Unified · Split
| @@ -21,6 +21,26 @@ import datetime · 20 unmodified lines | ||
| 21 | 21 | # provides LGPL-licensed Python bindings for Qt. You will also need the package |
| 22 | 22 | # libqt4-sql-sqlite for Qt sqlite3 support. |
| 23 | 23 | # |
| 24 | +# Examples of installing pyside: | |
| 25 | +# | |
| 26 | +# ubuntu: | |
| 27 | +# | |
| 28 | +# $ sudo apt-get install python-pyside.qtsql libqt4-sql-psql | |
| 29 | +# | |
| 30 | +# Alternately, to use Python3 and/or pyside 2, one of the following: | |
| 31 | +# | |
| 32 | +# $ sudo apt-get install python3-pyside.qtsql libqt4-sql-psql | |
| 33 | +# $ sudo apt-get install python-pyside2.qtsql libqt5sql5-psql | |
| 34 | +# $ sudo apt-get install python3-pyside2.qtsql libqt5sql5-psql | |
| 35 | +# fedora: | |
| 36 | +# | |
| 37 | +# $ sudo yum install python-pyside | |
| 38 | +# | |
| 39 | +# Alternately, to use Python3 and/or pyside 2, one of the following: | |
| 40 | +# $ sudo yum install python3-pyside | |
| 41 | +# $ pip install --user PySide2 | |
| 42 | +# $ pip3 install --user PySide2 | |
| 43 | +# | |
| 24 | 44 | # An example of using this script with Intel PT: |
| 25 | 45 | # |
| 26 | 46 | # $ perf record -e intel_pt//u ls |
| @@ -49,7 +69,16 @@ import datetime · 22 unmodified lines | ||
| 49 | 69 | # difference is the 'transaction' column of the 'samples' table which is |
| 50 | 70 | # renamed 'transaction_' in sqlite because 'transaction' is a reserved word. |
| 51 | 71 | |
| 52 | −from PySide.QtSql import * | |
| 72 | +pyside_version_1 = True | |
| 73 | +if not "pyside-version-1" in sys.argv: | |
| 74 | + try: | |
| 75 | + from PySide2.QtSql import * | |
| 76 | + pyside_version_1 = False | |
| 77 | + except: | |
| 78 | + pass | |
| 79 | + | |
| 80 | +if pyside_version_1: | |
| 81 | + from PySide.QtSql import * | |
| 53 | 82 | |
| 54 | 83 | sys.path.append(os.environ['PERF_EXEC_PATH'] + \ |
| 55 | 84 | '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') |
| @@ -69,11 +98,12 @@ def printdate(*args, **kw_args): · 13 unmodified lines | ||
| 69 | 98 | print(datetime.datetime.today(), *args, sep=' ', **kw_args) |
| 70 | 99 | |
| 71 | 100 | def usage(): |
| 72 | − printerr("Usage is: export-to-sqlite.py <database name> [<columns>] [<calls>] [<callchains>]"); | |
| 73 | − printerr("where: columns 'all' or 'branches'"); | |
| 74 | − printerr(" calls 'calls' => create calls and call_paths table"); | |
| 75 | − printerr(" callchains 'callchains' => create call_paths table"); | |
| 76 | − raise Exception("Too few arguments") | |
| 101 | + printerr("Usage is: export-to-sqlite.py <database name> [<columns>] [<calls>] [<callchains>] [<pyside-version-1>]"); | |
| 102 | + printerr("where: columns 'all' or 'branches'"); | |
| 103 | + printerr(" calls 'calls' => create calls and call_paths table"); | |
| 104 | + printerr(" callchains 'callchains' => create call_paths table"); | |
| 105 | + printerr(" pyside-version-1 'pyside-version-1' => use pyside version 1"); | |
| 106 | + raise Exception("Too few or bad arguments") | |
| 77 | 107 | |
| 78 | 108 | if (len(sys.argv) < 2): |
| 79 | 109 | usage() |
| @@ -95,6 +125,8 @@ for i in range(3,len(sys.argv)): · 15 unmodified lines | ||
| 95 | 125 | perf_db_export_calls = True |
| 96 | 126 | elif (sys.argv[i] == "callchains"): |
| 97 | 127 | perf_db_export_callchains = True |
| 128 | + elif (sys.argv[i] == "pyside-version-1"): | |
| 129 | + pass | |
| 98 | 130 | else: |
| 99 | 131 | usage() |
| 100 | 132 | |