Re: [PATCH 7/8] tools, perf: Make srcline output address with -v

From: Jiri Olsa
Date: Mon Oct 20 2014 - 14:20:30 EST


On Fri, Sep 26, 2014 at 04:37:15PM -0700, Andi Kleen wrote:
> From: Andi Kleen <ak@xxxxxxxxxxxxxxx>
>
> When -v is specified always print the hex address for the srcline.

I wasn't able to trigger this kind of output..

could you please update the changelog with the output change
and state the scenario when this is visible?


>
> Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>
> ---
> tools/perf/util/srcline.c | 18 +++++++++++++++---
> 1 file changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c
> index 36a7aff..a22be7c 100644
> --- a/tools/perf/util/srcline.c
> +++ b/tools/perf/util/srcline.c
> @@ -258,6 +258,12 @@ char *get_srcline(struct dso *dso, unsigned long addr, struct symbol *sym,
> unsigned line = 0;
> char *srcline;
> const char *dso_name;
> + char astr[50];
> +
> + if (verbose)
> + snprintf(astr, sizeof astr, " %#lx", addr);

WARNING: sizeof astr should be sizeof(astr)

thanks,
jirka
--
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/