Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1376762pxy; Thu, 29 Apr 2021 06:00:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycpg4ZVVvyAa62DjgoGGuqYOh0jIXbyBgf9KSyfNUk4ma52268BiwHDUsy4ljYlUEtBa2X X-Received: by 2002:a17:906:747:: with SMTP id z7mr7951464ejb.252.1619701220350; Thu, 29 Apr 2021 06:00:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619701220; cv=none; d=google.com; s=arc-20160816; b=ipSQrjECzenumcJ+VI2t4wR3kShH7NAtgDHZV7Fz+es6s0IzY9TdjgC7ibwEhg3GEC MAvf/m4oXsoTJOAgyWxU1h3PGcNtTjv62yYISpzfha1XPo6zdJqBHtreiCQyocn4Hxnm 6VhxYuC567ErLnOzLgro/yhbpnLf4eU/GW3LDO6POoIK05Cg8MGm/VD8XmHi/Ku0IZgR cfgQxvheKSsuyvPPHtFK0JBtcZmGgJUiNHXjCc9Ol/26zcognHeCn+iS+NYsKDqmcTbC yoEEPJ5EoecYGdG3XqNMhxq3XbPBZEYqrsqh6zcYdlc66/wKW9FMvDNmHcJYJRNn8gFB HwpQ== 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=pCc6V7wRJ6UKxLcee1ADrk1fmoJQU0Gsh59qgna4BNs=; b=00ZA1OGCbHVK7UpQWG9NS7dGLL/zr5K2d4AlzuTcOUUnUxxQnaxJ82cMSW0E55fBBA /1duddvSeAeXvUFhEwrRws5eWVQrNcnPrSoIoBFpabIFgrbOiPwy22lt/OJzHFw82c+6 qVU+I1VTjUy4wMHmjROH+QqcWEIQTdUmRbSlywLVHu+KJcdJAHPGKVoc6xr9zcuKii1O +EM423UwEQ0Bm08WnROLBrN/3qudAXwZ7MkNmTyB5EpzAgHnhDjGc9qH24eY7ZqRe5ZZ 6xVylgnkEDN4ckJc+H80r4jwIpAElSEH2b74uB2MNGfaXqzfcGJYHjQb3y3q+ooSvaQ5 iVTQ== 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 m18si3166507edd.73.2021.04.29.05.59.44; Thu, 29 Apr 2021 06:00:20 -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 S237501AbhD2M7c (ORCPT + 99 others); Thu, 29 Apr 2021 08:59:32 -0400 Received: from mga17.intel.com ([192.55.52.151]:50831 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237249AbhD2M7a (ORCPT ); Thu, 29 Apr 2021 08:59:30 -0400 IronPort-SDR: 9uBdN6cB5fPL5Eao+tW9nnb0/QsEQ4jAuGgHVaBGLSSMku5FEiQAOryM8Fj72TRMoy7we0+f7j n3tj2GTlR6tA== X-IronPort-AV: E=McAfee;i="6200,9189,9969"; a="177107405" X-IronPort-AV: E=Sophos;i="5.82,259,1613462400"; d="scan'208";a="177107405" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2021 05:58:32 -0700 IronPort-SDR: GyJfIYFKBglJTryXGo0ONH3FzCoGhM8ufuyZfydwHNZ/lyJo4ESO1ER006RQU8eb6z7lfIQ8uQ 1RJfoUaskorQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,259,1613462400"; d="scan'208";a="537361554" Received: from ahunter-desktop.fi.intel.com ([10.237.72.174]) by orsmga004.jf.intel.com with ESMTP; 29 Apr 2021 05:58:31 -0700 From: Adrian Hunter To: Arnaldo Carvalho de Melo , Jiri Olsa , Andi Kleen Cc: linux-kernel@vger.kernel.org Subject: [PATCH 00/12] perf intel-pt: Add more support for VMs Date: Thu, 29 Apr 2021 15:58:42 +0300 Message-Id: <20210429125854.13905-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 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. 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