RE: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-19 Thread Liang, Kan
> > On Tue, 18 Nov 2014 14:01:06 +, Kan Liang wrote: > >> On Fri, 14 Nov 2014 08:44:12 -0500, kan liang wrote: > >> > +/* LBR only affects the user callchain */ > >> > +if (i != chain_nr) { > >> > +struct branch_stack *lbr_stack =

RE: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-19 Thread Liang, Kan
On Tue, 18 Nov 2014 14:01:06 +, Kan Liang wrote: On Fri, 14 Nov 2014 08:44:12 -0500, kan liang wrote: +/* LBR only affects the user callchain */ +if (i != chain_nr) { +struct branch_stack *lbr_stack = sample-

Re: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-18 Thread Namhyung Kim
On Tue, 18 Nov 2014 14:01:06 +, Kan Liang wrote: >> On Fri, 14 Nov 2014 08:44:12 -0500, kan liang wrote: >> > + /* LBR only affects the user callchain */ >> > + if (i != chain_nr) { >> > + struct branch_stack *lbr_stack = sample- >> >branch_stack; >> > +

Re: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-18 Thread Namhyung Kim
Hi Kan, On Tue, 18 Nov 2014 19:40:23 +, Kan Liang wrote: >> > whole >> > > >> stack. >> > > >> > +*/ >> > > >> >> > > >> Andi is using some sanity checks: >> > > >> http://marc.info/?l=linux-kernel=141584447819894=2 >> > > >> I guess this could be applied in here, once his

RE: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-18 Thread Liang, Kan
> > whole > > > >> stack. > > > >> > + */ > > > >> > > > >> Andi is using some sanity checks: > > > >> http://marc.info/?l=linux-kernel=141584447819894=2 > > > >> I guess this could be applied in here, once his patch gets in. > > > >> > > > > > > > > Are you suggesting me to

RE: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-18 Thread Liang, Kan
> On Tue, Nov 18, 2014 at 03:13:50PM +0900, Namhyung Kim wrote: > > SNIP > > > >> > + * in "from" register, while the callee is > stored > > >> > + * in "to" register. > > >> > + * For example, there is a call stack > > >> > +

RE: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-18 Thread Liang, Kan
> On Fri, 14 Nov 2014 08:44:12 -0500, kan liang wrote: > > + /* LBR only affects the user callchain */ > > + if (i != chain_nr) { > > + struct branch_stack *lbr_stack = sample- > >branch_stack; > > + int lbr_nr = lbr_stack->nr; > > +

RE: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-18 Thread Liang, Kan
On Tue, Nov 18, 2014 at 03:13:50PM +0900, Namhyung Kim wrote: SNIP + * in from register, while the callee is stored + * in to register. + * For example, there is a call stack + *

RE: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-18 Thread Liang, Kan
whole stack. + */ Andi is using some sanity checks: http://marc.info/?l=linux-kernelm=141584447819894w=2 I guess this could be applied in here, once his patch gets in. Are you suggesting me to remove the comments, or rebase the whole

Re: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-18 Thread Namhyung Kim
Hi Kan, On Tue, 18 Nov 2014 19:40:23 +, Kan Liang wrote: whole stack. +*/ Andi is using some sanity checks: http://marc.info/?l=linux-kernelm=141584447819894w=2 I guess this could be applied in here, once his patch gets in. Are you

Re: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-18 Thread Namhyung Kim
On Tue, 18 Nov 2014 14:01:06 +, Kan Liang wrote: On Fri, 14 Nov 2014 08:44:12 -0500, kan liang wrote: + /* LBR only affects the user callchain */ + if (i != chain_nr) { + struct branch_stack *lbr_stack = sample- branch_stack; + int

RE: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-18 Thread Liang, Kan
On Fri, 14 Nov 2014 08:44:12 -0500, kan liang wrote: + /* LBR only affects the user callchain */ + if (i != chain_nr) { + struct branch_stack *lbr_stack = sample- branch_stack; + int lbr_nr = lbr_stack-nr; + /*

Re: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-17 Thread Jiri Olsa
On Tue, Nov 18, 2014 at 03:13:50PM +0900, Namhyung Kim wrote: SNIP > >> > + * in "from" register, while the callee is > >> > stored > >> > + * in "to" register. > >> > + * For example, there is a call stack > >> > +

Re: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-17 Thread Namhyung Kim
On Fri, 14 Nov 2014 08:44:12 -0500, kan liang wrote: > + /* LBR only affects the user callchain */ > + if (i != chain_nr) { > + struct branch_stack *lbr_stack = sample->branch_stack; > + int lbr_nr = lbr_stack->nr; > +

Re: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-17 Thread Namhyung Kim
On Mon, 17 Nov 2014 17:41:32 +, Kan Liang wrote: >> SNIP >> >> > diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c >> > index f4478ce..335c3a9 100644 >> > --- a/tools/perf/util/session.c >> > +++ b/tools/perf/util/session.c >> > @@ -557,15 +557,63 @@ int

Re: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-17 Thread Namhyung Kim
On Mon, 17 Nov 2014 16:55:53 +0100, Jiri Olsa wrote: > On Fri, Nov 14, 2014 at 08:44:12AM -0500, kan.li...@intel.com wrote: > > SNIP > >> +if (lbr) { >> +for (i = 0; i < chain_nr; i++) { >> +if (chain->ips[i] == PERF_CONTEXT_USER) >> +

RE: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-17 Thread Liang, Kan
> SNIP > > > diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c > > index f4478ce..335c3a9 100644 > > --- a/tools/perf/util/session.c > > +++ b/tools/perf/util/session.c > > @@ -557,15 +557,63 @@ int perf_session_queue_event(struct > perf_session *s, union perf_event *event, > >

Re: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-17 Thread Jiri Olsa
On Fri, Nov 14, 2014 at 08:44:12AM -0500, kan.li...@intel.com wrote: SNIP > + if (lbr) { > + for (i = 0; i < chain_nr; i++) { > + if (chain->ips[i] == PERF_CONTEXT_USER) > + break; > + } > + > + /* LBR only

Re: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-17 Thread Jiri Olsa
On Fri, Nov 14, 2014 at 08:44:12AM -0500, kan.li...@intel.com wrote: SNIP > diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c > index f4478ce..335c3a9 100644 > --- a/tools/perf/util/session.c > +++ b/tools/perf/util/session.c > @@ -557,15 +557,63 @@ int

Re: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-17 Thread Jiri Olsa
On Fri, Nov 14, 2014 at 08:44:12AM -0500, kan.li...@intel.com wrote: SNIP diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index f4478ce..335c3a9 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -557,15 +557,63 @@ int

Re: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-17 Thread Jiri Olsa
On Fri, Nov 14, 2014 at 08:44:12AM -0500, kan.li...@intel.com wrote: SNIP + if (lbr) { + for (i = 0; i chain_nr; i++) { + if (chain-ips[i] == PERF_CONTEXT_USER) + break; + } + + /* LBR only affects

RE: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-17 Thread Liang, Kan
SNIP diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index f4478ce..335c3a9 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -557,15 +557,63 @@ int perf_session_queue_event(struct perf_session *s, union perf_event *event, return 0;

Re: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-17 Thread Namhyung Kim
On Mon, 17 Nov 2014 17:41:32 +, Kan Liang wrote: SNIP diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index f4478ce..335c3a9 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -557,15 +557,63 @@ int perf_session_queue_event(struct

Re: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-17 Thread Namhyung Kim
On Mon, 17 Nov 2014 16:55:53 +0100, Jiri Olsa wrote: On Fri, Nov 14, 2014 at 08:44:12AM -0500, kan.li...@intel.com wrote: SNIP +if (lbr) { +for (i = 0; i chain_nr; i++) { +if (chain-ips[i] == PERF_CONTEXT_USER) +break; +

Re: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-17 Thread Namhyung Kim
On Fri, 14 Nov 2014 08:44:12 -0500, kan liang wrote: + /* LBR only affects the user callchain */ + if (i != chain_nr) { + struct branch_stack *lbr_stack = sample-branch_stack; + int lbr_nr = lbr_stack-nr; + /*

Re: [PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-17 Thread Jiri Olsa
On Tue, Nov 18, 2014 at 03:13:50PM +0900, Namhyung Kim wrote: SNIP + * in from register, while the callee is stored + * in to register. + * For example, there is a call stack + *

[PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-14 Thread kan . liang
From: Kan Liang LBR call stack only has user callchain. It is output as PERF_SAMPLE_BRANCH_STACK data format. For the kernel callchain, it's still from PERF_SAMPLE_CALLCHAIN. The perf tool has to handle both data sources to construct a complete callstack. For perf report -D option, both lbr and

[PATCH V3 3/3] perf tools: Construct LBR call chain

2014-11-14 Thread kan . liang
From: Kan Liang kan.li...@intel.com LBR call stack only has user callchain. It is output as PERF_SAMPLE_BRANCH_STACK data format. For the kernel callchain, it's still from PERF_SAMPLE_CALLCHAIN. The perf tool has to handle both data sources to construct a complete callstack. For perf report -D