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 X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham 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 EB2B4C4332E for ; Thu, 18 Feb 2021 11:45:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B1F7F64EAD for ; Thu, 18 Feb 2021 11:45:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232132AbhBRLmP (ORCPT ); Thu, 18 Feb 2021 06:42:15 -0500 Received: from mga18.intel.com ([134.134.136.126]:58030 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232300AbhBRJ6u (ORCPT ); Thu, 18 Feb 2021 04:58:50 -0500 IronPort-SDR: +tAioSkEUKbW2pwEELF8GOBf8gy7ALL+j7OzgV26sewcbazxYoylrXwbTWoS5oW2eP6QVzwQTu co9fnlsvX2sw== X-IronPort-AV: E=McAfee;i="6000,8403,9898"; a="171127889" X-IronPort-AV: E=Sophos;i="5.81,186,1610438400"; d="scan'208";a="171127889" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Feb 2021 01:58:05 -0800 IronPort-SDR: epXotc7MyHum9s4DzIsJ+IhiuQ0vq2J4jRJbxQyd8SEoKHEn7V6iig0UfsY4pAibsSErpT4cEV 3F6I6etjX5QA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,186,1610438400"; d="scan'208";a="400427585" Received: from ahunter-desktop.fi.intel.com ([10.237.72.149]) by orsmga008.jf.intel.com with ESMTP; 18 Feb 2021 01:58:03 -0800 From: Adrian Hunter To: Arnaldo Carvalho de Melo , Jiri Olsa , Andi Kleen Cc: Alexander Shishkin , linux-kernel@vger.kernel.org Subject: [PATCH 00/11] perf intel-pt: Add limited support for tracing guest kernels Date: Thu, 18 Feb 2021 11:57:50 +0200 Message-Id: <20210218095801.19576-1-adrian.hunter@intel.com> X-Mailer: git-send-email 2.17.1 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Currently, only kernel tracing is supported and only with "timeless" decoding i.e. no TSC timestamps Other limitations and caveats VMX controls may suppress packets needed for decoding resulting in decoding errors VMX controls may block the perf NMI to the host potentially resulting in lost trace data Guest kernel self-modifying code (e.g. jump labels or JIT-compiled eBPF) will result in decoding errors Guest thread information is unknown Guest VCPU is unknown but may be able to be inferred from the host thread Callchains are not supported There is an example in the documentation of patch "perf intel-pt: Add documentation for tracing virtual machines" The patches are on top of the "Add PSB events" series. Adrian Hunter (11): perf script: Add branch types for VM-Entry and VM-Exit perf intel_pt: Add vmlaunch and vmresume as branches perf intel-pt: Retain the last PIP packet payload as is perf intel-pt: Amend decoder to track the NR flag perf machine: Factor out machines__find_guest() perf machine: Factor out machine__idle_thread() perf intel-pt: Support decoding of guest kernel perf intel-pt: Allow for a guest kernel address filter perf intel-pt: Adjust sample flags for VM-Exit perf intel-pt: Split VM-Entry and VM-Exit branches perf intel-pt: Add documentation for tracing virtual machines tools/perf/Documentation/perf-intel-pt.txt | 82 ++++++++++++++ tools/perf/arch/x86/tests/insn-x86.c | 1 + .../arch/x86/tests/intel-pt-pkt-decoder-test.c | 4 +- tools/perf/builtin-script.c | 2 + tools/perf/util/db-export.c | 2 + tools/perf/util/event.h | 6 +- .../perf/util/intel-pt-decoder/intel-pt-decoder.c | 61 +++++++++-- .../perf/util/intel-pt-decoder/intel-pt-decoder.h | 3 +- .../util/intel-pt-decoder/intel-pt-insn-decoder.c | 15 +++ .../util/intel-pt-decoder/intel-pt-insn-decoder.h | 1 + .../util/intel-pt-decoder/intel-pt-pkt-decoder.c | 12 +- .../util/intel-pt-decoder/intel-pt-pkt-decoder.h | 2 + tools/perf/util/intel-pt.c | 122 ++++++++++++++++++--- tools/perf/util/machine.c | 27 +++++ tools/perf/util/machine.h | 2 + tools/perf/util/session.c | 32 +----- 16 files changed, 307 insertions(+), 67 deletions(-) Regards Adrian