Re: [PATCH RFC V2 3/3] perf script: Add callindent option

From: Andi Kleen
Date: Mon Jun 20 2016 - 19:54:29 EST


On Fri, Jun 17, 2016 at 11:22:56AM +0300, Adrian Hunter wrote:
> Based on patches from Andi Kleen.
>
> When printing PT instruction traces with perf script it is rather useful to
> see some indentation for the call tree. This patch adds a new callindent
> field to perf script that prints spaces for the function call stack depth.
>
> We already have code to track the function call stack for PT, that we can
> reuse with minor modifications.
>
> The resulting output is not quite as nice as ftrace yet, but a lot better
> than what was there before.
>
> Note there are some corner cases when the thread stack gets code confused
> and prints incorrect indentation. Even with that it is fairly useful.
>
> When displaying kernel code traces it is recommended to run as root, as
> otherwise perf doesn't understand the kernel addresses properly, and may
> not reset the call stack correctly on kernel boundaries.

I still would prefer to have call returns as event names instead of branches,
and not implicitly in the output, mainly so that it can be disabled if needed,
and give easier to read output.

The rest of the patch looks good to me. Perhaps you could just drop
the prefix for now.

-Andi