Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3802489pxk; Tue, 29 Sep 2020 06:42:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+Z3dZBkYGaEcZzg3MkQnowlJG5LHb3gR1W2RsJT7rk8rkQjwyNxWJ1ZhHCG2/Ts3fj4ac X-Received: by 2002:a17:906:194b:: with SMTP id b11mr3820008eje.159.1601386955776; Tue, 29 Sep 2020 06:42:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601386955; cv=none; d=google.com; s=arc-20160816; b=zhuafR1a+nBj8gWF+Vo41/xuPNzgB3tXWLL/hKv+z7/R7IYp9ndrw2Ju5uECvmfxw4 wCV2fQiwxek5KUKj0I6RWNRfro62HofFqPDB/mzfZdobh7c4JajdPAvZr6/WviJNpxSR LAnGQxA6fgbeQ1ihykinfSmLbHMEWvxjTLJzsVoPGZdzQt2gDs0SeO1DjrrdhG7E+P9n fzrKwVMIF9r5w5dCHUWEg+j2g22xyiW39dCcIWW1LIsNyXmIoPNafee9Q0OT3UFbtuza PXvmuhVq0I8Pwl2dGvY1pHiUqQ+UxYUDGAvL88jfsAj0zv0AFJ8N1qK476RxZvd57KRd ceyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=9+3/B34RTMEeHRAYHlsHPnPOfdHIDgIB7r6Y+U81LYU=; b=PVpUeie9AG0nJGTuNQm6xRqybzW/20QYeWs6t95LN9cQ4+TilGKNOHB7jVzNH9Vvv7 Boba7wjQw1NP7FCWXBCboIkR+SOcpCpZDq2DLKfsxgO3M1EOX5aleYzPNM2DOf4zl0uW MTHQv51pPCjwZd4549krC18MHvwXvaBIWOOWg6sbbZMs7ZX0ovVqr0KWrmpCPbdyZkt/ zf1ePp3QSbnYwvuaaYShHOyX1ynzA0hYs0Z+o9IOh1DN03J6IfN13XQ5ETAKsDFdIoL4 RpwjLXrnFJ8U1a+ANWqmSe8WiOR26r9QEPhZQRCRK0OAq3XDy/S958pBqzcfkqq2ve0K tiJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NWaoYKiB; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k24si2711983eja.436.2020.09.29.06.42.13; Tue, 29 Sep 2020 06:42:35 -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; dkim=pass header.i=@linaro.org header.s=google header.b=NWaoYKiB; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728897AbgI2Nkt (ORCPT + 99 others); Tue, 29 Sep 2020 09:40:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727354AbgI2Nkt (ORCPT ); Tue, 29 Sep 2020 09:40:49 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97A0FC061755 for ; Tue, 29 Sep 2020 06:40:48 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id q9so4684573wmj.2 for ; Tue, 29 Sep 2020 06:40:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=9+3/B34RTMEeHRAYHlsHPnPOfdHIDgIB7r6Y+U81LYU=; b=NWaoYKiBDaTXsXRtivDZOplPVd5wRKWBJRJmVjwCcRNQKT06Pas9TGdGoTxxlg4SOq YB/3wj6Ffq1LEFOpyBaL84Yq3UtT/QSPSVV2CijmggOy0MStC3vOiMA3GbDJs8oXonlT pTwaKrF7xvPr9dEbwOBBgWer7UB3cVqiKcRHWs7EYSOkjH9u45D5UoseiX5fd84GdWpj nsL05AMEnOWCW/Lj6tSdSyb+ZZ7+m37B11e6Xzfgr2vACpxZeyzpAtoVueG/Eso2ddzv FqTEV/at2RsCWppETAyB2Ih11sbtDpp5CwYWCOZL2ZXw9jg8Dn7ZfhmJ6RP9PFyKohFn DEew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=9+3/B34RTMEeHRAYHlsHPnPOfdHIDgIB7r6Y+U81LYU=; b=HN7VM8e+Qhb7CFioQPlxqCQkALQJhiP69S+/Kd/u7Xn9WYR5iRBLInADE0EOwaDUxY zsP83DIVQA1pXPRFyszx5+Qb/YKcd+SyggBhNHc5TdhzjjpkOLsu9OozKMjDZpPaAzDB /vlsuHH9pA9vjtnxD3zW+rlEd+/9GvS6EkBZidAQmaRqh/dvnO6YQM6UUZsyeqKd/Xkp BMT4WWKzSwYzEz7iEbavyqGelSdPtk/lKh9Mm7Rpv6m9Yqdm9BHIvSL1j/ES4n3lqYUG TAvX+hNX80Cj/IKNLtkbdyx+u7/jVuZXiOiSJdyttqx+y+/KjvdELA+1Xw38nlcgxxsG 8Cvw== X-Gm-Message-State: AOAM533xEj/sQoU/cGMClAKeasJHWrEqhZ8fPwLCujdlWD0s65VymHPh QMBmPx2sLcNwa2zoo0Cjyt2gGQ== X-Received: by 2002:a05:600c:252:: with SMTP id 18mr4383146wmj.63.1601386847196; Tue, 29 Sep 2020 06:40:47 -0700 (PDT) Received: from hackbox2.linaro.org ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id q15sm5955314wrr.8.2020.09.29.06.40.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Sep 2020 06:40:46 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Wei Li , James Clark , Andre Przywara , Dave Martin , linux-kernel@vger.kernel.org, Al Grant Cc: Leo Yan Subject: [PATCH v2 00/14] perf arm-spe: Refactor decoding & dumping flow Date: Tue, 29 Sep 2020 14:39:03 +0100 Message-Id: <20200929133917.9224-1-leo.yan@linaro.org> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The prominent issue for the SPE trace decoding and dumping is the packet header and payload values are hard coded with numbers and it's not readable and difficult to maintain; and has other minor issues, e.g. the packet length (header + payload) calculation is not correct for some packet types, and the dumping flow misses to support specific sub classes for operation packet, etc. So this patch set is to refactor the Arm SPE decoding SPE with: - Patches 01, 02 are minor cleans up; - Patches 03, 04 are used to fix and polish the packet and payload length calculation; - Patch 05 is to add a helper to wrap up printing strings, this can avoid bunch of duplicate code lines; - Patches 06 ~ 12 are used to refactor decoding for different types packet one by one (address packet, context packet, counter packet, event packet, operation packet); - Patch 13 is coming from Andre to dump memory tagging; - Patch 14 is coming from Wei Li to add decoding for ARMv8.3 extension, in this version it has been improved to use defined macros, also is improved for failure handling and commit log. This patch set is cleanly applied on the top of perf/core branch with commit a55b7bb1c146 ("perf test: Fix msan uninitialized use."), and the patches have been verified on Hisilicon D06 platform and I manually inspected the dumping result. Changes from v1: - Heavily rewrote the patch 05 for refactoring printing strings; this is fundamental change, so adjusted the sequence for patches and moved the printing string patch ahead from patch 10 (v1) to patch 05; - Changed to use GENMASK_ULL() for bits mask; - Added Andre's patch 13 for dumping memory tagging; - Refined patch 12 for adding sub classes for Operation packet, merged some commit log from Andre's patch, which allows commit log and code to be more clear; Added "Co-developed-by: Andre Przywara" tag to reflect this. Andre Przywara (1): perf arm_spe: Decode memory tagging properties Leo Yan (12): perf arm-spe: Include bitops.h for BIT() macro perf arm-spe: Fix a typo in comment perf arm-spe: Refactor payload length calculation perf arm-spe: Fix packet length handling perf arm-spe: Refactor printing string to buffer perf arm-spe: Refactor packet header parsing perf arm-spe: Refactor address packet handling perf arm-spe: Refactor context packet handling perf arm-spe: Refactor counter packet handling perf arm-spe: Refactor event type handling perf arm-spe: Refactor operation packet handling perf arm-spe: Add more sub classes for operation packet Wei Li (1): perf arm-spe: Add support for ARMv8.3-SPE .../util/arm-spe-decoder/arm-spe-decoder.c | 54 +- .../util/arm-spe-decoder/arm-spe-decoder.h | 17 - .../arm-spe-decoder/arm-spe-pkt-decoder.c | 567 +++++++++++------- .../arm-spe-decoder/arm-spe-pkt-decoder.h | 124 +++- 4 files changed, 478 insertions(+), 284 deletions(-) -- 2.20.1