mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Kan Liang <kan.liang@intel.com>
Cc: acme@kernel.org, jolsa@kernel.org, namhyung@kernel.org,
	ak@linux.intel.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC V7 6/7] perf,tools: per-event callgraph support
Date: Thu, 30 Jul 2015 14:15:24 +0200	[thread overview]
Message-ID: <20150730121524.GM9606@krava.brq.redhat.com> (raw)
In-Reply-To: <1438162936-59698-7-git-send-email-kan.liang@intel.com>

On Wed, Jul 29, 2015 at 05:42:15AM -0400, Kan Liang wrote:

SNIP

> +
> +	/* User explicitly set per-event callgraph, clear the old setting and reset. */
> +	if ((callgraph_buf != NULL) || (dump_size > 0)) {
> +
> +		/* parse callgraph parameters */
> +		if (callgraph_buf != NULL) {
> +			if (!strcmp(callgraph_buf, "no")) {
> +				param.enabled = false;
> +				param.record_mode = CALLCHAIN_NONE;
> +			} else {
> +				param.enabled = true;
> +				if (parse_callchain_record_opt(callgraph_buf, &param)) {
> +					pr_err("per-event callgraph setting for %s failed. "
> +					       "Apply callgraph global setting for it\n",
> +					       evsel->name);
> +					return;
> +				}
> +			}
> +		}
> +		if (dump_size > 0)
> +			param.dump_size = dump_size;
> +
> +		/* If global callgraph set, clear it */
> +		if (callchain_param.enabled) {
> +			perf_evsel__reset_sample_bit(evsel, CALLCHAIN);
> +			if (callchain_param.record_mode == CALLCHAIN_LBR) {
> +				perf_evsel__reset_sample_bit(evsel, BRANCH_STACK);
> +				attr->branch_sample_type &= ~(PERF_SAMPLE_BRANCH_USER |
> +							      PERF_SAMPLE_BRANCH_CALL_STACK);
> +			}
> +			if (callchain_param.record_mode == CALLCHAIN_DWARF) {
> +				perf_evsel__reset_sample_bit(evsel, REGS_USER);
> +				perf_evsel__reset_sample_bit(evsel, STACK_USER);
> +			}
> +		}

please put code above into perf_evsel__reset_callgraph
ans place it close to perf_evsel__config_callgraph ;-)

other than that the change looks ok to me now

thanks,
jirka

  reply	other threads:[~2015-07-30 12:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-29  9:42 [PATCH RFC V7 0/7] per event callgraph and time support Kan Liang
2015-07-29  9:42 ` [PATCH RFC V7 1/7] perf tools: Add support for event post configuration Kan Liang
2015-07-31 13:54   ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-07-29  9:42 ` [PATCH RFC V7 2/7] perf tools: Force period term to overload global settings Kan Liang
2015-07-31 13:54   ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-07-29  9:42 ` [PATCH RFC V7 3/7] perf,tools: introduce callgraph_set for callgraph option Kan Liang
2015-07-31 13:54   ` [tip:perf/core] perf tools: Introduce " tip-bot for Kan Liang
2015-07-29  9:42 ` [PATCH RFC V7 4/7] perf,tools: per-event time support Kan Liang
2015-07-29  9:42 ` [PATCH RFC V7 5/7] perf,tools: refine parse/config callchain functions Kan Liang
2015-07-29  9:42 ` [PATCH RFC V7 6/7] perf,tools: per-event callgraph support Kan Liang
2015-07-30 12:15   ` Jiri Olsa [this message]
2015-07-29  9:42 ` [PATCH RFC V7 7/7] perf,tests: Add tests to callgraph and time parse Kan Liang
2015-07-29 19:20 ` [PATCH RFC V7 0/7] per event callgraph and time support Arnaldo Carvalho de Melo

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=20150730121524.GM9606@krava.brq.redhat.com \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@kernel.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®