Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2249093ybb; Fri, 27 Mar 2020 01:53:01 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuWSSTwQCiVAwf4xg6K4XSNa0ERJk0cL5Vd6IKYWqem7xbMOISCkqmAj4gL7NEm77tgGaqe X-Received: by 2002:a05:6830:23ba:: with SMTP id m26mr9395091ots.133.1585299181732; Fri, 27 Mar 2020 01:53:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585299181; cv=none; d=google.com; s=arc-20160816; b=SsZ9lps+gQjtJ92pKrsVP5Kh/3EXkavl0HzWtzFpTA5v7q0f08PVYVjGS0DFq+Ksqr /crSyzoIRWOsfxDoDOSI2e9bV2i8trC6VFiT7CqUGwW5IKp3WOmqKUGA+LyOoEn1V4Pz /LshJXuNYd+IRUT9avnak1spkR8V/F1yYZz9suIgESNEe2e+cWvLVRtcC1SZVoPD3Vy8 54TMLQrb764/GvE2QgrZF0C4IDQUwT7QPBIy7BImymhj/RTSFIRwpfcVub819Bof573X Jytt89Xr1e8WcIPAsKmlpKtzrwNRnK7qbEWzV43cxiar3+h+cNLZDEy2CuwNq8nGUm4w rL5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:references:cc:to:from:subject:ironport-sdr :ironport-sdr; bh=6G1qy/l9IGi5YLQ/2HOreeSo5Ly4pRKad5LtQjearA8=; b=NypkEJqUBFFPgB+fRV87WK8X9C/hGAHDhDyEUkVBtNSWOmQr+GZKy8tfNzxDg4oZqn E0hEb0sXcsudzP70vvz/xnhFG0lIYRiLchoVuF689p5+PCQnMBhnU6H7wr2rcbdYM2Oi 7ScZ4qYHedPvzmSf93Xjx0o2qw3IQtu/0ZmczEhd+U7lDXfiKavJb7W8rnBvBv1NQxGs czUIWDn+oSXbtYoDgWo3IRbrH9d6AEAm+0MWF6Q23ZhBcYFO6vzSvywWiAx6fknxDy4R UvyHMbdezkFq/YloLbPziR4WlW/XbLm5pN3ninTlUnuq8TPlhFKKgUSvafYKthWzx9bf MYiQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id o85si2347151ooo.19.2020.03.27.01.52.48; Fri, 27 Mar 2020 01:53:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726284AbgC0IvY (ORCPT + 99 others); Fri, 27 Mar 2020 04:51:24 -0400 Received: from mga12.intel.com ([192.55.52.136]:7905 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726115AbgC0IvY (ORCPT ); Fri, 27 Mar 2020 04:51:24 -0400 IronPort-SDR: 6j5esvUHKvAeZ9Y/F2PE3wWx0/fceg6c2p5zW2UMgIpYkt6WbULsN3iqeHtou/ji+KkFG99Cg5 PL73eqACkU6g== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2020 01:51:13 -0700 IronPort-SDR: sHY7cypbDlo4NkayDasK7CNx7hNSrEQ+DMzJqLeqeEloVp3EGy2WHUheQrKRHiLG+nA1kXWwUY jVNp+Pig/8dA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,311,1580803200"; d="scan'208";a="282786147" Received: from linux.intel.com ([10.54.29.200]) by fmsmga002.fm.intel.com with ESMTP; 27 Mar 2020 01:51:12 -0700 Received: from [10.249.36.56] (abudanko-mobl.ccr.corp.intel.com [10.249.36.56]) by linux.intel.com (Postfix) with ESMTP id C248B580479; Fri, 27 Mar 2020 01:51:09 -0700 (PDT) Subject: [PATCH v1 8/8] perf docs: extend record mode docs with info on --ctl-fd[-ack] options From: Alexey Budankov To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , Andi Kleen , linux-kernel References: <825a5132-b58d-c0b6-b050-5a6040386ec7@linux.intel.com> Organization: Intel Corp. Message-ID: <7ed99d49-8274-17ae-8792-6ae0a5f040e3@linux.intel.com> Date: Fri, 27 Mar 2020 11:51:08 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <825a5132-b58d-c0b6-b050-5a6040386ec7@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Extend perf-record.txt file with --ctl-fd[-ack] options description. Document possible usage model introduced by --ctl-fd[-ack] options by providing example bash shell script. Signed-off-by: Alexey Budankov --- tools/perf/Documentation/perf-record.txt | 37 ++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt index 7f4db7592467..939e8eb864fe 100644 --- a/tools/perf/Documentation/perf-record.txt +++ b/tools/perf/Documentation/perf-record.txt @@ -587,6 +587,43 @@ Make a copy of /proc/kcore and place it into a directory with the perf data file Limit the sample data max size, is expected to be a number with appended unit character - B/K/M/G +--ctl-fd:: +--ctl-fd-ack:: +Listen on ctl-fd descriptor for command to control measurement ('r': resume, +'p': pause). Optionally send control command completion ('a') to fd-ack descriptor +to synchronize with the controlling process. Example of bash shell script +to resume and pause measurements: +#!/bin/bash + +ctl_dir=/tmp/ + +ctl_fifo=${ctl_dir}perf_ctl.fifo +test -p ${ctl_fifo} && unlink ${ctl_fifo} +mkfifo ${ctl_fifo} +exec {ctl_fd}<>${ctl_fifo} + +ctl_ack_fifo=${ctl_dir}perf_ctl_ack.fifo +test -p ${ctl_ack_fifo} && unlink ${ctl_ack_fifo} +mkfifo ${ctl_ack_fifo} +exec {ctl_fd_ack}<>${ctl_ack_fifo} + +perf record -D -1 -e cpu-cycles -a \ + --ctl-fd ${ctl_fd} --ctl-fd-ack ${ctl_fd_ack} \ + -- sleep 30 & +perf_pid=$! + +sleep 5 && echo 'r' >&${ctl_fd} && read -u ${ctl_fd_ack} r1 && echo "resumed(${r1})" +sleep 10 && echo 'p' >&${ctl_fd} && read -u ${ctl_fd_ack} p1 && echo "paused(${p1})" + +exec {ctl_fd_ack}>&- +unlink ${ctl_ack_fifo} + +exec {ctl_fd}>&- +unlink ${ctl_fifo} + +wait -n ${perf_pid} +exit $? + SEE ALSO -------- linkperf:perf-stat[1], linkperf:perf-list[1], linkperf:perf-intel-pt[1] -- 2.24.1