Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1772741ybh; Fri, 17 Jul 2020 00:09:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5uuyp/xZLM3pFhMobsxG9wPBH2SJXeeUGHvzqia/vkZMD6V8OsgCKAeRZ/Tco9FOJvCcx X-Received: by 2002:a17:906:9147:: with SMTP id y7mr6845828ejw.399.1594969743366; Fri, 17 Jul 2020 00:09:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594969743; cv=none; d=google.com; s=arc-20160816; b=xMlWOFjKH9LId+WKj5c+JBjCMoux7xkTR5iCHfKwIsSb069CNZID0wR7t5hCVLh0/Z P+2SO9tUD5uCsfaWru7/u46H6vfe70krvmnvcHxLdz8bnptpHDRcwpPh7P0oWCbGe6Aa V29B9gILNUldzjxwI7lPgbVNW2zhXGpN9YhNOjBT2Ue70ha4huGLf5X8LIA/4WMQx/Xf TYNphrl6WHCPz6B9vS6tjDE1aNSfhhsco+Nt1JyHQXPufGlnetPnjlligclrT6R3oskr YVqiz8pUMjnPXiYklxhg5nTnB1SGKwQY7ovDYorfxKkFbUzEAvn18uTA4jEd0zz/3MBS t1xQ== 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=m6UADE0EUlMfRtu40OfL0t2AK5Bie23b42JhGZ0vU7o=; b=RYOF6r2lJqhwqX7RiJZZmPeA84YctKdsRQrarwK9cLn4vuh9Z+MIkGx3aFJ3J5wKmo dfH2Y3rmv8Ta9SR6y3TFbgtq9wkkq95qAP5ukVKPDuv/Ux3MZ9iNwMcrIDT87jOoOzXY cG7xTf/kiXIslVQH0Kp8uEFF09UyHR5qYerlwtW47BLTIRf4y6AbUf077WWaHmimZY8/ 69eHdB0N6vsXXdn1RQvgIkX3ElHw103MHxnV6Gau04ygmBPi9gnGSzdyFG5ARiHRLYcE Z/wyMYk/WJFu/nRVCSwSZ0+CzgG+n2T1KdiQGBXgIeORxEwHkCAd/noFIoFNXx0xRke7 qiAg== 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 t22si4655749eje.467.2020.07.17.00.08.40; Fri, 17 Jul 2020 00:09:03 -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 S1726393AbgGQHHz (ORCPT + 99 others); Fri, 17 Jul 2020 03:07:55 -0400 Received: from mga14.intel.com ([192.55.52.115]:52971 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726101AbgGQHHz (ORCPT ); Fri, 17 Jul 2020 03:07:55 -0400 IronPort-SDR: HP2W5VUK10PB6xokjRFv1jf5udQKWf+hFMkkmZrCNz5wADpA1px63QwYld2AO3xh8HiIm4kfzN fGJwjAaqiLyA== X-IronPort-AV: E=McAfee;i="6000,8403,9684"; a="148707420" X-IronPort-AV: E=Sophos;i="5.75,362,1589266800"; d="scan'208";a="148707420" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2020 00:07:53 -0700 IronPort-SDR: iYH1ke8eOh6MiA7Tc26J5IPMWAw+c7ugj2nWLdSCjSvPhIlYRi4JUVqfHl3lzCBl9/WizxhKao sFbZU/tQnbdA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,362,1589266800"; d="scan'208";a="282705110" Received: from linux.intel.com ([10.54.29.200]) by orsmga003.jf.intel.com with ESMTP; 17 Jul 2020 00:07:53 -0700 Received: from [10.249.224.34] (abudanko-mobl.ccr.corp.intel.com [10.249.224.34]) by linux.intel.com (Postfix) with ESMTP id D12BB580100; Fri, 17 Jul 2020 00:07:51 -0700 (PDT) Subject: [PATCH v12 14/15] perf record: implement control commands handling From: Alexey Budankov To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , Andi Kleen , linux-kernel References: <8d91c3a0-3db4-0a7a-ae13-299adb444bd6@linux.intel.com> Organization: Intel Corp. Message-ID: Date: Fri, 17 Jul 2020 10:07:50 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <8d91c3a0-3db4-0a7a-ae13-299adb444bd6@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 Implement handling of 'enable' and 'disable' control commands coming from control file descriptor. Signed-off-by: Alexey Budankov Acked-by: Jiri Olsa Acked-by: Namhyung Kim --- tools/perf/builtin-record.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index cd1892c4844b..632e61fe70bd 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -1527,6 +1527,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) bool disabled = false, draining = false; int fd; float ratio = 0; + enum evlist_ctl_cmd cmd = EVLIST_CTL_CMD_UNSUPPORTED; atexit(record__sig_exit); signal(SIGCHLD, sig_handler); @@ -1846,6 +1847,21 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) draining = true; } + if (evlist__ctlfd_process(rec->evlist, &cmd) > 0) { + switch (cmd) { + case EVLIST_CTL_CMD_ENABLE: + pr_info(EVLIST_ENABLED_MSG); + break; + case EVLIST_CTL_CMD_DISABLE: + pr_info(EVLIST_DISABLED_MSG); + break; + case EVLIST_CTL_CMD_ACK: + case EVLIST_CTL_CMD_UNSUPPORTED: + default: + break; + } + } + /* * When perf is starting the traced process, at the end events * die with the process and we wait for that. Thus no need to -- 2.24.1