341e73cb | 01-Oct-2018 |
Adrian Hunter <adrian.hunter@intel.com> |
perf scripts python: call-graph-from-sql.py: Refactor TreeItem class
class TreeItem represents items at all levels of the call-graph tree. However, not all the levels represent the same data i.e. th
perf scripts python: call-graph-from-sql.py: Refactor TreeItem class
class TreeItem represents items at all levels of the call-graph tree. However, not all the levels represent the same data i.e. the top-level is comms, the next level is threads, and subsequent levels are functions. Consequently it is simpler to have separate classes for different levels with commonality in a base class. Refactor TreeItem class accordingly.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lkml.kernel.org/r/20181001062853.28285-12-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
show more ...
|
70d831e8 | 01-Oct-2018 |
Adrian Hunter <adrian.hunter@intel.com> |
perf scripts python: call-graph-from-sql.py: Factor out CallGraphModel from TreeModel
Factor out CallGraphModel from TreeModel, which paves the way to reuse TreeModel in future reports.
Signed-off-
perf scripts python: call-graph-from-sql.py: Factor out CallGraphModel from TreeModel
Factor out CallGraphModel from TreeModel, which paves the way to reuse TreeModel in future reports.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lkml.kernel.org/r/20181001062853.28285-10-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
show more ...
|
e99ef814 | 01-Oct-2018 |
Adrian Hunter <adrian.hunter@intel.com> |
perf scripts python: call-graph-from-sql.py: Remove use of setObjectName()
The object name is never used, so don't bother setting it.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi
perf scripts python: call-graph-from-sql.py: Remove use of setObjectName()
The object name is never used, so don't bother setting it.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lkml.kernel.org/r/20181001062853.28285-9-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
show more ...
|
5f9dfef1 | 01-Oct-2018 |
Adrian Hunter <adrian.hunter@intel.com> |
perf scripts python: call-graph-from-sql.py: Add a class for global data
Keep global data in a single object that is easy to pass around as needed, without polluting the global namespace.
Signed-of
perf scripts python: call-graph-from-sql.py: Add a class for global data
Keep global data in a single object that is easy to pass around as needed, without polluting the global namespace.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lkml.kernel.org/r/20181001062853.28285-8-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
show more ...
|
99a097c9 | 01-Oct-2018 |
Adrian Hunter <adrian.hunter@intel.com> |
perf scripts python: call-graph-from-sql.py: Change icon
There are not many standard icons, but the computer icon looks slightly better than the information icon.
Committer testing:
Noticed the ch
perf scripts python: call-graph-from-sql.py: Change icon
There are not many standard icons, but the computer icon looks slightly better than the information icon.
Committer testing:
Noticed the change on the icon on the gnome menu right next to the "Activities" menu, looks nicer indeed.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lkml.kernel.org/r/20181001062853.28285-5-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
show more ...
|
3c4ef451 | 01-Oct-2018 |
Adrian Hunter <adrian.hunter@intel.com> |
perf scripts python: call-graph-from-sql.py: Set a minimum window size
Prevent weirdly small window size.
Committer testing:
Seems to work, but even before this patch, on my system, it always star
perf scripts python: call-graph-from-sql.py: Set a minimum window size
Prevent weirdly small window size.
Committer testing:
Seems to work, but even before this patch, on my system, it always started with:
xwininfo: Window id: 0x1e00002 "Call Graph: pt_example" <SNIP> Width: 800 Height: 600 <SNIP>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lkml.kernel.org/r/20181001062853.28285-4-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
show more ...
|
1d865c06 | 01-Oct-2018 |
Adrian Hunter <adrian.hunter@intel.com> |
perf scripts python: call-graph-from-sql.py: Provide better default column sizes
Set initial column sizes to improve initial display.
Committer testing:
Extended instructions on testing this, usin
perf scripts python: call-graph-from-sql.py: Provide better default column sizes
Set initial column sizes to improve initial display.
Committer testing:
Extended instructions on testing this, using the sqlite variant:
Make sure you have the SQLite glue for python+Qt installed, on fedora 27 I used:
# dnf install python-pyside
Collect some PT samples, say 5-secs worth, system wide:
# perf record -r 10 -e intel_pt//u -a sleep 5 [ perf record: Woken up 49 times to write data ] [ perf record: Captured and wrote 96.131 MB perf.data ]
This results in this perf.data file:
# ls -larth perf.data -rw-------. 1 root root 97M Oct 23 10:11 perf.data
With the following attributes:
# perf evlist -v intel_pt//u: type: 8, size: 112, config: 0x300e601, { sample_period, sample_freq }: 1, sample_type: IP|TID|TIME|CPU|IDENTIFIER, read_format: ID, disabled: 1, inherit: 1, exclude_kernel: 1, exclude_hv: 1, sample_id_all: 1 dummy:u: type: 1, size: 112, config: 0x9, { sample_period, sample_freq }: 1, sample_type: IP|TID|TIME|CPU|IDENTIFIER, read_format: ID, inherit: 1, exclude_kernel: 1, exclude_hv: 1, mmap: 1, comm: 1, task: 1, sample_id_all: 1, mmap2: 1, comm_exec: 1, context_switch: 1 #
Then generate the "pt_example" tables using:
# perf script -s ~/libexec/perf-core/scripts/python/export-to-sqlite.py pt_example branches calls 2018-10-23 10:56:59.177711 Creating database... 2018-10-23 10:56:59.195842 Writing records... instruction trace error type 1 cpu 2 pid 1644 tid 1644 ip 0x263984516750 code 5: Failed to get instruction instruction trace error type 1 cpu 2 pid 1644 tid 1644 ip 0x7f26e116fd20 code 6: Trace doesn't match instruction instruction trace error type 1 cpu 2 pid 1644 tid 1644 ip 0x7f26e162c9ee code 6: Trace doesn't match instruction instruction trace error type 1 cpu 2 pid 1644 tid 1644 ip 0x7f26e9ce831a code 6: Trace doesn't match instruction <SNIP> instruction trace error type 1 cpu 0 pid 1644 tid 1644 ip 0x7f26e13d07b4 code 6: Trace doesn't match instruction Warning: 132 instruction trace errors 2018-10-23 11:25:25.015717 Adding indexes 2018-10-23 11:25:28.788061 Done #
In my example, that perf.data file generated this db:
# file pt_example pt_example: SQLite 3.x database, last written using SQLite version 3020001 [root@seventh perf]# ls -lah pt_example -rw-r--r--. 1 root root 6.6G Oct 23 11:25 pt_example #
Then use this python script to use that db and provide a GUI:
$ python tools/perf/scripts/python/call-graph-from-sql.py pt_example branches calls
I compared the column widths before this patch and after applying it, the visual results match the patch intent.
The following patches will refer to this set of instructions in the "Committer Testing" section.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lkml.kernel.org/r/20181001062853.28285-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
show more ...
|
d005efe1 | 11-Sep-2018 |
Adrian Hunter <adrian.hunter@intel.com> |
perf script python: Fix export-to-sqlite.py sample columns
With the "branches" export option, not all sample columns are exported. However the unwanted columns are not at the end of the tuple, as as
perf script python: Fix export-to-sqlite.py sample columns
With the "branches" export option, not all sample columns are exported. However the unwanted columns are not at the end of the tuple, as assumed by the code. Fix by taking the first 15 and last 3 values, instead of the first 18.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: stable@vger.kernel.org Link: http://lkml.kernel.org/r/20180911114504.28516-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
show more ...
|
1fe03b5f | 03-Aug-2017 |
Adrian Hunter <adrian.hunter@intel.com> |
perf script python: Add support for sqlite3 to call-graph-from-sql.py
Add support for SQLite 3 to the call-graph-from-sql.py script. The SQL statements work as is, so just detect the database type b
perf script python: Add support for sqlite3 to call-graph-from-sql.py
Add support for SQLite 3 to the call-graph-from-sql.py script. The SQL statements work as is, so just detect the database type by checking if the SQLite 3 file exists.
Committer notes:
Tested collecting the PT data on a RHEL7.4, generating the SQLite3 database there and then moving it to a Fedora 26 system where the call-graph-from-sql.py script was run, using python-pyside version 1.2.2-7fc26 to see the callgraphs using Qt4.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Link: http://lkml.kernel.org/r/1501749090-20357-6-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
show more ...
|