Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp236691pxb; Wed, 11 Nov 2020 02:17:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJzBACrddle61CIub4R8I10tQheWsMPYlKZlJcCZF/Okb96zYqK+NEzl/bXOVkCjK0Q2DEFd X-Received: by 2002:a50:fc89:: with SMTP id f9mr4361337edq.89.1605089873921; Wed, 11 Nov 2020 02:17:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605089873; cv=none; d=google.com; s=arc-20160816; b=EtgHIcvp7vvNMLmNLJeibl7WRWo4hSqEwumkaubBV7UtIQ3RlfSYjUEGqJn/EPHOUH c4xKieZx9gp44WzxdYsLyu/91LgUM26yTV1gS1hlRNfwDZqhBPU9gNxTpbSmcS5Vumxc eO7R8Fuj2AHluYOebOwob5fbeC7oQ4HbBQIoSTbmm4sf0cdOsoZV6yQInhOjVd8J8eBB d6bQGWtXBk2l0sk+fTy290BaWSVxes181rfaSinvEL3334D40bVnau3GjwA4CMxIY1QF 0cffZJ7wosiV0nfHJuQebax62Z/ZtFqvxVWIqeAg7FSboMFES2Gl6uHipim2B1IjDIch +2cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization:cc :autocrypt:from:references:to:subject; bh=B4wmXj1vtfHFsySZU6lzmg5kYzHB5449jUokpd6e3y8=; b=kNwy+cWG2aUMpZXe+sfKZodcB6reir5i79zB7qQf/6seRLxE9bjTgF+c8khxnUrHKO 6S2Ljto0Ve7tJGQDL3CUwCB5siQgqArUwxAhwpSPHrRBp8R//6r14aEn8MFd6J9QrIYL JLf50h7TftbdQyC2Mst4DpZ8KDPUeZT0CQvAJF5VWPj2b+qIHoi127XaF2/tGI8npVsB 9ExptUEupgDj2fblFfECSdFuGDN8DjM9ryyg1Gyns+dCC/o7B5ByhCG024QMr8nrnTh2 YxtFaUDD+eeMiCkIBlG/BxHu3sw3mWQ/fZPh3FeDyqkSGNRt6kejTNwvSahUuOUsXa8D m96g== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a42si1466804edf.535.2020.11.11.02.17.30; Wed, 11 Nov 2020 02:17:53 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727427AbgKKKOK (ORCPT + 99 others); Wed, 11 Nov 2020 05:14:10 -0500 Received: from foss.arm.com ([217.140.110.172]:46324 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727017AbgKKKOJ (ORCPT ); Wed, 11 Nov 2020 05:14:09 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A2586101E; Wed, 11 Nov 2020 02:14:08 -0800 (PST) Received: from [192.168.2.22] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9A12D3F6CF; Wed, 11 Nov 2020 02:14:06 -0800 (PST) Subject: Re: [PATCH v8 00/22] perf arm-spe: Refactor decoding & dumping flow To: Leo Yan , Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar References: <20201111071149.815-1-leo.yan@linaro.org> From: =?UTF-8?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kLsnQugQ4oNUrx0ahwOSm9p6kM CIiTITo+W7O9KEE9XCb4vV0ejmLlgdDV8ASVUekeTJkmRIBnz0fa4pa1vbtZoi6/LlIdAEEt PY6p3hgkLLtr2GRodOW/Y3vPRd9+rJHq/tLIfwc58ZhQKmRcgrhtlnuTGTmyUqGSiMNfpwAR AQABwsFfBBgBAgAJBQJTTwijAhsMAAoJEAL1yD+ydue64BgP/33QKczgAvSdj9XTC14wZCGE U8ygZwkkyNf021iNMj+o0dpLU48PIhHIMTXlM2aiiZlPWgKVlDRjlYuc9EZqGgbOOuR/pNYA JX9vaqszyE34JzXBL9DBKUuAui8z8GcxRcz49/xtzzP0kH3OQbBIqZWuMRxKEpRptRT0wzBL O31ygf4FRxs68jvPCuZjTGKELIo656/Hmk17cmjoBAJK7JHfqdGkDXk5tneeHCkB411p9WJU vMO2EqsHjobjuFm89hI0pSxlUoiTL0Nuk9Edemjw70W4anGNyaQtBq+qu1RdjUPBvoJec7y/ EXJtoGxq9Y+tmm22xwApSiIOyMwUi9A1iLjQLmngLeUdsHyrEWTbEYHd2sAM2sqKoZRyBDSv ejRvZD6zwkY/9nRqXt02H1quVOP42xlkwOQU6gxm93o/bxd7S5tEA359Sli5gZRaucpNQkwd KLQdCvFdksD270r4jU/rwR2R/Ubi+txfy0dk2wGBjl1xpSf0Lbl/KMR5TQntELfLR4etizLq Xpd2byn96Ivi8C8u9zJruXTueHH8vt7gJ1oax3yKRGU5o2eipCRiKZ0s/T7fvkdq+8beg9ku fDO4SAgJMIl6H5awliCY2zQvLHysS/Wb8QuB09hmhLZ4AifdHyF1J5qeePEhgTA+BaUbiUZf i4aIXCH3Wv6K Cc: Dave Martin , James Clark , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Al Grant , Wei Li , John Garry , Will Deacon , Mathieu Poirier , linux-kernel@vger.kernel.org Organization: ARM Ltd. Message-ID: <08024ef8-0407-5eeb-d6ad-86018dace8a4@arm.com> Date: Wed, 11 Nov 2020 10:13:52 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20201111071149.815-1-leo.yan@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/11/2020 07:11, Leo Yan wrote: Hi Arnaldo, Ingo, Peter, (whoever feels responsible for taking this) > This is patch set v8 for refactoring Arm SPE trace decoding and dumping. I have reviewed every patch of this in anger, and am now fine with this series. Given the bugs fixed, the improvements it brings in terms of readability and maintainability, and the low risk it has on breaking things, I would be happy to see it merged. Thanks, Andre. > This version addresses Andre's comment to pass parameter '&buf_len' at > the last call arm_spe_pkt_snprintf() in the function arm_spe_pkt_desc(). > > This patch set is cleanly applied on the top of perf/core branch > with commit 644bf4b0f7ac ("perf jevents: Add test for arch std events"). > > I retested this patch set on Hisilicon D06 platform with commands > "perf report -D" and "perf script", compared the decoding results > between with this patch set and without this patch set, "diff" tool > shows the result as expected. > > Changes from v7: > - Changed to pass '&buf_len' for the last call arm_spe_pkt_snprintf() in > the patch 07/22 (Andre). > > Changes from v6: > - Removed the redundant comma from the string in the patch 21/22 "perf > arm_spe: Decode memory tagging properties" (Dave); > - Refined the return value for arm_spe_pkt_desc(): returns 0 for > success, otherwise returns non zero for failures; handle error code at > the end of function arm_spe_pkt_desc(); this is accomplished in the > new patch 07/22 "perf arm-spe: Consolidate arm_spe_pkt_desc()'s > return value" (Dave). > > Changes from v5: > - Directly bail out arm_spe_pkt_snprintf() if any error occurred > (Andre). > > Changes from v4: > - Implemented a cumulative error for arm_spe_pkt_snprintf() and changed > to condense code for printing strings (Dave); > - Changed to check payload bits [55:52] for parse kernel address > (Andre). > > Changes from v3: > - Refined arm_spe_payload_len() and removed macro SPE_HEADER_SZ() > (Andre); > - Refined packet header index macros (Andre); > - Added patch "perf arm_spe: Fixup top byte for data virtual address" to > fixup the data virtual address for 64KB pages and refined comments for > the fixup (Andre); > - Added Andre's review tag (using "b4 am" command); > - Changed the macros to SPE_PKT_IS_XXX() format to check operation types > (Andre). > > > Andre Przywara (1): > perf arm_spe: Decode memory tagging properties > > Leo Yan (20): > perf arm-spe: Include bitops.h for BIT() macro > perf arm-spe: Fix a typo in comment > perf arm-spe: Refactor payload size calculation > perf arm-spe: Refactor arm_spe_get_events() > perf arm-spe: Fix packet length handling > perf arm-spe: Refactor printing string to buffer > perf arm-spe: Consolidate arm_spe_pkt_desc()'s return value > perf arm-spe: Refactor packet header parsing > perf arm-spe: Add new function arm_spe_pkt_desc_addr() > perf arm-spe: Refactor address packet handling > perf arm_spe: Fixup top byte for data virtual address > perf arm-spe: Refactor context packet handling > perf arm-spe: Add new function arm_spe_pkt_desc_counter() > perf arm-spe: Refactor counter packet handling > perf arm-spe: Add new function arm_spe_pkt_desc_event() > perf arm-spe: Refactor event type handling > perf arm-spe: Remove size condition checking for events > perf arm-spe: Add new function arm_spe_pkt_desc_op_type() > 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 | 59 +- > .../util/arm-spe-decoder/arm-spe-decoder.h | 17 - > .../arm-spe-decoder/arm-spe-pkt-decoder.c | 601 ++++++++++-------- > .../arm-spe-decoder/arm-spe-pkt-decoder.h | 122 +++- > tools/perf/util/arm-spe.c | 2 +- > 5 files changed, 479 insertions(+), 322 deletions(-) >