[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170507144538.GA12933@krava>
Date: Sun, 7 May 2017 16:45:38 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Andi Kleen <andi@...stfloor.org>
Cc: acme@...nel.org, jolsa@...nel.org, linux-kernel@...r.kernel.org,
Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH] perf, tools: Support srccode output
On Fri, May 05, 2017 at 04:00:29PM -0700, Andi Kleen wrote:
SNIP
>
> +int map__fprintf_srccode(struct map *map, u64 addr,
> + const char *prefix, FILE *fp)
> +{
> + char *srcline;
> + int ret = 0;
> +
> + if (map && map->dso) {
> + srcline_full_filename = true;
> + srcline = get_srcline(map->dso,
> + map__rip_2objdump(map, addr), NULL,
> + true, true);
> + if (srcline != SRCLINE_UNKNOWN) {
> + char srcfile[1024];
> + int line, len;
> + char *srccode;
> + if (sscanf(srcline, "%1023[^:]:%d", srcfile, &line)
so get_srcline formats srcline and you parse it out back in here,
I think it'd be better to factor __get_srcline and get the file
and line directly
thanks,
jirka
Powered by blists - more mailing lists