From patchwork Thu Nov 19 15:24:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 11917907 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9272FC6369E for ; Thu, 19 Nov 2020 15:25:50 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 184D124695 for ; Thu, 19 Nov 2020 15:25:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="xorHY9DR"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="zboYoyhB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 184D124695 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=7xFMxiAy824BMPg3o7EAiIc+ZH+MGWj5AEShlr+pgEk=; b=xorHY9DRTwDXzWRD6XK4pUlzDO ul+KodUcq/06W14w47e4mBL2ZRBjwaRckRrjNXsS7H9tXhlwvdJPXe1ws/UKE2+u9HeUayEhC3Fpb TsJwrtzuMTIH6jUhWTb5AjxgZcBvokKShV23DgqSUdYhTnOoFZY9niQi3T0BnCm0USs8UeYYDd4aK JrxX/3tsmwikhyVKli2bM32fZhk46BiIex4T7OAOZN+DRq1EXoqI/nh4Zx9mOYgtAmMnCSWWRfkuc MfpxYYw5ixwY+Bsyep2G/W1Y+/ASL+6OdAoBHhfhGkK5WDxxPngrle80eVb2Sjyq4B2+ziWWE+tMW ZGD17jpw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kflo5-00049N-PT; Thu, 19 Nov 2020 15:25:09 +0000 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kflnw-00044h-Td for linux-arm-kernel@lists.infradead.org; Thu, 19 Nov 2020 15:25:04 +0000 Received: by mail-pg1-x532.google.com with SMTP id 81so4509847pgf.0 for ; Thu, 19 Nov 2020 07:24:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=phox4FUJenMVNqYANcB4eQ+O/EAizHfhsdqaJKB0e9g=; b=zboYoyhBR3WHytt1G4PF95Phfn8z5mlArN5Mz2rs0wabRMzvghqvFBUiOUiWo6uUrt iQ7H0P+MUDHqSFeIN7yYi0qAEMQv47bBpPFWuaxPg1dcpzhstWuFKl/A93kbGlDpyqcK W/H+fBUTChZ76IEQVcuXQeDIczcmAkr+2wpalDqrL7Y0Mf1kP70Z4C6WYjnG+Bc13uJM dHxzyMW5Le9v9aJbbfXBJOh53omVCZ26TO6iK4CeBVfS4aWE+obxFniMwvAi/2GZwdfD J0UuZIB/ATPHHm3O0oYF1IgOmXh/suN5tSC9AVQJZJQywfd0ykAVDnM4/qIutbHB7DtN +iRQ== 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=phox4FUJenMVNqYANcB4eQ+O/EAizHfhsdqaJKB0e9g=; b=JWUr8r1klQ2DR9M9fXbyJaM9gD37XJqawCNRlPqdRLfPXbXe8oIzPSgJJsALN74ciH gFvborh6f07mTxKWtrDwvty2aAyo33b70phBHJODUjqa/RmJvf1Hx2ylRkVOM3EKDqhn GPXtkO+1KlYSoJd+AwuyBm2V8VKrLXp1HvgAcJngK6kz20Nok4k/xmOr0eu8VqKXFwBQ wHuvnJYX2Jl17d3vjxH9QDT8NUhm3doHO7CZpuxTuAno9SYy8BzNR8vNMFsgONgmRQBV FN1vxLIO1BkKP3VX1XEbDwn3f5nnVf3N7yX4Vygr406qapkaHq2H+HINobzsiQo5Qe47 dv3w== X-Gm-Message-State: AOAM533GZcKOKEqya1491DWC6Xzps6GKcWATSYsnr3Y3U4+S5f/bPFXu FqIE46ZWR25Mp4LHpqdMksURFA== X-Google-Smtp-Source: ABdhPJyl9yYHIr31s6MXUpcoVUshsuHXcCW3p7W0AXiIhomjq/GMHw+jQ0Ejas2GW+HLsR/kT/RLWQ== X-Received: by 2002:a63:348:: with SMTP id 69mr13162978pgd.336.1605799493197; Thu, 19 Nov 2020 07:24:53 -0800 (PST) Received: from localhost ([45.137.216.7]) by smtp.gmail.com with ESMTPSA id e22sm101440pfd.153.2020.11.19.07.24.52 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Nov 2020 07:24:52 -0800 (PST) From: Leo Yan To: Arnaldo Carvalho de Melo , Andre Przywara , Dave Martin , James Clark , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Al Grant , Wei Li , John Garry , Will Deacon , Mathieu Poirier , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v9 00/16] perf arm-spe: Refactor decoding & dumping flow Date: Thu, 19 Nov 2020 23:24:25 +0800 Message-Id: <20201119152441.6972-1-leo.yan@linaro.org> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201119_102501_320354_048E9C90 X-CRM114-Status: GOOD ( 18.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Yan MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is patch set v9 for refactoring Arm SPE trace decoding and dumping. According to comments and suggestions from patch set v8, it squashs the two patches into single one: "perf arm-spe: Refactor printing string to buffer" and "perf arm-spe: Consolidate arm_spe_pkt_desc()'s return value". In the patch 01/16, it renames the function arm_spe_pkt_snprintf() to arm_spe_pkt_out_string(), since the function is not the same semantics with snprintf(), the renaming can avoid confusion. This patch set is cleanly applied on the top of perf/core branch with commit 29396cd573da ("perf expr: Force encapsulation on expr_id_data"). This patch set has been tested 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. I also manually built the patches for arm/arm64/x86_64 and verfied every single patch can build successfully. Changes from v8: - Squashed the two patches "perf arm-spe: Refactor printing string to buffer" and "perf arm-spe: Consolidate arm_spe_pkt_desc()'s return value" (Dave); - Fixed the condition for vsnprintf()'s overrun to "if ((size_t)ret >= *blen)" (Dave); - Renamed function arm_spe_pkt_snprintf() to arm_spe_pkt_out_string() (Dave/Arnaldo); - Rebased on the latest perf/core branch. 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). Andre Przywara (1): perf arm_spe: Decode memory tagging properties Leo Yan (14): perf arm-spe: Refactor printing string to buffer 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 | 54 +- .../util/arm-spe-decoder/arm-spe-decoder.h | 17 - .../arm-spe-decoder/arm-spe-pkt-decoder.c | 542 ++++++++++-------- .../arm-spe-decoder/arm-spe-pkt-decoder.h | 122 +++- tools/perf/util/arm-spe.c | 2 +- 5 files changed, 455 insertions(+), 282 deletions(-) Acked-by: Will Deacon