Adrian Hunter
ae8b887c00
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/20190109091835.5570-6-adrian.hunter@intel.com
$ 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 <adrian.hunter@intel.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: https://lkml.kernel.org/n/tip-enf0w96gqzfpv4fi16pw9ovc@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2019-03-01 15:04:16 -03:00
..
2018-10-26 16:26:32 -07:00
2019-01-19 05:55:42 +12:00
2019-01-28 23:59:46 +01:00
2019-02-14 15:39:21 -03:00
2018-12-07 14:15:00 +08:00
2018-11-11 12:58:27 -08:00
2018-12-28 16:33:08 -03:00
2018-11-11 12:58:27 -08:00
2019-01-12 18:17:56 +00:00
2019-02-28 08:27:17 +01:00
2018-11-27 12:53:44 +01:00
2019-02-28 16:06:47 -03:00
2018-10-02 10:28:04 +02:00
2018-11-20 18:59:00 +01:00
2018-10-03 11:19:52 +01:00
2019-03-01 15:04:16 -03:00
2019-01-03 14:05:16 +01:00
2018-09-04 17:00:37 +01:00
2019-02-23 18:34:20 -08:00
2019-01-04 12:54:49 -03:00
2018-10-18 19:44:39 +02:00
2018-12-19 18:23:49 -05:00
2019-01-08 17:15:11 -08:00
2018-11-11 12:58:27 -08:00