From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1158C7EE25 for ; Mon, 12 Jun 2023 11:36:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229777AbjFLLgR (ORCPT ); Mon, 12 Jun 2023 07:36:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236484AbjFLLf6 (ORCPT ); Mon, 12 Jun 2023 07:35:58 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B39A276A3; Mon, 12 Jun 2023 04:14:09 -0700 (PDT) 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 9AB4F1FB; Mon, 12 Jun 2023 04:14:54 -0700 (PDT) Received: from e127643.broadband (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id F0C093F587; Mon, 12 Jun 2023 04:14:05 -0700 (PDT) From: James Clark To: coresight@lists.linaro.org Cc: James Clark , Suzuki K Poulose , Mike Leach , Leo Yan , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , John Garry , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 0/5] perf cs-etm: Track exception level Date: Mon, 12 Jun 2023 12:13:57 +0100 Message-Id: <20230612111403.100613-1-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org Changes since v2: * Rename prev_thread -> prev_packet_thread and prev_el -> prev_packet_el * Add a comment about tracking the previous packet's thread Changes since v1: * Always assume host kernel when the trace was captured at EL1 (nVHE) * Fix EL validation to work with ETMv3 * Add a commit to make PID format accessible from struct cs_etm_auxtrace ====== Some fixes to support an issue reported by Denis Nikitin where decoding trace that contains different EL1 and EL2 kernels can crash or go into an infinite loop because the wrong kernel maps are used for the decode. This still doesn't support distinguishing guest and host userspace, we'd still have to fix the timestamps and do a bit more work to correlate that. And I've removed PERF_RECORD_MISC_HYPERVISOR as a possible outcome of cs_etm__cpu_mode(). As far as I know this could never have been returned anyway because machine__is_host(machine) was always true due to session.machines.host being hard coded. And I'm not sure of the relevance of the difference between PERF_RECORD_MISC_KERNEL and PERF_RECORD_MISC_HYPERVISOR in this scenario. The first commit is a tidy up, second fixes a bug that I found when comparing the exception level and thread of branch records, the third is the main fix, and the last commit is some extra error checking. Applies to acme/perf-tools-next (42713dafc) James Clark (5): perf cs-etm: Only track threads instead of PID and TIDs perf cs-etm: Use previous thread for branch sample source IP perf cs-etm: Make PID format accessible from struct cs_etm_auxtrace perf cs-etm: Track exception level perf cs-etm: Add exception level consistency check .../perf/util/cs-etm-decoder/cs-etm-decoder.c | 33 +- .../perf/util/cs-etm-decoder/cs-etm-decoder.h | 4 +- tools/perf/util/cs-etm.c | 282 ++++++++++-------- tools/perf/util/cs-etm.h | 13 +- 4 files changed, 184 insertions(+), 148 deletions(-) -- 2.34.1