Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1637050

Re: [PATCH] perf, tools: Support srccode output

From Jiri Olsa <jolsa@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH] perf, tools: Support srccode output
Date 2017-05-08 00:00 +0200
Message-ID <tECnF-34t-45@gated-at.bofh.it> (permalink)
References <tDUwh-8nd-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] perf, tools: Support srccode output Andi Kleen <andi@firstfloor.org> - 2017-05-06 01:10 +0200
  Re: [PATCH] perf, tools: Support srccode output Jiri Olsa <jolsa@redhat.com> - 2017-05-08 00:00 +0200
  Re: [PATCH] perf, tools: Support srccode output Jiri Olsa <jolsa@redhat.com> - 2017-05-08 00:00 +0200
    Re: [PATCH] perf, tools: Support srccode output Andi Kleen <ak@linux.intel.com> - 2017-05-08 00:10 +0200

csiph-web