Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp1801576pxa; Sat, 29 Aug 2020 03:56:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysXEeO7U6qgCQDAwty77PI+5H/Spy/imee3cnALcs+J6VqIyT5FOcQonZiFAgTMEy2Wxr8 X-Received: by 2002:a17:906:fa01:: with SMTP id lo1mr2405845ejb.394.1598698580098; Sat, 29 Aug 2020 03:56:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598698580; cv=none; d=google.com; s=arc-20160816; b=IYu8aSdtH+B3fdppuqHa5p+AN3UtJFuRctvaEiKbY3uOfEJk8fMxpQofLn2JkQDj27 utq1xch4E5b3IyijZmOi+m5QPP6ZKPcOp3qOEuc2ChYHv+CPqt9lAC/5fr7OdDF6XDhZ 0av6QWgMvBo5WCivlq6AzafBfRKZpPjbTEsiS/IYgTedIf0Nnbnlnm81YszsYVmS2pJi V8+eDfgnyznCA0pPj/35LU+O1tvQpxqSSoAxMojca/Iu9nmS7sIAX7zOY74YEZBM2uBR LMBvNjwUdBTY95n0VBCsNfhEGXNmxTDS4ugi1/w5UIdbO1NOmov5vkOjZL6cg4FwYGBX yX+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=VEM0BOuAiEg+m1VX5r+vwWAXDHGNS9FlAGU3a9Z4068=; b=pZ69a2LOWKgpkCuYcRDqpoJN8rTgv11bSGeslVqEJ3TlBl7bxcrOB8iNh5Idp1ao3b qoCDLBkfkJKHQ71BO9Ykiwowdjb2fyPK4CRpUJhj41t+hfgIonndhcrlw84StNDDqIIP wMpucCZFTwWYRhrdhfBifIGHSgUbM9/OivC1kHQqLSFa2TMP5ifK4aGQxCmDjpDFJNam 4ONrL9EtZjrKPaVDrMdEmj0lvEn0Rf46gqVB/H8V7JKgXDiGPN0XR7GGgsK6Lc8bHcb7 Avp5TYGVgUEzllSVtA0e0wO+eHbIRNCCiO1VHifXlikIdijE2hiL1MwkEjNd/A4HDqRx ND+A== 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 kt14si1433843ejb.281.2020.08.29.03.55.57; Sat, 29 Aug 2020 03:56: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 S1727884AbgH2Kxq (ORCPT + 99 others); Sat, 29 Aug 2020 06:53:46 -0400 Received: from mga01.intel.com ([192.55.52.88]:17379 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728001AbgH2KvG (ORCPT ); Sat, 29 Aug 2020 06:51:06 -0400 IronPort-SDR: Lde55gVD5idSMifCUzcI+/j9tE0tD9W+rn1DJJBsvj3G+oVl8DYPXVBtvXMH6yz5edsNz2CwTv AebJG9VvdtVQ== X-IronPort-AV: E=McAfee;i="6000,8403,9727"; a="174838405" X-IronPort-AV: E=Sophos;i="5.76,367,1592895600"; d="scan'208";a="174838405" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2020 03:51:06 -0700 IronPort-SDR: yE+eA3Vo+1a254ts7m8PmmutACFQAGpiK26rXpUHMdcJnukZteCMbbcVF/zg7lLuCOEqw1bmvV aMTQ8K8L96Zg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,367,1592895600"; d="scan'208";a="313853181" Received: from ahunter-desktop.fi.intel.com ([10.237.72.73]) by orsmga002.jf.intel.com with ESMTP; 29 Aug 2020 03:51:04 -0700 From: Adrian Hunter To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Andi Kleen , Alexey Budankov , Namhyung Kim , linux-kernel@vger.kernel.org Subject: [PATCH 6/6] perf intel-pt: Document snapshot control command Date: Sat, 29 Aug 2020 13:50:15 +0300 Message-Id: <20200829105015.10800-7-adrian.hunter@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200829105015.10800-1-adrian.hunter@intel.com> References: <20200829105015.10800-1-adrian.hunter@intel.com> Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The documentation descibes snapshot mode. Update it to include the new snapshot control command. Signed-off-by: Adrian Hunter --- tools/perf/Documentation/perf-intel-pt.txt | 23 +++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/tools/perf/Documentation/perf-intel-pt.txt b/tools/perf/Documentation/perf-intel-pt.txt index d5a266d7f15b..b4414f75ad0b 100644 --- a/tools/perf/Documentation/perf-intel-pt.txt +++ b/tools/perf/Documentation/perf-intel-pt.txt @@ -558,7 +558,7 @@ The mmap size and auxtrace mmap size are displayed if the -vv option is used e.g Intel PT modes of operation ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Intel PT can be used in 2 modes: +Intel PT can be used in 3 modes: full-trace mode sample mode snapshot mode @@ -571,7 +571,8 @@ Sample mode attaches a Intel PT sample to other events e.g. perf record --aux-sample -e intel_pt//u -e branch-misses:u -Snapshot mode captures the available data when a signal is sent e.g. +Snapshot mode captures the available data when a signal is sent or "snapshot" +control command is issued. e.g. using a signal perf record -v -e intel_pt//u -S ./loopy 1000000000 & [1] 11435 @@ -582,7 +583,23 @@ Note that the signal sent is SIGUSR2. Note that "Recording AUX area tracing snapshot" is displayed because the -v option is used. -The 2 modes cannot be used together. +The advantage of using "snapshot" control command is that the access is +controlled by access to a FIFO e.g. + + $ mkfifo perf.control + $ mkfifo perf.ack + $ cat perf.ack & + [1] 15235 + $ sudo ~/bin/perf record --control perf.control,perf.ack -S -e intel_pt//u -- sleep 60 & + [2] 15243 + $ ps -e | grep perf + 15244 pts/1 00:00:00 perf + $ kill -USR2 15244 + bash: kill: (15244) - Operation not permitted + $ echo snapshot > perf.control + ack + +The 3 Intel PT modes of operation cannot be used together. Buffer handling -- 2.17.1