All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Leo Yan <leo.yan@linaro.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Mike Leach <mike.leach@linaro.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	Andi Kleen <ak@linux.intel.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Cc: Al Grant <al.grant@arm.com>
Subject: Re: [PATCH 2/2] perf intel-pt: Fix corrupt data after perf inject from
Date: Mon, 24 Aug 2020 15:41:13 +0300	[thread overview]
Message-ID: <b957484e-19f0-4a7c-c67e-38f9d81fa879@intel.com> (raw)
In-Reply-To: <20200819084751.17686-2-leo.yan@linaro.org>

On 19/08/20 11:47 am, Leo Yan wrote:
> From: Al Grant <al.grant@arm.com>
> 
> Commit 42bbabed09ce ("perf tools: Add hw_idx in struct branch_stack")
> changed the format of branch stacks in perf samples. When samples use
> this new format, a flag must be set in the corresponding event.
> Synthesized branch stacks generated from Intel PT were using the new
> format, but not setting the event attribute, leading to consumers
> seeing corrupt data. This patch fixes the issue by setting the event
> attribute to indicate use of the new format.
> 
> Fixes: 42bbabed09ce ("perf tools: Add hw_idx in struct branch_stack")
> Signed-off-by: Al Grant <al.grant@arm.com>
> Signed-off-by: Leo Yan <leo.yan@linaro.org>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  tools/perf/util/intel-pt.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
> index 2a8d245351e7..0af4e81c46e2 100644
> --- a/tools/perf/util/intel-pt.c
> +++ b/tools/perf/util/intel-pt.c
> @@ -3017,8 +3017,15 @@ static int intel_pt_synth_events(struct intel_pt *pt,
>  
>  	if (pt->synth_opts.callchain)
>  		attr.sample_type |= PERF_SAMPLE_CALLCHAIN;
> -	if (pt->synth_opts.last_branch)
> +	if (pt->synth_opts.last_branch) {
>  		attr.sample_type |= PERF_SAMPLE_BRANCH_STACK;
> +		/*
> +		 * We don't use the hardware index, but the sample generation
> +		 * code uses the new format branch_stack with this field,
> +		 * so the event attributes must indicate that it's present.
> +		 */
> +		attr.branch_sample_type |= PERF_SAMPLE_BRANCH_HW_INDEX;
> +	}
>  
>  	if (pt->synth_opts.instructions) {
>  		attr.config = PERF_COUNT_HW_INSTRUCTIONS;
> 


WARNING: multiple messages have this Message-ID (diff)
From: Adrian Hunter <adrian.hunter@intel.com>
To: Leo Yan <leo.yan@linaro.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	 Mathieu Poirier <mathieu.poirier@linaro.org>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Mike Leach <mike.leach@linaro.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	Andi Kleen <ak@linux.intel.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Cc: Al Grant <al.grant@arm.com>
Subject: Re: [PATCH 2/2] perf intel-pt: Fix corrupt data after perf inject from
Date: Mon, 24 Aug 2020 15:41:13 +0300	[thread overview]
Message-ID: <b957484e-19f0-4a7c-c67e-38f9d81fa879@intel.com> (raw)
In-Reply-To: <20200819084751.17686-2-leo.yan@linaro.org>

On 19/08/20 11:47 am, Leo Yan wrote:
> From: Al Grant <al.grant@arm.com>
> 
> Commit 42bbabed09ce ("perf tools: Add hw_idx in struct branch_stack")
> changed the format of branch stacks in perf samples. When samples use
> this new format, a flag must be set in the corresponding event.
> Synthesized branch stacks generated from Intel PT were using the new
> format, but not setting the event attribute, leading to consumers
> seeing corrupt data. This patch fixes the issue by setting the event
> attribute to indicate use of the new format.
> 
> Fixes: 42bbabed09ce ("perf tools: Add hw_idx in struct branch_stack")
> Signed-off-by: Al Grant <al.grant@arm.com>
> Signed-off-by: Leo Yan <leo.yan@linaro.org>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  tools/perf/util/intel-pt.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
> index 2a8d245351e7..0af4e81c46e2 100644
> --- a/tools/perf/util/intel-pt.c
> +++ b/tools/perf/util/intel-pt.c
> @@ -3017,8 +3017,15 @@ static int intel_pt_synth_events(struct intel_pt *pt,
>  
>  	if (pt->synth_opts.callchain)
>  		attr.sample_type |= PERF_SAMPLE_CALLCHAIN;
> -	if (pt->synth_opts.last_branch)
> +	if (pt->synth_opts.last_branch) {
>  		attr.sample_type |= PERF_SAMPLE_BRANCH_STACK;
> +		/*
> +		 * We don't use the hardware index, but the sample generation
> +		 * code uses the new format branch_stack with this field,
> +		 * so the event attributes must indicate that it's present.
> +		 */
> +		attr.branch_sample_type |= PERF_SAMPLE_BRANCH_HW_INDEX;
> +	}
>  
>  	if (pt->synth_opts.instructions) {
>  		attr.config = PERF_COUNT_HW_INSTRUCTIONS;
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-08-24 12:42 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-19  8:47 [PATCH 1/2] perf cs-etm: Fix corrupt data after perf inject from Leo Yan
2020-08-19  8:47 ` Leo Yan
2020-08-19  8:47 ` [PATCH 2/2] perf intel-pt: " Leo Yan
2020-08-19  8:47   ` Leo Yan
2020-08-24 12:41   ` Adrian Hunter [this message]
2020-08-24 12:41     ` Adrian Hunter
2020-08-31 20:38   ` Mathieu Poirier
2020-08-31 20:38     ` Mathieu Poirier
2020-09-01 14:53     ` Arnaldo Carvalho de Melo
2020-09-01 14:53       ` Arnaldo Carvalho de Melo
2020-08-27 20:53 ` [PATCH 1/2] perf cs-etm: " Mathieu Poirier
2020-08-27 20:53   ` Mathieu Poirier
2020-08-31  0:04   ` Leo Yan
2020-08-31  0:04     ` Leo Yan
2020-09-01 14:54     ` Arnaldo Carvalho de Melo
2020-09-01 14:54       ` Arnaldo Carvalho de Melo
2020-09-02  0:39       ` Leo Yan
2020-09-02  0:39         ` Leo Yan
2020-09-02  1:47         ` Arnaldo Carvalho de Melo
2020-09-02  1:47           ` Arnaldo Carvalho de Melo
2020-09-02  2:12           ` Leo Yan
2020-09-02  2:12             ` Leo Yan

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=b957484e-19f0-4a7c-c67e-38f9d81fa879@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=al.grant@arm.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@linux.intel.com \
    --cc=leo.yan@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=mike.leach@linaro.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=suzuki.poulose@arm.com \
    /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.