Re: [PATCH 13/16] perf callchain: Switch default to 'graph,0.5,caller'

From: Brendan Gregg
Date: Fri Oct 09 2015 - 16:34:57 EST


On Mon, Oct 5, 2015 at 2:03 PM, Arnaldo Carvalho de Melo
<acme@xxxxxxxxxx> wrote:
>
> From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
>
> Which is the most common default found in other similar tools.


Interactive tools, sure, like the perf report TUI.

But this also changes the ordering of the non-interactive tools which
dump stacks: "perf report -n --stdio" and "perf script". The most
common default for dumping stacks is caller. Eg:

# perf report -n --stdio
[...]
16.87% 334 iperf [kernel.kallsyms] [k]
copy_user_enhanced_fast_string
|
--- 0x7f0683ba1ccd
system_call_fastpath
sys_write
vfs_write
do_sync_write
sock_aio_write
do_sock_write.isra.10
inet_sendmsg
copy_user_enhanced_fast_string
[...]

That's upside down. The current default preserves ordering from the
informational line onwards:

# perf report -n --stdio -g fractal,0.5,callee
[...]
16.87% 334 iperf [kernel.kallsyms] [k]
copy_user_enhanced_fast_string
|
--- copy_user_enhanced_fast_string
|
|--64.37%-- inet_sendmsg
| do_sock_write.isra.10
| sock_aio_write
| do_sync_write
| vfs_write
| sys_write
| system_call_fastpath
| 0x7f0683ba1ccd

... Those are just short examples. Another profile I'm working on now
gets really messy on "perf report -n --stdio"; eg:

perf report -n --stdio -g graph,0.5,caller
94.80% 0.10% 2 iperf [kernel.vmlinux] [k]
entry_SYSCALL_64_fastpath
|
|--94.70%-- entry_SYSCALL_64_fastpath
| |
| |--55.76%-- sys_write
| | |
| | |--55.10%-- vfs_write
| | | |
| | | |--54.39%-- __vfs_write
| | | | |
| | | | --54.34%--
sock_write_iter
| | | | |
| | | |
|--54.19%-- sock_sendmsg
| | | |
| |
| | | |
| |--53.99%-- inet_sendmsg
| | | |
| | |
| | | |
| | |--53.08%-- tcp_sendmsg
| | | |
| | | |
| | | |
| | | |--17.27%--
copy_user_enhanced_fast_string
| | | |
| | | |
| | | |
| | | |--11.41%-- tcp_push_one
| | | |
| | | | |
| | | |
| | | | |--11.31%-- tcp_write_xmit
| | | |
| | | | | |
| | | |
| | | | | |--10.00%--
tcp_transmit_skb
| | | |
| | | | | | |
| | | |
| | | | | |
|--9.29%-- ip_queue_xmit
| | | |
| | | | | | |
|
| | | |
| | | | | | |
|--8.69%-- ip_local_out_sk
| | | |
| | | | | | |
| |
| | | |
| | | | | | |
| |--8.64%-- ip_output
| | | |
| | | | | | |
| | ip_finish_output
| | | |
| | | | | | |
| | |
| | | |
| | | | | | |
| | |--8.43%-- ip_finish_output2
| | | |
| | | | | | |
| | | |
| | | |
| | | | | | |
| | | |--6.97%-- __local_bh_enable_ip
| | | |
| | | | | | |
| | | | |
| | | |
| | | | | | |
| | | | |--6.82%--
do_softirq
| | | |
| | | | | | |
| | | | | |
| | | |
| | | | | | |
| | | | |
--6.77%-- do_softirq_own_stack
| | | |
| | | | | | |
| | | | |
|
| | | |
| | | | | | |
| | | | |
|--6.46%-- __do_softirq
[...]

The current default never gets beyond 5 levels deep. The new default
goes to 25 levels. At least with perf report I can override the
default using "-g". perf script doesn't support that.

Can this patch please preserve the callee ordering for non-interactive
output? (perf script, perf report -n --stdio). Thanks,

Brendan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/