From: Namhyung Kim <namhyung@kernel.org>
To: kan.liang@intel.com
Cc: acme@kernel.org, jolsa@redhat.com, a.p.zijlstra@chello.nl,
eranian@google.com, linux-kernel@vger.kernel.org,
mingo@redhat.com, paulus@samba.org, ak@linux.intel.com
Subject: Re: [PATCH V4 1/3] perf tools: enable LBR call stack support
Date: Wed, 19 Nov 2014 16:05:43 +0900 [thread overview]
Message-ID: <87r3wzpt4o.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <1416346617-3577-2-git-send-email-kan.liang@intel.com> (kan liang's message of "Tue, 18 Nov 2014 16:36:55 -0500")
On Tue, 18 Nov 2014 16:36:55 -0500, kan liang wrote:
> From: Kan Liang <kan.liang@intel.com>
>
> Currently, there are two call chain recording options, fp and dwarf.
> Haswell has a new feature that utilizes the existing LBR facility to
> record call chains. So it provides the third options to record call
> chain. This patch enables the lbr call stack support.
>
> LBR call stack has some limitations. It reuses current LBR facility, so
> LBR call stack and branch record can not be enabled at the same time. It
> is only available for user callchain.
> However, LBR call stack can work on the user app which doesn't have
> frame-pointer or dwarf debug info compiled. It is a good alternative
> when nothing else works.
[SNIP]
> static void
> -perf_evsel__config_callgraph(struct perf_evsel *evsel)
> +perf_evsel__config_callgraph(struct perf_evsel *evsel,
> + struct record_opts *opts)
> {
> bool function = perf_evsel__is_function_event(evsel);
> struct perf_event_attr *attr = &evsel->attr;
>
> perf_evsel__set_sample_bit(evsel, CALLCHAIN);
>
> + if (callchain_param.record_mode == CALLCHAIN_LBR) {
> + if (!opts->branch_stack) {
> + perf_evsel__set_sample_bit(evsel, BRANCH_STACK);
> + attr->branch_sample_type = PERF_SAMPLE_BRANCH_USER |
> + PERF_SAMPLE_BRANCH_CALL_STACK;
> + if (attr->exclude_user) {
> + attr->exclude_user = 0;
> +
> + pr_warning("LBR callstack option is only available"
> + " to get user callchain information."
> + " Force exclude_user to 0.\n");
> + }
I'm not sure what's in a higher priority - maybe I missed earlier
discussion. IOW what about this?
if (attr->exclude_user) {
pr_warning("LBR callstack option is only available"
" to get user callchain information.\n");
} else {
perf_evsel__set_sample_bit(evsel, BRANCH_STACK);
attr->branch_sample_type = PERF_SAMPLE_BRANCH_USER |
PERF_SAMPLE_BRANCH_CALL_STACK;
}
> + } else
> + pr_info("Cannot use LBR callstack with branch stack\n");
It seems pr_warning is more appropriate here.
Thanks,
Namhyung
> + }
> +
> if (callchain_param.record_mode == CALLCHAIN_DWARF) {
> if (!function) {
> perf_evsel__set_sample_bit(evsel, REGS_USER);
> @@ -659,7 +676,7 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts)
> }
>
> if (callchain_param.enabled && !evsel->no_aux_samples)
> - perf_evsel__config_callgraph(evsel);
> + perf_evsel__config_callgraph(evsel, opts);
>
> if (target__has_cpu(&opts->target))
> perf_evsel__set_sample_bit(evsel, CPU);
next prev parent reply other threads:[~2014-11-19 7:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-18 21:36 [PATCH V4 0/3] perf tool: Haswell LBR call stack support (user) kan.liang
2014-11-18 21:36 ` [PATCH V4 1/3] perf tools: enable LBR call stack support kan.liang
2014-11-19 7:05 ` Namhyung Kim [this message]
2014-11-19 14:32 ` Liang, Kan
2014-11-20 6:32 ` Namhyung Kim
2014-11-20 12:37 ` Stephane Eranian
2014-11-20 13:39 ` Liang, Kan
2014-11-18 21:36 ` [PATCH V4 2/3] perf tool: Move cpumode resolve code to add_callchain_ip kan.liang
2014-11-18 21:36 ` [PATCH V4 3/3] perf tools: Construct LBR call chain kan.liang
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=87r3wzpt4o.fsf@sejong.aot.lge.com \
--to=namhyung@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=eranian@google.com \
--cc=jolsa@redhat.com \
--cc=kan.liang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--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
all inboxes | Powered by JetHome®