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 84AB7C433EF for ; Wed, 17 Nov 2021 15:29:12 +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 43EE760FED for ; Wed, 17 Nov 2021 15:29:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 43EE760FED 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=xl0US3rMoUoQo05uvKjSeX3Bz7c4inOvTfwjdz0L5Yw=; b=ZBhp9OLaCEhtD9 jxhH3EcfUtYQpA+43xEwLerU7CF9JULOUPzvnSQ6mp1V8wJuNgvVMagLriRCBVlYh3k/M8RB6r8/Q DZyQyrDwH1/xM0TcrtaVR6YHQ4CS81zFnXQ+g3SOs9iyD5En+NvVTI7vVenQt06MZKN+cjjVrfOsV fhP87NI8AIksagfKtO8Gv0wjm4IQ/j37g5yZFVUEkdVaOvwjowoYfRieoud942d4kaU6YdsJoh1mt UWQ12hAPpn5cVJnXiTHPV3kpfMgePdp/358xFQuuGGHIsALry+/MCy5DoIeq5EprRHHXd3xQdYXQF yV2eZC+Xp6MguyfGp/GQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mnMqp-005OA9-Rh; Wed, 17 Nov 2021 15:27:56 +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 1mnMqm-005O9Y-AE for linux-arm-kernel@bombadil.infradead.org; Wed, 17 Nov 2021 15:27:52 +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=yCJIgZzO3zx6Eyi5gHVh9S2PgWoCdBntb5Ypk9SXPGw=; b=rTVVoDWGFzbD0YROaLzSqF9/pM lAaYiN/jJ1Atk0m4grhLFOt8rwthFgPZAp6G4I/PxQkxVG37bvllKUWAQ6zSKSkeHVzm6gYm651qF IpNFu1U7LRpHn5c+Ge1hT8xN38LA4AHZW77Ymr+16cPx/eNNOrzH+W/h4YqWrqo7aLst/U5bAukFI TJwP96XWKQkWQcH1Dihhp+f/nlJXuSJYQBI0HF3VSHcp5MW81Ht8aQiwY0sHhZZYIO4bjK43b3wp8 FlpABLqtjChW4FOg3/jdIIJhqiMd6RE5UdcGV201Is0V4VcgCNgr789i4aa1Ji1HEiN4TPs2LY/Nq cWkmt3VA==; 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 1mnMqk-00GWWJ-KW for linux-arm-kernel@lists.infradead.org; Wed, 17 Nov 2021 15:27:51 +0000 Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 5B1AA4088E; Wed, 17 Nov 2021 12:27:48 -0300 (-03) Date: Wed, 17 Nov 2021 12:27:48 -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 Thanks, applied. - 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