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

2018-12-05 Thread Arnaldo Carvalho de Melo
Em Wed, Dec 05, 2018 at 01:28:38PM +0100, Jiri Olsa escreveu: > On Mon, Dec 03, 2018 at 04:18:48PM -0800, Andi Kleen wrote: > > From: Andi Kleen > > > > When looking at PT or brstackinsn traces with perf script > > it can be very useful to see the source code. This adds a simple > > facility to p

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

2018-12-05 Thread Andi Kleen
On Wed, Dec 05, 2018 at 01:28:38PM +0100, Jiri Olsa wrote: > On Mon, Dec 03, 2018 at 04:18:48PM -0800, Andi Kleen wrote: > > From: Andi Kleen > > > > When looking at PT or brstackinsn traces with perf script > > it can be very useful to see the source code. This adds a simple > > facility to prin

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

2018-12-05 Thread Jiri Olsa
On Wed, Dec 05, 2018 at 01:54:30PM -0300, Arnaldo Carvalho de Melo wrote: > Em Wed, Dec 05, 2018 at 01:28:38PM +0100, Jiri Olsa escreveu: > > On Mon, Dec 03, 2018 at 04:18:48PM -0800, Andi Kleen wrote: > > > From: Andi Kleen > > > > > > When looking at PT or brstackinsn traces with perf script >

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

2018-12-05 Thread Arnaldo Carvalho de Melo
Em Wed, Dec 05, 2018 at 01:28:38PM +0100, Jiri Olsa escreveu: > On Mon, Dec 03, 2018 at 04:18:48PM -0800, Andi Kleen wrote: > > From: Andi Kleen > > > > When looking at PT or brstackinsn traces with perf script > > it can be very useful to see the source code. This adds a simple > > facility to p

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

2018-12-05 Thread Jiri Olsa
On Mon, Dec 03, 2018 at 04:18:48PM -0800, Andi Kleen wrote: > From: Andi Kleen > > When looking at PT or brstackinsn traces with perf script > it can be very useful to see the source code. This adds a simple > facility to print them with perf script, if the information > is available through dwar

[PATCH] perf, tools: Support srccode output

2018-12-03 Thread Andi Kleen
From: Andi Kleen When looking at PT or brstackinsn traces with perf script it can be very useful to see the source code. This adds a simple facility to print them with perf script, if the information is available through dwarf % perf record ... % perf script -F insn,ip,sym,srccode ...

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

2017-05-09 Thread Jiri Olsa
On Tue, May 09, 2017 at 05:06:38AM -0700, Andi Kleen wrote: SNIP > |12 f2(); > 00400525insn: e8 cc ff ff ff# PRED > f2: > 004004f6insn: 55 > |5{ > 004004f7insn: 48 89 e5 > 0

[PATCH] perf, tools: Support srccode output

2017-05-09 Thread Andi Kleen
From: Andi Kleen When looking at PT or brstackinsn traces with perf script it can be very useful to see the source code. This adds a simple facility to print them with perf script, if the information is available through dwarf % perf record ... % perf script -F insn,ip,sym,srccode ...

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

2017-05-09 Thread Jiri Olsa
On Mon, May 08, 2017 at 01:22:05PM -0700, Andi Kleen wrote: SNIP > diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c > index df051a52393c..542bfa7db53c 100644 > --- a/tools/perf/util/srcline.c > +++ b/tools/perf/util/srcline.c > @@ -479,6 +479,35 @@ char *__get_srcline(struct dso

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

2017-05-09 Thread Jiri Olsa
On Mon, May 08, 2017 at 01:22:05PM -0700, Andi Kleen wrote: SNIP > diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c > index ebfa5d92358a..790ac730b162 100644 > --- a/tools/perf/util/map.c > +++ b/tools/perf/util/map.c > @@ -17,6 +17,7 @@ > #include > #include "srcline.h" > #include

[PATCH] perf, tools: Support srccode output

2017-05-08 Thread Andi Kleen
From: Andi Kleen When looking at PT or brstackinsn traces with perf script it can be very useful to see the source code. This adds a simple facility to print them with perf script, if the information is available through dwarf % perf record ... % perf script -F insn,ip,sym,srccode ...

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

2017-05-07 Thread Andi Kleen
> 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 It's not true for the addr2line fallback which gets the already formatted string. So at some point it would need to be parsed. But ok I can mo

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

2017-05-07 Thread Jiri Olsa
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_filen

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

2017-05-07 Thread Jiri Olsa
On Fri, May 05, 2017 at 04:00:29PM -0700, Andi Kleen wrote: SNIP > +static struct srcfile *find_srcfile(char *fn) > +{ > + struct stat st; > + struct srcfile *h; > + int fd; > + unsigned long ps, sz; > + bool first = true; > + > + list_for_each_entry (h, &srcfile_list, nd)

[PATCH] perf, tools: Support srccode output

2017-05-05 Thread Andi Kleen
From: Andi Kleen When looking at PT or brstackinsn traces with perf script it can be very useful to see the source code. This adds a simple facility to print them with perf script, if the information is available through dwarf % perf record ... % perf script -F insn,ip,sym,srccode ...