All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: James Clark <james.clark@arm.com>
Cc: German Gomez <german.gomez@arm.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	John Garry <john.garry@huawei.com>, Will Deacon <will@kernel.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	Leo Yan <leo.yan@linaro.org>, Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/1] perf arm-spe: Inject SPE samples in perf-inject
Date: Wed, 17 Nov 2021 12:29:43 -0300	[thread overview]
Message-ID: <YZUf5zu4aOfoIhFl@kernel.org> (raw)
In-Reply-To: <5163f41f-2337-6557-ca91-fb2c66738872@arm.com>

Em Mon, Nov 08, 2021 at 08:39:58PM +0000, James Clark escreveu:
> 
> 
> On 05/11/2021 10:41, German Gomez wrote:
> > Inject synthesized SPE samples during perf-inject run.
> > 
> > Signed-off-by: German Gomez <german.gomez@arm.com>
> 
> Reviewed-by: James Clark <james.clark@arm.com>

Next time please expand this explanations a bit more: why should we
inject such samples? Is this enabling some new mode of operation, fixing
something, what is an example of output before this patch and after it?

- Arnaldo

> > ---
> >  tools/perf/util/arm-spe.c | 15 +++++++++++++++
> >  1 file changed, 15 insertions(+)
> > 
> > diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c
> > index 58b7069c5..7054f2315 100644
> > --- a/tools/perf/util/arm-spe.c
> > +++ b/tools/perf/util/arm-spe.c
> > @@ -51,6 +51,7 @@ struct arm_spe {
> >  	u8				timeless_decoding;
> >  	u8				data_queued;
> >  
> > +	u64				sample_type;
> >  	u8				sample_flc;
> >  	u8				sample_llc;
> >  	u8				sample_tlb;
> > @@ -248,6 +249,12 @@ static void arm_spe_prep_sample(struct arm_spe *spe,
> >  	event->sample.header.size = sizeof(struct perf_event_header);
> >  }
> >  
> > +static int arm_spe__inject_event(union perf_event *event, struct perf_sample *sample, u64 type)
> > +{
> > +	event->header.size = perf_event__sample_event_size(sample, type, 0);
> > +	return perf_event__synthesize_sample(event, type, 0, sample);
> > +}
> > +
> >  static inline int
> >  arm_spe_deliver_synth_event(struct arm_spe *spe,
> >  			    struct arm_spe_queue *speq __maybe_unused,
> > @@ -256,6 +263,12 @@ arm_spe_deliver_synth_event(struct arm_spe *spe,
> >  {
> >  	int ret;
> >  
> > +	if (spe->synth_opts.inject) {
> > +		ret = arm_spe__inject_event(event, sample, spe->sample_type);
> > +		if (ret)
> > +			return ret;
> > +	}
> > +
> >  	ret = perf_session__deliver_synth_event(spe->session, event, sample);
> >  	if (ret)
> >  		pr_err("ARM SPE: failed to deliver event, error %d\n", ret);
> > @@ -920,6 +933,8 @@ arm_spe_synth_events(struct arm_spe *spe, struct perf_session *session)
> >  	else
> >  		attr.sample_type |= PERF_SAMPLE_TIME;
> >  
> > +	spe->sample_type = attr.sample_type;
> > +
> >  	attr.exclude_user = evsel->core.attr.exclude_user;
> >  	attr.exclude_kernel = evsel->core.attr.exclude_kernel;
> >  	attr.exclude_hv = evsel->core.attr.exclude_hv;
> > 

-- 

- Arnaldo

WARNING: multiple messages have this Message-ID (diff)
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: James Clark <james.clark@arm.com>
Cc: German Gomez <german.gomez@arm.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	John Garry <john.garry@huawei.com>, Will Deacon <will@kernel.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	Leo Yan <leo.yan@linaro.org>, Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/1] perf arm-spe: Inject SPE samples in perf-inject
Date: Wed, 17 Nov 2021 12:29:43 -0300	[thread overview]
Message-ID: <YZUf5zu4aOfoIhFl@kernel.org> (raw)
In-Reply-To: <5163f41f-2337-6557-ca91-fb2c66738872@arm.com>

Em Mon, Nov 08, 2021 at 08:39:58PM +0000, James Clark escreveu:
> 
> 
> On 05/11/2021 10:41, German Gomez wrote:
> > Inject synthesized SPE samples during perf-inject run.
> > 
> > Signed-off-by: German Gomez <german.gomez@arm.com>
> 
> Reviewed-by: James Clark <james.clark@arm.com>

Next time please expand this explanations a bit more: why should we
inject such samples? Is this enabling some new mode of operation, fixing
something, what is an example of output before this patch and after it?

- Arnaldo

> > ---
> >  tools/perf/util/arm-spe.c | 15 +++++++++++++++
> >  1 file changed, 15 insertions(+)
> > 
> > diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c
> > index 58b7069c5..7054f2315 100644
> > --- a/tools/perf/util/arm-spe.c
> > +++ b/tools/perf/util/arm-spe.c
> > @@ -51,6 +51,7 @@ struct arm_spe {
> >  	u8				timeless_decoding;
> >  	u8				data_queued;
> >  
> > +	u64				sample_type;
> >  	u8				sample_flc;
> >  	u8				sample_llc;
> >  	u8				sample_tlb;
> > @@ -248,6 +249,12 @@ static void arm_spe_prep_sample(struct arm_spe *spe,
> >  	event->sample.header.size = sizeof(struct perf_event_header);
> >  }
> >  
> > +static int arm_spe__inject_event(union perf_event *event, struct perf_sample *sample, u64 type)
> > +{
> > +	event->header.size = perf_event__sample_event_size(sample, type, 0);
> > +	return perf_event__synthesize_sample(event, type, 0, sample);
> > +}
> > +
> >  static inline int
> >  arm_spe_deliver_synth_event(struct arm_spe *spe,
> >  			    struct arm_spe_queue *speq __maybe_unused,
> > @@ -256,6 +263,12 @@ arm_spe_deliver_synth_event(struct arm_spe *spe,
> >  {
> >  	int ret;
> >  
> > +	if (spe->synth_opts.inject) {
> > +		ret = arm_spe__inject_event(event, sample, spe->sample_type);
> > +		if (ret)
> > +			return ret;
> > +	}
> > +
> >  	ret = perf_session__deliver_synth_event(spe->session, event, sample);
> >  	if (ret)
> >  		pr_err("ARM SPE: failed to deliver event, error %d\n", ret);
> > @@ -920,6 +933,8 @@ arm_spe_synth_events(struct arm_spe *spe, struct perf_session *session)
> >  	else
> >  		attr.sample_type |= PERF_SAMPLE_TIME;
> >  
> > +	spe->sample_type = attr.sample_type;
> > +
> >  	attr.exclude_user = evsel->core.attr.exclude_user;
> >  	attr.exclude_kernel = evsel->core.attr.exclude_kernel;
> >  	attr.exclude_hv = evsel->core.attr.exclude_hv;
> > 

-- 

- Arnaldo

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

  parent reply	other threads:[~2021-11-17 15:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-05 10:41 [PATCH 0/1] perf arm-spe: Inject SPE samples in perf-inject German Gomez
2021-11-05 10:41 ` German Gomez
2021-11-05 10:41 ` [PATCH 1/1] " German Gomez
2021-11-05 10:41   ` German Gomez
2021-11-08 20:39   ` James Clark
2021-11-08 20:39     ` James Clark
2021-11-17 15:27     ` Arnaldo Carvalho de Melo
2021-11-17 15:27       ` Arnaldo Carvalho de Melo
2021-11-17 15:29     ` Arnaldo Carvalho de Melo [this message]
2021-11-17 15:29       ` Arnaldo Carvalho de Melo
2021-11-17 16:27       ` German Gomez
2021-11-17 16:27         ` German Gomez
2021-11-17 17:24         ` Arnaldo Carvalho de Melo
2021-11-17 17:24           ` 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=YZUf5zu4aOfoIhFl@kernel.org \
    --to=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=german.gomez@arm.com \
    --cc=james.clark@arm.com \
    --cc=john.garry@huawei.com \
    --cc=jolsa@redhat.com \
    --cc=leo.yan@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=namhyung@kernel.org \
    --cc=will@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 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.