Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp460779ybg; Wed, 3 Jun 2020 05:27:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxExOFLPSKaTFchplRqxoaY+mtC8oDSsZlh4vcDlnZe6RTf9m1WASEh/qpq0kwe6FDKBC8n X-Received: by 2002:a50:f983:: with SMTP id q3mr32220774edn.259.1591187229848; Wed, 03 Jun 2020 05:27:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591187229; cv=none; d=google.com; s=arc-20160816; b=EcLI1yPk7IkwniC8NEQRWhafYTkQ/j8jsbinNotk1dLeU7c2Wn729VMv04dTfRrf68 9itv1icEYCpPU+ogJlOpKTG5hIjgDxNRhI3t/veWDcT0hm4RuziRkDd9PPx/C39oTqo4 J/c9SVP4iDgC5Yg07fWVqi1lu12h0n36x66Rdw3Eaz6RC6+DVgh8bay5x3BoZtPcDX72 IxSof0Eq+uweeBGyUs80dUwy8EV6Tn2/2LDUjTmCyTSMeyJiKr5+qJ3CtYuZb2FWdnuC uZmFHUNeg6V2stlBOoIhOxcJtZyqWbY3gUBRfrz+kqtSV603dHKXZYeFXFFGLsg2c+5x td+g== 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:from:references:cc:to:subject:ironport-sdr :ironport-sdr; bh=iich0HG3a6iQxlLov3KDYxUmWEskDVuTkMbHan5bB2s=; b=Lu5YCjxVKLBA/B5z4RQKBMbTKCLNDQdKjPm6f6LGChXtkJxWqvtyHNzFwqsZ1JAR+7 XiKwyDZw/BXsf5VccGusk0gr37N7Tmvr2WoXVrSrsOX114ZYIwFTl63JK2sjb1qILQwy 2d87N6NXptWjMQj/oCxiYl8NPeaq6eOIEowEIQtClP82/Su93xa7e993iyMD+eL3RcBB JleTwDRFj+QY4tFRR/YQVpQX4NS6BrVGzm8Z71CvCSC4LAscreAC8+csQZkv2NdJINQD Tz2d0+eK9LmlCD9Hgu+GTlbkpxXe8Xf3h5H1Uwcc62eRX0E1Aqx3dZcbImq1DJ4PDCq+ TEAw== 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 u23si1010407ejx.512.2020.06.03.05.26.47; Wed, 03 Jun 2020 05:27:09 -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 S1726072AbgFCMY5 (ORCPT + 99 others); Wed, 3 Jun 2020 08:24:57 -0400 Received: from mga01.intel.com ([192.55.52.88]:16382 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725833AbgFCMY4 (ORCPT ); Wed, 3 Jun 2020 08:24:56 -0400 IronPort-SDR: V0e7Czvd3FiJsWqowlZCx3hcQkivFvOK0mp8/J6zRORlbJPjV/zdEkjtg/LV3wgBG/N98dt9YA JvWzRo5NluzA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2020 05:24:56 -0700 IronPort-SDR: FSqn2gOn54W95GLSaBh5budl0/4Glu+k+PTCeuwbdEly+Eknx7XOWSUzJsepxlRsvQksR4+taE tHLRbp6QZydw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,467,1583222400"; d="scan'208";a="269059414" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.157]) ([10.237.72.157]) by orsmga003.jf.intel.com with ESMTP; 03 Jun 2020 05:24:53 -0700 Subject: Re: [PATCH v6 13/13] perf record: introduce --ctl-fd[-ack] options To: Alexey Budankov , Arnaldo Carvalho de Melo Cc: Jiri Olsa , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , Andi Kleen , linux-kernel References: From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: Date: Wed, 3 Jun 2020 15:24:20 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: 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 On 1/06/20 11:20 pm, Alexey Budankov wrote: > > Introduce --ctl-fd[-ack] options to pass open file descriptors numbers > from command line. Extend perf-record.txt file with --ctl-fd[-ack] perf-record.txt change seems to be missing. > 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/builtin-record.c | 10 ++++++++++ > tools/perf/util/record.h | 2 ++ > 2 files changed, 12 insertions(+) > > diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c > index 0394e068dde8..8494ce964738 100644 > --- a/tools/perf/builtin-record.c > +++ b/tools/perf/builtin-record.c > @@ -1749,6 +1749,9 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) > perf_evlist__start_workload(rec->evlist); > } > > + if (evlist__initialize_ctlfd(rec->evlist, opts->ctl_fd, opts->ctl_fd_ack)) > + goto out_child; > + > if (opts->initial_delay) { > pr_info(EVLIST_DISABLED_MSG); > if (opts->initial_delay > 0) { > @@ -1895,6 +1898,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) > record__synthesize_workload(rec, true); > > out_child: > + evlist__finalize_ctlfd(rec->evlist); > record__mmap_read_all(rec, true); > record__aio_mmap_read_sync(rec); > > @@ -2380,6 +2384,8 @@ static struct record record = { > }, > .mmap_flush = MMAP_FLUSH_DEFAULT, > .nr_threads_synthesize = 1, > + .ctl_fd = -1, > + .ctl_fd_ack = -1, > }, > .tool = { > .sample = process_sample_event, > @@ -2581,6 +2587,10 @@ static struct option __record_options[] = { > "libpfm4 event selector. use 'perf list' to list available events", > parse_libpfm_events_option), > #endif > + OPT_INTEGER(0, "ctl-fd", &record.opts.ctl_fd, > + "Listen on fd descriptor for command to control measurement ('enable': enable events, 'disable': disable events)"), > + OPT_INTEGER(0, "ctl-fd-ack", &record.opts.ctl_fd_ack, > + "Send control command completion ('ack') to fd ack descriptor"), > OPT_END() > }; > > diff --git a/tools/perf/util/record.h b/tools/perf/util/record.h > index da138dcb4d34..4cb72a478af1 100644 > --- a/tools/perf/util/record.h > +++ b/tools/perf/util/record.h > @@ -70,6 +70,8 @@ struct record_opts { > int mmap_flush; > unsigned int comp_level; > unsigned int nr_threads_synthesize; > + int ctl_fd; > + int ctl_fd_ack; > }; > > extern const char * const *record_usage; >