Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5751784rwd; Wed, 24 May 2023 06:23:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7kv58owOeA7/pO8pW0mJZodnjG1N8rcFHsX50YdHMft2RCGAwiaxpRdA7KGlc2UqjtdmRH X-Received: by 2002:a05:6a21:9201:b0:106:4e09:151f with SMTP id tl1-20020a056a21920100b001064e09151fmr15651647pzb.60.1684934620398; Wed, 24 May 2023 06:23:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684934620; cv=none; d=google.com; s=arc-20160816; b=Hjbp5iYrVdz2ciCE/sTYSh4MCconvVKSoRm91Xjjln7kaSjHYoGbAK3JYs41kwXdVi dWGlU4xxoX3eero91Z4x68IszN303KxKK5z+pw3JxZ9tCBwOp1rCLWRsZZz1a5zxvTWp MtTbhi0MhPluYK5RwgJGtBR07ssipvZfZnTPI3XI7yqwZzJDZQT5G/F9hfTfKf+W3XOw vQwvLQk4JawXJdeLrW08XWmy6OunjFc8WyPEnF8ynymsR1A7QtXywBHNNj8I5ogjjueT p/2k9wlFKX7jnpe17VUa3SK/S09oiJpRA4eIzEJ0xSxjUX+bz8rqbIFhCjglT9B9rdzx noEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=g5cO4ziBiiCJrv2C4g32/icjJHSNf/5hGYbFSDlzrr8=; b=1KAPeAFacA/OdEZmBkINhgve+KaFJGPNv2T9I6Wyph/WzBr+gklHOTEDBDsEMmhL+d eTaL2YRcA3JV1ouZaw+vSawkuA5qG+9A4CCk126bTkUcErVRJ+4CUt/jgC/sc3senUiz HdceytWCkORvjnj7Wi11FETlXUFTFvRBnoOFKx1lzZwxA83aKOqKjWz4WO/wl+bL7FSr Wiz2NfQaXkTW1zSEWTU+qv4YQcwSE+/Muw942WUTN15Xsr+d625vBNREmIv4wT2Zco4b MeiV+93U+sKOeUy8FHjRKZ2LooSotl3Ec0s9peP5PfbJe8bwBdtHQ9NM2EoHU1jGhQDn GitA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t29-20020a63b25d000000b005183e6198aasi2802872pgo.794.2023.05.24.06.23.25; Wed, 24 May 2023 06:23:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232974AbjEXNU1 (ORCPT + 99 others); Wed, 24 May 2023 09:20:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229632AbjEXNUO (ORCPT ); Wed, 24 May 2023 09:20:14 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8125F9B; Wed, 24 May 2023 06:20:12 -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 BCA1D1042; Wed, 24 May 2023 06:20:56 -0700 (PDT) Received: from localhost.localdomain (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1B6753F840; Wed, 24 May 2023 06:20:08 -0700 (PDT) From: James Clark To: coresight@lists.linaro.org, denik@chromium.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 0/4] perf cs-etm: Track exception level Date: Wed, 24 May 2023 14:19:54 +0100 Message-Id: <20230524131958.2139331-1-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 (4e111f0cf0) James Clark (4): 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: Track exception level perf cs-etm: Add exception level consistency check .../perf/util/cs-etm-decoder/cs-etm-decoder.c | 13 +- .../perf/util/cs-etm-decoder/cs-etm-decoder.h | 4 +- tools/perf/util/cs-etm.c | 220 +++++++++--------- tools/perf/util/cs-etm.h | 5 +- 4 files changed, 126 insertions(+), 116 deletions(-) -- 2.34.1