Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5878039pxu; Thu, 22 Oct 2020 13:26:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzffbUqLOu91rW0FlAr2fv+RpwnRH+LLfwTgF8t4gAtsybw9ieyABWczPicNc95y25Q3LO7 X-Received: by 2002:a17:906:234d:: with SMTP id m13mr4162844eja.497.1603398383352; Thu, 22 Oct 2020 13:26:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603398383; cv=none; d=google.com; s=arc-20160816; b=RmQT5WkRudBvcImBelH6aIDiqVtlFyZaMqpqOx6Q79uLGOa4MwKW+yd8C4mWT56azU WpM2tIfN2gi6AvLhoLGNUdlT1gmy0Kv2iHmUX8knwWt3PqsQ5Rz8JLM5lXevF7TFYiiS m+ckgFXKSlrSNWpCnjzQmK9fn2B4Hd5vTITCXXW5lwTutASZQ+6RvR9zjgSBQryMhWl1 Rk4yNWRD799lrN+pdGx4G1stwIGF80EaZx6KEBD/6zJJmh7+oVLRBVitkv3Msq6iFXow V5BP3ylCOjVMmVuPCggfMyPyPFm5pPz/I9633I3YBVh0x1zA9fuz7aN7dKyih6VTCyPP cZtQ== 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=Cx7XGX9nMoWXAs2kXG6zDVAKiXDNvSG1xe4HtFWw++s=; b=rxQLKBquGlfyoIYTuAt5aH69VpkeR5EbNK48n578NTep4w/WLetMTmYs/hbjVPqSmP FXX648zfHWSy1Z2fqlsHL9sQGRtz2BwecSjVkJw7GMLY5MIYLjorHw/NiJBcJxEgYhPe kDCKMVyXIczEL1AKaZQHD1K5XFDfb+wfJ6G6WJWjUcyJi5urzeUotCoeLUudDRO2GijF wXlGIflg5hcsMMIRwSmKhkS5iQdYOIBIkN8No5bbhqUKBMvfLNBilV+1k0qHFCtEuen6 aYBsAvB2LDS5IOpQ9G4U62KfwBIPpTHFef/DlrrJi9/C+ecmz50uX0JLNez6sXqlWx4x YUXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yJDLbQ6p; 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 h12si1674107ejg.216.2020.10.22.13.26.01; Thu, 22 Oct 2020 13:26:23 -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=yJDLbQ6p; 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 S368323AbgJVO6c (ORCPT + 99 others); Thu, 22 Oct 2020 10:58:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S368318AbgJVO6b (ORCPT ); Thu, 22 Oct 2020 10:58:31 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50E22C0613CE for ; Thu, 22 Oct 2020 07:58:31 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id c16so2624372wmd.2 for ; Thu, 22 Oct 2020 07:58:31 -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=Cx7XGX9nMoWXAs2kXG6zDVAKiXDNvSG1xe4HtFWw++s=; b=yJDLbQ6pbJk8VkT/jpMBwSJ4Ra+IOijDC0ripwsMSBbUf4TRphgWmlou+Ylw68M4oS lJhl3lVb+wnGpQPXVvIL5EwvJsct/7A9uAMzFr8AtMfdlpvJyAhfhYF4T6AR+60m0Nki H4DOCD/TbaZA77DXw5wufpfRi/YQDzkAwhFvSwoU388l/FOjVVubT7skPU6IPzOwnixo Si4X6yWAmz2dFcFI+69hp7nrzN6RqggCletd4hJBe2ZeW/nQ+LhIouFd3JR6G6lusqV6 pgbYLKsiwHOFxtVUgbXa8cnb4L5Q6CBpfZrQ3lFiabSkMvFOfDrXLVC7xNVKiq+pG/w2 Qozw== 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=Cx7XGX9nMoWXAs2kXG6zDVAKiXDNvSG1xe4HtFWw++s=; b=sJ56uf7T35vgk+bwaGhLTUg7yvEkDSdkczLtmGzV6TZxzGMqajeFRWZLXg2ZW+jGVk zvhCWoGNVcc5nhOppNngdDpUertXBX0Lb/QzeFI5CZXC5avsznIGm66oiYYqV+lWrvaL 7p8vt5Yja7DnmO0rJ9TazgJF/THVip9HT6Sjdxf2QSXWNKPPohDLVM+2DspDoVnNWbmM LBhD/ekkUF4FTHzyUQNwgc7vJGxVm1oEw9v2XVA8Znrg9RfgUxSBqG0/ORU8mHorudqy M2sWSmhjziI4Wl94xVl3yuKRNlKFFz+7ru7OjJsf1K8U2+sIrtyL3uTEDR6GgirAtY+Z EXRQ== X-Gm-Message-State: AOAM533w0K85Dx160M6JU1HMmN+X2138UoouR/qmUxnHddERHO7Ys8u7 +wFbbi49sjd7kZsA4FwK2hsUhQ== X-Received: by 2002:a1c:2b05:: with SMTP id r5mr2902447wmr.179.1603378709939; Thu, 22 Oct 2020 07:58:29 -0700 (PDT) Received: from hackbox2.linaro.org ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 130sm4348021wmd.18.2020.10.22.07.58.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 07:58:29 -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 , Al Grant , Dave Martin , linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v3 00/20] perf arm-spe: Refactor decoding & dumping flow Date: Thu, 22 Oct 2020 15:57:56 +0100 Message-Id: <20201022145816.14069-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 This is patch set v3 for refactoring Arm SPE trace decoding and dumping. In this version, it mainly addressed the comments and suggestions from mailing list (mainly from Andre Przywara, thanks!). This patch set is to refactor the Arm SPE decoding with: - Patches 01, 02 are minor cleans up for header, typos; - Patches 03, 04 and 05 are used to fix and polish the packet and payload length calculation; - Patch 06 is to add a helper to wrap up printing strings, this can avoid bunch of duplicate code lines; - Patches 07 ~ 18 are used to refactor decoding for different types packet one by one (address packet, context packet, counter packet, event packet, operation packet); it also introduces separate functions for parsing specific packet, this can allow the code more readable and easier to manage and extend code; - Patch 19 comes from Andre to dump memory tagging; - Patch 20 comes from Wei Li to add decoding for ARMv8.3 SVE extension. This patch set is cleanly applied on the top of perf/core branch with commit 7cf726a59435 ("Merge tag 'linux-kselftest-kunit-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest"), And I tested this patch set on Hisilicon D06 platform with commands "perf script" and "perf script -D". Changes from v2: - Tried best to address Andre's comments and refined patches; - Added new patches 08, 11, 13, 16 for introducing new functions for packets parsing (Andre); - Removed size condition checking for event packet (Andre); - Used PKT_XXX_GET() form to replace PKT_XXX_MASK()/PKT_XXX_SHIFT() (Andre). 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 (18): 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: 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: 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 | 43 +- .../util/arm-spe-decoder/arm-spe-decoder.h | 17 - .../arm-spe-decoder/arm-spe-pkt-decoder.c | 658 +++++++++++------- .../arm-spe-decoder/arm-spe-pkt-decoder.h | 132 +++- 4 files changed, 536 insertions(+), 314 deletions(-) -- 2.17.1