Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2021349ybh; Fri, 24 Jul 2020 02:21:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWDH+2WPAAttM7XIExA6CX6WU5O3FMschfxTCcUTrVnnCu7rNJpKpDzDGCIsGJDYVtkIvv X-Received: by 2002:a50:da44:: with SMTP id a4mr8290860edk.379.1595582512586; Fri, 24 Jul 2020 02:21:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595582512; cv=none; d=google.com; s=arc-20160816; b=nhAcuW7rizGnXkmamajS288r33kMoyNfuKV6GbcOyfSXWOYGdotimkwTVbW9nLGSRC RKvJcw3uIv5Mi+0B2VYnnQwtOXqmOIds7kqBcH8ktDFjSW4zehzJ9LfQcLrXL0xfv/Bb JElSU/VERLzWYw//SYpIaE6Kf7SE+kA8gYZn1WWe/5QVn9mz0Nsf4D1SwtWOCTKzxs3W rsRJK7pJgtlul6q0kLi9lZ4yd4/5PTxY+tie4Rjv3wfF2OFqX9KSoczzmoQa1yEEbYHu FgLYMMlZRDNgCVrAHlM40ZYubLONEcdseYa1iO6G1cKF71xkrMfLmOqHkfhwTClPn1Ko 7sJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=iN9bfpP8PNZ4hF4vvME50kOKEdiSuYFaoVJL6bGOetk=; b=wgrJmBk0fvS8xrBR84TredKSRXS1nvuw5jWtDii98CehsBzbM0mFLe2m3+u231npY8 axCeycDy8H+b5B6u7xvU/tgqJdZmicxtQjomIS1upIr9o2bGMQYfOWGjSLCTHmrr+g31 BXyVlLWXdrzI4HLzu7hnzlcWNvHMA7XSLQ9/tWvhZ66zOXqgs/XUW6nkWRVKbBSqkMdy topW/XC9Gtfmnsk75O6p74rxjbXq4AfXWh+j1Dk6coBdlcy9jufsWdD0B8UjJqsFBZiW IWOUeloU+zrBhWjdUSyJ+pB5lrYrl/vupEUZxsBIb/D9cCyfxTd2G9T5+0Q13uOno09G WZCA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qc24si226411ejb.398.2020.07.24.02.21.29; Fri, 24 Jul 2020 02:21:52 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728158AbgGXJSG (ORCPT + 99 others); Fri, 24 Jul 2020 05:18:06 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:56724 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726572AbgGXJSE (ORCPT ); Fri, 24 Jul 2020 05:18:04 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id DAB427DECD0A04FB1572; Fri, 24 Jul 2020 17:18:02 +0800 (CST) Received: from euler.huawei.com (10.175.124.27) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Fri, 24 Jul 2020 17:17:53 +0800 From: Wei Li To: Adrian Hunter , Alexander Shishkin , Arnaldo Carvalho de Melo , Catalin Marinas , James Clark , Jiri Olsa , Leo Yan , Mark Rutland , Namhyung Kim , Suzuki K Poulose , Will Deacon , CC: , , Ingo Molnar , Peter Zijlstra , Subject: [PATCH 2/4] perf: arm-spe: Add support for ARMv8.3-SPE Date: Fri, 24 Jul 2020 17:16:05 +0800 Message-ID: <20200724091607.41903-3-liwei391@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200724091607.41903-1-liwei391@huawei.com> References: <20200724091607.41903-1-liwei391@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.124.27] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Armv8.3 extends the SPE by adding: - Alignment field in the Events packet, and filtering on this event using PMSEVFR_EL1. - Support for the Scalable Vector Extension (SVE). The main additions for SVE are: - Recording the vector length for SVE operations in the Operation Type packet. It is not possible to filter on vector length. - Incomplete predicate and empty predicate fields in the Events packet, and filtering on these events using PMSEVFR_EL1. Add the corresponding decode process of Events packet and Operation Type packet in perf tool. Signed-off-by: Wei Li --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 69 ++++++++++++++++++- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c b/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c index b94001b756c7..10a3692839de 100644 --- a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c +++ b/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c @@ -347,6 +347,24 @@ int arm_spe_pkt_desc(const struct arm_spe_pkt *packet, char *buf, blen -= ret; } } + if (idx > 2) { + if (payload & 0x800) { + ret = snprintf(buf, buf_len, " ALIGNMENT"); + buf += ret; + blen -= ret; + } + if (payload & 0x20000) { + ret = snprintf(buf, buf_len, " SVE-PRED-PARTIAL"); + buf += ret; + blen -= ret; + } + if (payload & 0x40000) { + ret = snprintf(buf, buf_len, " SVE-PRED-EMPTY"); + buf += ret; + blen -= ret; + } + } + if (ret < 0) return ret; blen -= ret; @@ -354,8 +372,38 @@ int arm_spe_pkt_desc(const struct arm_spe_pkt *packet, char *buf, } case ARM_SPE_OP_TYPE: switch (idx) { - case 0: return snprintf(buf, buf_len, "%s", payload & 0x1 ? - "COND-SELECT" : "INSN-OTHER"); + case 0: { + if (payload & 0x8) { + size_t blen = buf_len; + + ret = snprintf(buf, buf_len, "SVE-OTHER"); + buf += ret; + blen -= ret; + if (payload & 0x2) { + ret = snprintf(buf, buf_len, " FP"); + buf += ret; + blen -= ret; + } + if (payload & 0x4) { + ret = snprintf(buf, buf_len, " PRED"); + buf += ret; + blen -= ret; + } + if (payload & 0x70) { + ret = snprintf(buf, buf_len, " EVL %d", + 32 << ((payload & 0x70) >> 4)); + buf += ret; + blen -= ret; + } + if (ret < 0) + return ret; + blen -= ret; + return buf_len - blen; + } else { + return snprintf(buf, buf_len, "%s", payload & 0x1 ? + "COND-SELECT" : "INSN-OTHER"); + } + } case 1: { size_t blen = buf_len; @@ -385,6 +433,23 @@ int arm_spe_pkt_desc(const struct arm_spe_pkt *packet, char *buf, ret = snprintf(buf, buf_len, " SIMD-FP"); buf += ret; blen -= ret; + } else if (payload & 0x8) { + if (payload & 0x4) { + ret = snprintf(buf, buf_len, " PRED"); + buf += ret; + blen -= ret; + } + if (payload & 0x70) { + ret = snprintf(buf, buf_len, " EVL %d", + 32 << ((payload & 0x70) >> 4)); + buf += ret; + blen -= ret; + } + if (payload & 0x80) { + ret = snprintf(buf, buf_len, " SG"); + buf += ret; + blen -= ret; + } } if (ret < 0) return ret; -- 2.17.1