All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: kan.liang@intel.com
Cc: acme@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com,
	peterz@infradead.org, adrian.hunter@intel.com,
	alexander.shishkin@linux.intel.com, ak@linux.intel.com
Subject: Re: [PATCH] perf tools: set no branch type for dummy event in PT
Date: Thu, 29 Jun 2017 17:29:12 +0200	[thread overview]
Message-ID: <20170629152912.GB1463@krava> (raw)
In-Reply-To: <20170628143153.29643-1-kan.liang@intel.com>

On Wed, Jun 28, 2017 at 10:31:53AM -0400, kan.liang@intel.com wrote:
> From: Kan Liang <kan.liang@intel.com>
> 
> An earlier kernel patch allowed enabling PT and LBR at the same
> time on Goldmont. 
> commit ccbebba4c6bf ("perf/x86/intel/pt: Bypass PT vs. LBR
> exclusivity if the core supports it")
> However, users still cannot use Intel PT and LBRs simultaneously.
>     $ sudo perf record -e cycles,intel_pt//u -b  -- sleep 1
>     Error:
>     PMU Hardware doesn't support sampling/overflow-interrupts.
> 
> PT implicitly adds dummy event in perf tool. dummy event is
> software event which doesn't support LBR.
> 
> Always setting branch_type=no for dummy event in Intel PT.
> 
> Signed-off-by: Kan Liang <kan.liang@intel.com>
> ---
>  tools/perf/arch/x86/util/intel-pt.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c
> index f630de0..651ab9e 100644
> --- a/tools/perf/arch/x86/util/intel-pt.c
> +++ b/tools/perf/arch/x86/util/intel-pt.c
> @@ -544,6 +544,22 @@ static int intel_pt_validate_config(struct perf_pmu *intel_pt_pmu,
>  					evsel->attr.config);
>  }
>  
> +static int add_no_lbr_config_term(struct list_head *config_terms)
> +{
> +	struct perf_evsel_config_term *lbr_term;
> +
> +	lbr_term = zalloc(sizeof(*lbr_term));
> +	if (!lbr_term)
> +		return -ENOMEM;
> +
> +	INIT_LIST_HEAD(&lbr_term->list);
> +	lbr_term->type = PERF_EVSEL__CONFIG_TERM_BRANCH;
> +	lbr_term->val.branch = strdup("no");
> +	list_add_tail(&lbr_term->list, config_terms);
> +
> +	return 0;
> +}
> +
>  static int intel_pt_recording_options(struct auxtrace_record *itr,
>  				      struct perf_evlist *evlist,
>  				      struct record_opts *opts)
> @@ -701,6 +717,8 @@ static int intel_pt_recording_options(struct auxtrace_record *itr,
>  				perf_evsel__set_sample_bit(switch_evsel, TIME);
>  				perf_evsel__set_sample_bit(switch_evsel, CPU);
>  
> +				add_no_lbr_config_term(&switch_evsel->config_terms);
> +

hum, why can't you change the sample bit directly? with:

			perf_evsel__reset_sample_bit(switch_evsel, BRANCH_STACK);

jirka

  reply	other threads:[~2017-06-29 15:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-28 14:31 [PATCH] perf tools: set no branch type for dummy event in PT kan.liang
2017-06-29 15:29 ` Jiri Olsa [this message]
2017-06-29 15:31   ` Liang, Kan
2017-06-29 15:39     ` Jiri Olsa
2017-06-29 15:50       ` Liang, Kan
2017-06-30  7:06         ` Jiri Olsa
2017-06-30 14:01           ` Liang, Kan

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=20170629152912.GB1463@krava \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.