From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FC36C433EF for ; Wed, 17 Nov 2021 15:31:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4F73061A64 for ; Wed, 17 Nov 2021 15:31:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4F73061A64 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YIB4mxP2mxyM6sH0eI1Zj8HgqLuPo0BtAGGH2figOC0=; b=pgcjwZ/UKmpesP q8bP38Mwtba8ZIqNq2eJ1CZb44gqzu11ooKQqNc+G61TzNn/4nggWzULU0k1yCrAzrOh7cOEBpNRh LwylSsMszFfz6zj2I1yscPdg9ynDD5J2Cx44X9b6oFxo2/BosaDut/wXi7R4IopwR37MMrdcMez5O XrKzq7X0jURid+w/hTcYDWWfM5L/UZcKybnDlahkNhh+XYqNjuCryC1DGZart2MAHMPl7oN9/SGOB 1q8VdMC0jSgnS1Uqhnye4wA40qRjUOt4UKHCE82QME3h0L/2Kiabw+bNEafkyCemrna56DSaV/NPH nrDWmByO67MssMtkY1AQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mnMsq-005OZR-SY; Wed, 17 Nov 2021 15:30:01 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mnMse-005OWS-F4 for linux-arm-kernel@bombadil.infradead.org; Wed, 17 Nov 2021 15:29:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=9eeOEo29uy5efp9eLsbKQfN8iegamuiSWH844CTLB80=; b=OPeM9flGv0iUgmXfoRevPUNehV WxZWA4V0GyqPAU3redC+kVFP/xxO4BpjXeV5SpqKfvDI44Ut+s/hE1QjKQJPguZJQqUsr1xO/2a2b 8Vo+AD3P7VtPRa0Xi8CL1VihIyBS+k0O6QgzkSEcv/lstiQTlcM/li9NziR1k5UZ3uCuzi8R3rUCo QQm8yp2lZl0IavQNo3KpbKiJoKYY62rS6UpR8+cu5kcH3Ymu6igW2f5kczlAMRx7q0zqmOFt4HKJu Roujf+CLMnggRwjBNgFd4L2MrfcJqUIb9uwpbXFDJUfS+JLEHjWr0fhcFRwW2We7hpF8E2eoAUPik z9/QV/dQ==; Received: from [179.97.37.151] (helo=quaco.ghostprotocols.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mnMsb-00GWXc-Od for linux-arm-kernel@lists.infradead.org; Wed, 17 Nov 2021 15:29:47 +0000 Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id B07654088E; Wed, 17 Nov 2021 12:29:43 -0300 (-03) Date: Wed, 17 Nov 2021 12:29:43 -0300 From: Arnaldo Carvalho de Melo To: James Clark Cc: German Gomez , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, John Garry , Will Deacon , Mathieu Poirier , Leo Yan , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 1/1] perf arm-spe: Inject SPE samples in perf-inject Message-ID: References: <20211105104130.28186-1-german.gomez@arm.com> <20211105104130.28186-2-german.gomez@arm.com> <5163f41f-2337-6557-ca91-fb2c66738872@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5163f41f-2337-6557-ca91-fb2c66738872@arm.com> X-Url: http://acmel.wordpress.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 > > Reviewed-by: James Clark 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