History log of /linux-6.15/tools/perf/scripts/python/exported-sql-viewer.py (Results 26 – 50 of 61)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# c6aba1bf 12-Apr-2019 Adrian Hunter <[email protected]>

perf scripts python: exported-sql-viewer.py: Change python2 to python

Now that there is also support for python3, there is no need to specify
python2 explicitly.

Signed-off-by: Adrian Hunter <adria

perf scripts python: exported-sql-viewer.py: Change python2 to python

Now that there is also support for python3, there is no need to specify
python2 explicitly.

Signed-off-by: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

show more ...


# b62d18ab 03-May-2019 Adrian Hunter <[email protected]>

perf scripts python: exported-sql-viewer.py: Add 'About' dialog box

With support for Python 2 or 3 and PySide 1 or 2 (Qt 4 or 5), it is
useful to see what versions are in use. Add an 'About' dialog

perf scripts python: exported-sql-viewer.py: Add 'About' dialog box

With support for Python 2 or 3 and PySide 1 or 2 (Qt 4 or 5), it is
useful to see what versions are in use. Add an 'About' dialog box that
displays Python, PySide, Qt and database server (SQLite or PostgreSQL)
version numbers.

Committer testing:

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

Then go to 'Help', then 'About', select all the lines with the mouse
press 'Control+C', then, on the same terminal press control+shift+V
which shows my current environment:

Python version: 2.7.16
PySide version: 1
Qt version: 4.8.7
SQLite version: 3.26.0

Signed-off-by: Adrian Hunter <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Jiri Olsa <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

show more ...


# 9bc4e4bf 03-May-2019 Adrian Hunter <[email protected]>

perf scripts python: exported-sql-viewer.py: Add context menu

Add a context menu (right-click) that provides options for copying to
clipboard, including, for trees, the ability to copy only the cell

perf scripts python: exported-sql-viewer.py: Add context menu

Add a context menu (right-click) that provides options for copying to
clipboard, including, for trees, the ability to copy only the cell under
the mouse pointer.

Committer testing:

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

Simply right click and pick "Copy selection", that at this point has
just the first line, not expanded, then see what was copied by pressing
shift+control+v on a terminal:

Call Path,Object,Count,Time (ns),Time (%),Branch Count,Branch Count (%)
▶ simple-retpolin,,,,,,

Ditto after expanding, i.e. the selection continues to be just one
line:

Call Path Object Count Time (ns) Time (%) Branch Count Branch Count (%)
▼ simple-retpolin

Now select all the lines with the mouse and control+shift+v again:

Call Path Object Count Time (ns) Time (%) Branch Count Branch Count (%)
▼ 14503:14503
▼ _start ld-2.28.so 1 156267 100.0 10602 100.0
▶ unknown unknown 1 2276 1.5 1 0.0
▶ _dl_start ld-2.28.so 1 137047 87.7 10088 95.2
▶ _dl_init ld-2.28.so 1 9142 5.9 326 3.1
▼ _start simple-retpoline 1 7457 4.8 182 1.7
▶ unknown unknown 1 805 10.8 1 0.5
▶ __libc_start_main libc-2.28.so 1 6347 85.1 179 98.4

Signed-off-by: Adrian Hunter <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Jiri Olsa <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

show more ...


# 96c43b9a 03-May-2019 Adrian Hunter <[email protected]>

perf scripts python: exported-sql-viewer.py: Add copy to clipboard

Add support for copying to clipboard. Two menu options are added to copy the
selected rows / columns with normal spacing, or as com

perf scripts python: exported-sql-viewer.py: Add copy to clipboard

Add support for copying to clipboard. Two menu options are added to copy the
selected rows / columns with normal spacing, or as comma-separated-values.
In the case of trees, only entire rows can be copied.

Comitter testing:

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

Select the lines, press control+C and on the same terminal,
press control+shift+V and voilà:

Call Path Object Count Time (ns) Time (%) Branch Count Branch Count (%)
▼ 14503:14503
▼ _start ld-2.28.so 1 156267 100.0 10602 100.0
unknown unknown 1 2276 1.5 1 0.0
▼ _dl_start ld-2.28.so 1 137047 87.7 10088 95.2
▶ unknown unknown 4 4127 3.0 4 0.0
_dl_setup_hash ld-2.28.so 1 0 0.0 1 0.0
▶ _dl_sysdep_start ld-2.28.so 1 131342 95.8 9981 98.9
▼ _dl_init ld-2.28.so 1 9142 5.9 326 3.1
▼ call_init.part.0 ld-2.28.so 3 9133 99.9 319 97.9
▶ _init libc-2.28.so 1 6877 75.3 110 34.5
▶ check_stdfiles_vtables libc-2.28.so 1 76 0.8 2 0.6
▶ init_cacheinfo libc-2.28.so 1 1991 21.8 197 61.8
▶ _start simple-retpoline 1 7457 4.8 182 1.7

Signed-off-by: Adrian Hunter <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Jiri Olsa <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

show more ...


# 3ac641f4 03-May-2019 Adrian Hunter <[email protected]>

perf scripts python: exported-sql-viewer.py: Add tree level

As preparation for adding support for copying to clipboard, keep track of
what level each item is in tree items.

Signed-off-by: Adrian Hu

perf scripts python: exported-sql-viewer.py: Add tree level

As preparation for adding support for copying to clipboard, keep track of
what level each item is in tree items.

Signed-off-by: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

show more ...


# 4b208453 03-May-2019 Adrian Hunter <[email protected]>

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 l

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 <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Jiri Olsa <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

show more ...


# be6e7471 03-May-2019 Adrian Hunter <[email protected]>

perf scripts python: exported-sql-viewer.py: Move view creation

As preparation for adding support for copying to clipboard, create view
in TreeWindowBase instead of derived classes.

Committer testi

perf scripts python: exported-sql-viewer.py: Move view creation

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 <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Jiri Olsa <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

show more ...


Revision tags: v5.1-rc4, v5.1-rc3
# 606bd60a 27-Mar-2019 Adrian Hunter <[email protected]>

perf scripts python: exported-sql-viewer.py: Fix python3 support

Unlike python2, python3 strings are not compatible with byte strings.
That results in disassembly not working for the branches report

perf scripts python: exported-sql-viewer.py: Fix python3 support

Unlike python2, python3 strings are not compatible with byte strings.
That results in disassembly not working for the branches reports. Fixup
those places overlooked in the port to python3.

Signed-off-by: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]>
Fixes: beda0e725e5f ("perf script python: Add Python3 support to exported-sql-viewer.py")
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

show more ...


# 8453c936 27-Mar-2019 Adrian Hunter <[email protected]>

perf scripts python: exported-sql-viewer.py: Fix never-ending loop

pyside version 1 fails to handle python3 large integers in some cases,
resulting in Qt getting into a never-ending loop. This affec

perf scripts python: exported-sql-viewer.py: Fix never-ending loop

pyside version 1 fails to handle python3 large integers in some cases,
resulting in Qt getting into a never-ending loop. This affects:
samples Table
samples_view Table
All branches Report
Selected branches Report

Add workarounds for those cases.

Signed-off-by: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]>
Fixes: beda0e725e5f ("perf script python: Add Python3 support to exported-sql-viewer.py")
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

show more ...


Revision tags: v5.1-rc2, v5.1-rc1
# beda0e72 09-Mar-2019 Tony Jones <[email protected]>

perf script python: Add Python3 support to exported-sql-viewer.py

Support both Python2 and Python3 in the exported-sql-viewer.py script.

The use of 'from __future__' implies the minimum supported P

perf script python: Add Python3 support to exported-sql-viewer.py

Support both Python2 and Python3 in the exported-sql-viewer.py script.

The use of 'from __future__' implies the minimum supported Python2 version
is now v2.6

Signed-off-by: Tony Jones <[email protected]>
Acked-by: Adrian Hunter <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Seeteena Thoufeek <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

show more ...


Revision tags: v5.0
# ae8b887c 28-Feb-2019 Adrian Hunter <[email protected]>

perf scripts python: exported-sql-viewer.py: Add call tree

Add a new report to display a call tree. The Call Tree report is very
similar to the Context-Sensitive Call Graph, but the data is not
aggr

perf scripts python: exported-sql-viewer.py: Add call tree

Add a new report to display a call tree. The Call Tree report is very
similar to the Context-Sensitive Call Graph, but the data is not
aggregated. Also the 'Count' column, which would be always 1, is replaced
by the 'Call Time'.

Committer testing:

$ cat simple-retpoline.c
/*

https://lkml.kernel.org/r/[email protected]

$ gcc -ggdb3 -Wall -Wextra -O2 -o simple-retpoline simple-retpoline.c
$ objdump -d simple-retpoline
*/

__attribute__((noinline)) int bar(void)
{
return -1;
}

int foo(void)
{
return bar() + 1;
}

__attribute__((indirect_branch("thunk"))) int main()
{
int (*volatile fn)(void) = foo;

fn();
return fn();
}
$
$ perf record -o simple-retpoline.perf.data -e intel_pt/cyc/u ./simple-retpoline
$ perf script -i simple-retpoline.perf.data --itrace=be -s ~acme/libexec/perf-core/scripts/python/export-to-sqlite.py simple-retpoline.db branches calls
$ python ~acme/libexec/perf-core/scripts/python/exported-sql-viewer.py simple-retpoline.db

And in the GUI select:

"Reports"
"Call Tree"

Call Path | Object | Call Time (ns) | Time (ns) | Time (%) | Branch Count | Brach Count (%) |
> simple-retpolin
> PID:TID
> _start ld-2.28.so 2193855505777 156267 100.0 10602 100.0
unknown unknown 2193855506010 2276 1.5 1 0.0
> _dl_start ld-2.28.so 2193855508286 137047 87.7 10088 95.2
> _dl_init ld-2.28.so 2193855645444 9142 5.9 326 3.1
> _start simple-retpoline 2193855654587 7457 4.8 182 1.7
> __libc_start_main <SNIP>
<SNIP>
> main simple-retpoline 2193855657493 32 0.5 12 6.7
> foo simple-retpoline 2193855657493 14 43.8 5 41.7
<SNIP>

Signed-off-by: Adrian Hunter <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Jiri Olsa <[email protected]>
Link: https://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

show more ...


# 254c0d82 28-Feb-2019 Adrian Hunter <[email protected]>

perf scripts python: exported-sql-viewer.py: Factor out CallGraphModelBase

Factor out a base class CallGraphModelBase from CallGraphModel, so that
CallGraphModelBase can be reused.

Signed-off-by: A

perf scripts python: exported-sql-viewer.py: Factor out CallGraphModelBase

Factor out a base class CallGraphModelBase from CallGraphModel, so that
CallGraphModelBase can be reused.

Signed-off-by: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]>
Link: https://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

show more ...


# a448ba23 28-Feb-2019 Adrian Hunter <[email protected]>

perf scripts python: exported-sql-viewer.py: Improve TreeModel abstraction

Instead of passing the tree root, get it from a method that can be
implemented in any derived class.

Signed-off-by: Adrian

perf scripts python: exported-sql-viewer.py: Improve TreeModel abstraction

Instead of passing the tree root, get it from a method that can be
implemented in any derived class.

Signed-off-by: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]>
Link: https://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

show more ...


# a731cc4c 28-Feb-2019 Adrian Hunter <[email protected]>

perf scripts python: exported-sql-viewer.py: Factor out TreeWindowBase

Factor out a base class TreeWindowBase from CallGraphWindow, so that
TreeWindowBase can be reused.

Signed-off-by: Adrian Hunte

perf scripts python: exported-sql-viewer.py: Factor out TreeWindowBase

Factor out a base class TreeWindowBase from CallGraphWindow, so that
TreeWindowBase can be reused.

Signed-off-by: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]>
Link: https://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

show more ...


Revision tags: v5.0-rc8
# cd358012 22-Feb-2019 Adrian Hunter <[email protected]>

perf scripts python: exported-sql-viewer.py: Add top calls report

Add a new report to display top calls by elapsed time. It displays calls
in descending order of time elapsed between when the functi

perf scripts python: exported-sql-viewer.py: Add top calls report

Add a new report to display top calls by elapsed time. It displays calls
in descending order of time elapsed between when the function was called
and when it returned.

Signed-off-by: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

show more ...


# fc2c77aa 22-Feb-2019 Adrian Hunter <[email protected]>

perf scripts python: exported-sql-viewer.py: Remove no selection error

If no selection is made on the 'Selected branches' dialog, then the
output is the same as the 'All branches' report. That is no

perf scripts python: exported-sql-viewer.py: Remove no selection error

If no selection is made on the 'Selected branches' dialog, then the
output is the same as the 'All branches' report. That is not really an
error, and is not desirable for future reports, so remove it.

Signed-off-by: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

show more ...


# 0d5f8f23 22-Feb-2019 Adrian Hunter <[email protected]>

perf scripts python: exported-sql-viewer.py: Remove SQLTableDialogDataItem

Remove SQLTableDialogDataItem as it is no longer used.

Signed-off-by: Adrian Hunter <[email protected]>
Cc: Jiri Ols

perf scripts python: exported-sql-viewer.py: Remove SQLTableDialogDataItem

Remove SQLTableDialogDataItem as it is no longer used.

Signed-off-by: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

show more ...


# 1c3ca1b3 22-Feb-2019 Adrian Hunter <[email protected]>

perf scripts python: exported-sql-viewer.py: Create new dialog data item classes

Create new dialog data item classes to replace SQLTableDialogDataItem.
This separates out different dialog data items

perf scripts python: exported-sql-viewer.py: Create new dialog data item classes

Create new dialog data item classes to replace SQLTableDialogDataItem.
This separates out different dialog data items and makes it easier to
add new ones. SQLTableDialogDataItem is removed in a separate patch
because it makes the diff more readable.

Signed-off-by: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

show more ...


# 947cc38d 22-Feb-2019 Adrian Hunter <[email protected]>

perf scripts python: exported-sql-viewer.py: Move report name into ReportVars

The report name is a report variable so move it into into ReportVars.

Signed-off-by: Adrian Hunter <adrian.hunter@intel

perf scripts python: exported-sql-viewer.py: Move report name into ReportVars

The report name is a report variable so move it into into ReportVars.

Signed-off-by: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

show more ...


# 0bf0947a 22-Feb-2019 Adrian Hunter <[email protected]>

perf scripts python: exported-sql-viewer.py: Factor out ReportVars

Factor out ReportVars to provide a single container for information from
report dialogs.

Signed-off-by: Adrian Hunter <adrian.hunt

perf scripts python: exported-sql-viewer.py: Factor out ReportVars

Factor out ReportVars to provide a single container for information from
report dialogs.

Signed-off-by: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

show more ...


# 0924cd68 22-Feb-2019 Adrian Hunter <[email protected]>

perf scripts python: exported-sql-viewer.py: Factor out ReportDialogBase

Factor out ReportDialogBase so it can be re-used.

Signed-off-by: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <jols

perf scripts python: exported-sql-viewer.py: Factor out ReportDialogBase

Factor out ReportDialogBase so it can be re-used.

Signed-off-by: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

show more ...


# 8c90fef9 22-Feb-2019 Adrian Hunter <[email protected]>

perf scripts python: exported-sql-viewer.py: Move column headers

Move column headers from SQLAutoTableModel into SQLTableModel so that
they can be used for other models based on SQLTableModel.

Sign

perf scripts python: exported-sql-viewer.py: Move column headers

Move column headers from SQLAutoTableModel into SQLTableModel so that
they can be used for other models based on SQLTableModel.

Signed-off-by: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

show more ...


# 655cb952 22-Feb-2019 Adrian Hunter <[email protected]>

perf scripts python: exported-sql-viewer.py: Hide Call Graph option if no calls table

The Call Graph depends on the calls table which is optional when exporting
data, so hide the Call Graph option i

perf scripts python: exported-sql-viewer.py: Hide Call Graph option if no calls table

The Call Graph depends on the calls table which is optional when exporting
data, so hide the Call Graph option if there is no calls table.

Signed-off-by: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

show more ...


# df8794fe 22-Feb-2019 Adrian Hunter <[email protected]>

perf scripts python: exported-sql-viewer.py: Remove leftover debugging prints

Remove leftover debugging prints.

Signed-off-by: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]

perf scripts python: exported-sql-viewer.py: Remove leftover debugging prints

Remove leftover debugging prints.

Signed-off-by: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

show more ...


# b3a67546 22-Feb-2019 Adrian Hunter <[email protected]>

perf scripts python: exported-sql-viewer.py: Fix missing shebang

exported-sql-viewer.py is a standalone python script and requires a
shebang. Also only python2 is supported at present. Restore the s

perf scripts python: exported-sql-viewer.py: Fix missing shebang

exported-sql-viewer.py is a standalone python script and requires a
shebang. Also only python2 is supported at present. Restore the shebang
but use the more flexible 'env' form.

Signed-off-by: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: [email protected]
Fixes: a38352de4495 ("perf script python: Remove explicit shebang from Python script")
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

show more ...


123