Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp65999pxy; Fri, 30 Apr 2021 00:03:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJDqnWcUfjZNnCshxB4FfgIGLuer74tRo3jHtfIt4Ggy94rASm1oZnxMPScRLdmgh7xgka X-Received: by 2002:a17:902:9008:b029:e6:f37a:2183 with SMTP id a8-20020a1709029008b02900e6f37a2183mr3714375plp.49.1619766232414; Fri, 30 Apr 2021 00:03:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619766232; cv=none; d=google.com; s=arc-20160816; b=ZzRC0Xgxc7SsK1jQ2ZZRhznkJKa8qVrhwYPfLt197w0VBPMi2q2MmX/4jA33A62D7e 1xWWvocE9uEH4hQYExZ1pjC3I5jhW6diKlEhqOOyo/Ud92mZrk0Oj3gLBg/Dh5xcs184 Pf677tm9o7+RaetHPi0ZERX8cR1EVJ2DdL9AbI7N7RTqYd8RJOsDndYPrVCvfQAfaTb7 s4EJgD61pEAaNv3RMy1u47EERLWGFihEPUWyxr/tSzFM4Kh/ZOWBMssEBcmeaC0XXEAc 8opB+ZhB42N/btXC0wBoAGsPCZ0N0P1jWAp3xFqggj/bPhESL4hfjIsn3W47rfoL4qPS 5VwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=RnW5pHqyCRd5HtboL/uiphaLUD9OEST89U6WDs9PZac=; b=t0gBkFdX/ih/jpF3HL33nbYxMdIRGyinBcneHFFdD4n5mV8l1fY4CRCKXEGxO4epGM ONFVfVJFcVNSCZohpUCyWe0haSKZ7Tr301Bo3IzBWmRRSxQ9xrq5HbMT+djBBT8VfOHu iYHdOfqeBsIaHxwZzmYAzqahbmnBtV97/e5ssgZ4RTkXN6GNk+wpBMn4/HdT/g4AhoCj OqdmsoUP/9BwmgU+H8ubHYb0O+EuySShohKXVigs3QFHaD/jXpMRse01ztxGCskANmsd 21M86yGXnDchIO1QfOQEeBgErVqgi15xxiYXzNaeVVSqrrvuDbfd3JrF518oWnEXpZLa hpLw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q17si2549612plk.424.2021.04.30.00.03.20; Fri, 30 Apr 2021 00:03:52 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229780AbhD3HDg (ORCPT + 99 others); Fri, 30 Apr 2021 03:03:36 -0400 Received: from mga18.intel.com ([134.134.136.126]:9042 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229610AbhD3HDf (ORCPT ); Fri, 30 Apr 2021 03:03:35 -0400 IronPort-SDR: ue9qnbJL2KwfpZtBjGY6l/oHnWzv5u2qjzHw/aDgCxdzNYCu2PFCh2xlia4Ee6DLT7O2SsW5lT hx/f43avkNCA== X-IronPort-AV: E=McAfee;i="6200,9189,9969"; a="184689673" X-IronPort-AV: E=Sophos;i="5.82,260,1613462400"; d="scan'208";a="184689673" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Apr 2021 00:02:47 -0700 IronPort-SDR: X2XKT3jQHMoD7v+G+pSDWd6Xo+ttfMpu5tuu4A7ztJDUufzvom1+9RMiJnzdmyRz4hWcA86fZR kVEshNPeC8gA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,260,1613462400"; d="scan'208";a="404492217" Received: from ahunter-desktop.fi.intel.com ([10.237.72.174]) by orsmga002.jf.intel.com with ESMTP; 30 Apr 2021 00:02:46 -0700 From: Adrian Hunter To: Arnaldo Carvalho de Melo , Jiri Olsa , Andi Kleen Cc: linux-kernel@vger.kernel.org Subject: [PATCH V2 00/12] perf intel-pt: Add more support for VMs Date: Fri, 30 Apr 2021 10:02:57 +0300 Message-Id: <20210430070309.17624-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 Here is V2, see changes list below. Previously, limited support was added for timeless decoding of VM traces. Primarily, these patches add support for decoding traces of virtual machines using timestamps, assuming the VMX TSC Offset is unchanging during perf record, and VMX TSC Scaling is not used. The first 3 patches add an itrace option to allow timeless decoding even if timestamps have been recorded. The next 2 patches add an option to perf inject to do "VM Time Correlation" i.e. sort out the timestamps. There are 5 preparation patches, then the main changes in patch "perf intel-pt: Add VM Time Correlation to decoder". The final patch adds documentation which provides an example. Changes in V2: perf inject: Add facility to do in place update Error out instead of prompt to continue perf inject: Add --vm-time-correlation option Tighten up parsing of "dry-run" perf intel-pt: Add a tree for VMCS information Rename lookup_vmcs to findnew_vmcs perf intel-pt: Add VM Time Correlation to decoder Rename lookup_vmcs to findnew_vmcs perf intel-pt: Parse VM Time Correlation options and set up decoding Rename lookup_vmcs to findnew_vmcs Explain "dry-run" option Adjust example for 'perf inject' changes Adrian Hunter (12): perf auxtrace: Add Z itrace option for timeless decoding perf intel-pt: Move synth_opts initialization earlier perf intel-pt: Support Z itrace option for timeless decoding perf inject: Add facility to do in place update perf inject: Add --vm-time-correlation option perf auxtrace: Allow buffers to be mapped read / write perf intel-pt: Let overlap detection handle VM timestamps perf intel-pt: Add a tree for VMCS information perf intel-pt: Pass the first timestamp to the decoder perf intel-pt: Better 7-byte timestamp wraparound logic perf intel-pt: Add VM Time Correlation to decoder perf intel-pt: Parse VM Time Correlation options and set up decoding tools/perf/Documentation/itrace.txt | 1 + tools/perf/Documentation/perf-inject.txt | 10 + tools/perf/Documentation/perf-intel-pt.txt | 114 +++- tools/perf/builtin-inject.c | 73 ++- tools/perf/util/auxtrace.c | 8 +- tools/perf/util/auxtrace.h | 14 +- tools/perf/util/data.c | 3 +- tools/perf/util/data.h | 1 + tools/perf/util/header.c | 5 + .../perf/util/intel-pt-decoder/intel-pt-decoder.c | 723 ++++++++++++++++++++- .../perf/util/intel-pt-decoder/intel-pt-decoder.h | 20 +- tools/perf/util/intel-pt-decoder/intel-pt-log.h | 5 + tools/perf/util/intel-pt.c | 224 ++++++- tools/perf/util/session.c | 6 +- 14 files changed, 1169 insertions(+), 38 deletions(-) Regards Adrian