Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp589952ybg; Mon, 1 Jun 2020 09:07:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQyWEeAgNrzHxii4Iwy7M+Jpgfa+AKBBGK8Ee1qJ5ubIbyEDqKX8j2pNGu+hTmXpYNNlk/ X-Received: by 2002:a17:906:46d0:: with SMTP id k16mr2509071ejs.76.1591027668649; Mon, 01 Jun 2020 09:07:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591027668; cv=none; d=google.com; s=arc-20160816; b=ken7U/YA2z6t9XUHjy3a7XIacy3ECbRU8VAWr+8Kc2WU1NVDJpRBPeG8NLzuU7Chlj KtXaod6TTbvwPyo1jzU/6VWBEQ4jBKEPpqEbwNWcvVbagPoiwD50nbQlh3IXrThmIck6 RWDG9qJ9fZiIQt+kCVUM88JC/TjoPTqJiXoMYKCGIrbBxMiisEoQx2JTVGrdWKH3dQEI pLxir26ieergUcP7ZxFAGNo6zIgV2yXAQyo5U3JzdZrbKFKe1nkZVNa6SrrBJq7BfaVm H7mvmgfxtTpEU2qWepM2iUK3WBLriJsF3JBUSMs9+Md/YpDmmPWc0iuxID8MAR9rNuF8 pVaw== 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=YsVPd5YhzTZt1NNeYg7loV7rtr/vSLVXDQF+QqI22zc=; b=BIG/hw1YWTWA1qXxcFRNXsUCcw5oQ6JSTUWbYjvwKBUroSWMBDAPTmsnilhzs5da// 15dHC2G1C6VaX3eWVqdXpafk5l7ubi/+MJRsVAXXqus7a5SITQq36CEGf6xSVM9ywuZj seVZyv8pSy+hrzKvCZO/R63OBQmOmnYfAy6TgoVJETZdNDSYgDbkHNDCP49fUbtFWkDR qWVdTNGoikGAq6VubqyDTXqwW9J670hsTFanQLa0QgeFlrkJpVh2IhaoH2pA2RVGv1vU u63TP7RoYHNl3qWLWbw3fiYTKSZwVF6Z7n/efm6QeInfAQeYm21TPgSoseNZorSx5U3m 4iwQ== 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 bc12si4317428edb.348.2020.06.01.09.07.25; Mon, 01 Jun 2020 09:07:48 -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 S1727957AbgFAQFK (ORCPT + 99 others); Mon, 1 Jun 2020 12:05:10 -0400 Received: from mga09.intel.com ([134.134.136.24]:34246 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726073AbgFAQFJ (ORCPT ); Mon, 1 Jun 2020 12:05:09 -0400 IronPort-SDR: 2FpO9/WGhY5hW3v9UNvEockSeDi3kq0yvjGMBTcHQDGZ95KXA/LMRooR37PdPfJcgEG7A10PQ4 eiHERzHLBilw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2020 09:05:08 -0700 IronPort-SDR: /75Xv6ldvsQH3t0rXKxpWyUwIfEkS1LKFoISrqLBSZ7WmC4XXYoxDKdAsmQBAjWdktr+Th7EqR CuODwSLE2Rbw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,461,1583222400"; d="scan'208";a="293240866" Received: from linux.intel.com ([10.54.29.200]) by fmsmga004.fm.intel.com with ESMTP; 01 Jun 2020 09:05:08 -0700 Received: from [10.249.230.65] (abudanko-mobl.ccr.corp.intel.com [10.249.230.65]) by linux.intel.com (Postfix) with ESMTP id 18245580378; Mon, 1 Jun 2020 09:05:05 -0700 (PDT) Subject: [PATCH v5 13/13] perf record: introduce --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: Organization: Intel Corp. Message-ID: <8ffc9f9f-af58-deea-428b-f8a69004e3cb@linux.intel.com> Date: Mon, 1 Jun 2020 19:05:04 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 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 Introduce --ctl-fd[-ack] options to pass open file descriptors numbers from command line. 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/builtin-record.c | 6 ++++++ tools/perf/util/record.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 0394e068dde8..fbe5069eb5d7 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, 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; -- 2.24.1