From: "Liang, Kan" <kan.liang@intel.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: "acme@kernel.org" <acme@kernel.org>,
"jolsa@redhat.com" <jolsa@redhat.com>,
"a.p.zijlstra@chello.nl" <a.p.zijlstra@chello.nl>,
"eranian@google.com" <eranian@google.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"mingo@redhat.com" <mingo@redhat.com>,
"paulus@samba.org" <paulus@samba.org>,
"ak@linux.intel.com" <ak@linux.intel.com>
Subject: RE: [PATCH V3 3/3] perf tools: Construct LBR call chain
Date: Wed, 19 Nov 2014 13:37:01 +0000 [thread overview]
Message-ID: <37D7C6CF3E00A74B8858931C1DB2F07701671C4D@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <874mtvraop.fsf@sejong.aot.lge.com>
>
> On Tue, 18 Nov 2014 14:01:06 +0000, 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 lbr_nr = lbr_stack->nr;
> >> > + /*
> >> > + * LBR callstack can only get user call chain.
> >> > + * The mix_chain_nr is kernel call chain
> >> > + * number plus LBR user call chain number.
> >> > + * i is kernel call chain number,
> >> > + * 1 is PERF_CONTEXT_USER,
> >> > + * lbr_nr + 1 is the user call chain number.
> >> > + * For details, please refer to the comments
> >> > + * in callchain__printf
> >> > + */
> >> > + int mix_chain_nr = i + 1 + lbr_nr + 1;
> >> > +
> >> > + if (mix_chain_nr > PERF_MAX_STACK_DEPTH) {
> >> > + pr_warning("corrupted callchain.
> >> skipping...\n");
> >> > + return 0;
> >> > + }
> >>
> >> I'm not sure whether this is really a corrupted callchain. If a
> >> single chain is greater than the max it should be corrupted, but
> >> we're now summing up with other values..
> >>
> >> What about checking callchain_nr and lbr_nr separately or mix_nr with
> >> 2*max?
> >
> > The lbr_nr max is 16. I will change it to max+16.
>
> Shouldn't it be 18 (16 + 1 + 1) at least?
In the new patch, I use PERF_MAX_BRANCH_DEPTH from Andi's patch. It's
127. It should be enough.
+ if (mix_chain_nr > PERF_MAX_STACK_DEPTH +
PERF_MAX_BRANCH_DEPTH) {
+ pr_warning("corrupted callchain. skipping...\n");
+ return 0;
+ }
Thanks,
Kan
>
> Thanks,
> Namhyung
next prev parent reply other threads:[~2014-11-19 13:37 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-14 13:44 [PATCH V3 0/3] perf tool: Haswell LBR call stack support (user) kan.liang
2014-11-14 13:44 ` [PATCH V3 1/3] perf tools: enable LBR call stack support kan.liang
2014-11-18 5:54 ` Namhyung Kim
2014-11-18 13:57 ` Liang, Kan
2014-11-14 13:44 ` [PATCH V3 2/3] perf tool: Move cpumode resolve code to add_callchain_ip kan.liang
2014-11-17 13:57 ` Jiri Olsa
2014-11-17 14:00 ` Jiri Olsa
2014-11-18 8:24 ` Jiri Olsa
2014-11-21 15:06 ` Liang, Kan
2014-11-21 15:19 ` Arnaldo Carvalho de Melo
2014-11-14 13:44 ` [PATCH V3 3/3] perf tools: Construct LBR call chain kan.liang
2014-11-17 15:54 ` Jiri Olsa
2014-11-17 17:41 ` Liang, Kan
2014-11-18 6:13 ` Namhyung Kim
2014-11-18 7:55 ` Jiri Olsa
2014-11-18 14:37 ` Liang, Kan
2014-11-18 19:40 ` Liang, Kan
2014-11-19 5:57 ` Namhyung Kim
2014-11-17 15:55 ` Jiri Olsa
2014-11-18 6:14 ` Namhyung Kim
2014-11-18 6:25 ` Namhyung Kim
2014-11-18 14:01 ` Liang, Kan
2014-11-19 6:01 ` Namhyung Kim
2014-11-19 13:37 ` Liang, Kan [this message]
2014-11-17 16:01 ` [PATCH V3 0/3] perf tool: Haswell LBR call stack support (user) Jiri Olsa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=37D7C6CF3E00A74B8858931C1DB2F07701671C4D@SHSMSX103.ccr.corp.intel.com \
--to=kan.liang@intel.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=eranian@google.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).