Received: by 2002:a05:6a10:8a4f:0:0:0:0 with SMTP id dn15csp2600130pxb; Mon, 31 Jan 2022 03:40:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxhcFrNRgZBEzDkPLcEJmD8bXWEMGHgPTl1eG2dkJxX5opVfgSw3F9sbIQhFDoshu5n2Whv X-Received: by 2002:a17:90b:1e05:: with SMTP id pg5mr33936730pjb.86.1643629205073; Mon, 31 Jan 2022 03:40:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643629205; cv=none; d=google.com; s=arc-20160816; b=GhpFyHowQ7m56lnaoI8h3BRXfrZ6s1dK3UmiXe2ZN4Nazwa0z7e5y9iefAy7PZY02C NgWg8SGu5KvuHc9CVW3HdCmzAJY+AYjUCsmGDnIuchdxqQyeHdpsjLBUMi17e98kkQJL iaTKI9BPL7DD4RDT6oKtVddyIUuKa9ILRc9IJ3UYzN5ZCGH8rz9hvt41RpIQLRXZOoJO Jc6EGQLB9izBAAjXThjlLg0cBtTjZbJznC0dYjEfDcag9ag1/cznrUxOUIE85DXuZH30 YgNb/izjTQnGtXi8W+SJX14EosnAw+vkyVXrM2swsBkFVcz4jFy4dNSFiPTVgS0ar6JX /ZLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0elh7Uegmz6NB5gRLtcnKnV9reRQ0A3TuI1lW+jT4v4=; b=lZkjGan+LFJJgzNi47kBv47iMc4XYFQ0ezQQwV5w8zDbPRK+nwOSaKyENeGVrJeLr8 M+3t0ADXxG7lphizOkqiGLxY0h3uWhCT4Hik91EVHtOJmKFF99wbum5TihIljwbHffu8 7tdKpESAPs41KnLp/UmupX2yWFXQwuoVB7Bh4Jv9f80NPx9NKwYj17zgaNDAyO8NKARW P85Lqw0gNna6B3ztAn7/ck8YrAH8wbwmGYb6QAiqa1seiEYsN038YbMYQhjFcB72U28v BpRkuPaRIHEYBKOcGV9ivtrJEKIUIfNMYHWNYR+MxAjtjuQljCESucVXrluduoItTxJG 3cIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=CKQCLyki; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l72si10374052pge.581.2022.01.31.03.39.54; Mon, 31 Jan 2022 03:40:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=CKQCLyki; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343518AbiA1VDH (ORCPT + 99 others); Fri, 28 Jan 2022 16:03:07 -0500 Received: from smtp-fw-80006.amazon.com ([99.78.197.217]:39068 "EHLO smtp-fw-80006.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231409AbiA1VDF (ORCPT ); Fri, 28 Jan 2022 16:03:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1643403786; x=1674939786; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0elh7Uegmz6NB5gRLtcnKnV9reRQ0A3TuI1lW+jT4v4=; b=CKQCLyki8E1/onFeb3PMNGmLq20Qsd6k1Oyc6Bv2QuzV2qkm664UJJCF GtNKqEGVPIIun5+tozTvK11ealtg/MIHITLi7rOiT7SIc99gzYZcGCvYM VAeiXD76w8yP0+Dd57pJMXdPmpoIcoKL9Xu/hMAf2fScmXuT+EzT59+Mw 8=; X-IronPort-AV: E=Sophos;i="5.88,324,1635206400"; d="scan'208";a="58828092" Received: from pdx4-co-svc-p1-lb2-vlan3.amazon.com (HELO email-inbound-relay-pdx-2a-5feb294a.us-west-2.amazon.com) ([10.25.36.214]) by smtp-border-fw-80006.pdx80.corp.amazon.com with ESMTP; 28 Jan 2022 21:02:59 +0000 Received: from EX13MTAUWB001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-pdx-2a-5feb294a.us-west-2.amazon.com (Postfix) with ESMTPS id 2F5E19FCD2; Fri, 28 Jan 2022 21:02:53 +0000 (UTC) Received: from EX13D02UWB001.ant.amazon.com (10.43.161.240) by EX13MTAUWB001.ant.amazon.com (10.43.161.249) with Microsoft SMTP Server (TLS) id 15.0.1497.28; Fri, 28 Jan 2022 21:02:52 +0000 Received: from EX13MTAUEA002.ant.amazon.com (10.43.61.77) by EX13D02UWB001.ant.amazon.com (10.43.161.240) with Microsoft SMTP Server (TLS) id 15.0.1497.28; Fri, 28 Jan 2022 21:02:50 +0000 Received: from dev-dsk-alisaidi-i31e-9f3421fe.us-east-1.amazon.com (10.200.138.153) by mail-relay.amazon.com (10.43.61.169) with Microsoft SMTP Server id 15.0.1497.28 via Frontend Transport; Fri, 28 Jan 2022 21:02:49 +0000 Received: by dev-dsk-alisaidi-i31e-9f3421fe.us-east-1.amazon.com (Postfix, from userid 5131138) id A5DCC21BC4; Fri, 28 Jan 2022 21:02:49 +0000 (UTC) From: Ali Saidi To: CC: , , , , , , , , , , , , , , , , , Subject: Re: [PATCH 2/2] perf arm-spe: Parse more SPE fields and store source Date: Fri, 28 Jan 2022 21:02:45 +0000 Message-ID: <20220128210245.4628-1-alisaidi@amazon.com> X-Mailer: git-send-email 2.24.4.AMZN In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi German, On 28/01/2022 19:20, German Gomez wrote: >Hi Ali, > >On 25/01/2022 19:20, Ali Saidi wrote: >> Decode more SPE events and op types to allow for processing by perf >> scripts. For example looking for branches which may indicate candidates >> for conversion to a CSEL, store exclusives that are candidates for >> conversion to LSE atomics and record the source information for memory >> ops. >> [snip] >> + if (SPE_OP_PKT_IS_LDST_ATOMIC(payload)) { >> + if (payload & SPE_OP_PKT_AT) >> + decoder->record.op |= ARM_SPE_LDST_ATOMIC; > >In "utils/arm-spe.c" we check "if (record->op == ARM_SPE_LD)" so this >ORing could break some of the generated samples. Yep, you're correct. Interestingly I can only find one use of record->op using equivalence instead of a logical and so perhaps it's best to fix this one use. ... >> diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-decoder.h b/tools/perf/util/arm-spe-decoder/arm-spe-decoder.h >> index 69b31084d6be..113e427afe99 100644 >> --- a/tools/perf/util/arm-spe-decoder/arm-spe-decoder.h >> +++ b/tools/perf/util/arm-spe-decoder/arm-spe-decoder.h >> @@ -22,11 +22,18 @@ enum arm_spe_sample_type { >> ARM_SPE_TLB_MISS = 1 << 5, >> ARM_SPE_BRANCH_MISS = 1 << 6, >> ARM_SPE_REMOTE_ACCESS = 1 << 7, >> + ARM_SPE_BR_NOT_TAKEN = 1 << 8, > >Can you rename it to ARM_SPE_BRANCH_NOT_TAKEN for consistency? No problem > >> }; >> >> enum arm_spe_op_type { >> ARM_SPE_LD = 1 << 0, >> ARM_SPE_ST = 1 << 1, >> + ARM_SPE_LDST_EXCL = 1 << 2, >> + ARM_SPE_LDST_ATOMIC = 1 << 3, >> + ARM_SPE_LDST_ACQREL = 1 << 4, >> + ARM_SPE_BR = 1 << 5, >> + ARM_SPE_BR_COND = 1 << 6, >> + ARM_SPE_BR_IND = 1 << 7, > >I'm not sure if we should keep everything in one enum/bitmask. I'm also >looking at adding more of the data from the packets to the record, and >considering refactoring the record structure. I'll share here when I >have something. One straight forward way to do this would be to make it a u16 field that was SPE operation-type header and operation-type payload with some accessors instead of trying to re-encode the operation type into a new format. Thanks, Ali