Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp325875ybt; Wed, 17 Jun 2020 01:48:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDA6i5SVHq46G89+hYNhyf3jgTmSgQ/jcwN9Vp+69OkTblIxKH4f0B9OiPXg50DibNznp2 X-Received: by 2002:a17:906:71b:: with SMTP id y27mr6701777ejb.537.1592383690921; Wed, 17 Jun 2020 01:48:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592383690; cv=none; d=google.com; s=arc-20160816; b=NqNNuzF+b57jla1/g3wz0d5uxQh0VVPRv5ea7fr/lbvWcoFwVr9Z9NdZ/1EMrdfVUy YaR4OdM+jD17UUdVYtCuOYplMezvqbbRUDuEBME5dKQfOB1pjFjNRCPourLTfxcoskpv /oROWk9/taEyy5z/ccLj62EvRs4VjvC9aIaFqmFD/rGGRJSmNCbcHxm2lstSAQbCQGBY 4cYOn+9TDmEz6Zq69XQC+d4b0Sxt/KQrGwzpCgo0wxsqb6AB7TQSr18sAaijQV1LiEPi tveZvRRaNjBxQCllHB6kvjNPsndA4r5AIp2r8GtDX6AOAGKXhX6XhLnjcDktNv1TjwaC 3owg== 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=po8/7NlZ2m76RP6HrnqDudluoioPrcBSGE7udG2yW2s=; b=A4iDK5pomInEfCBks3ByqD145DAbjxBqA7WebGjJr1zycPjmB1N7JK47Q30byrewNp toHlb0Hs+i/KXRCPpIr2XiS8dGCQQY5Qmt9cWEt4UAghToHMSgLrenQNla3BNDYhrVf8 rbyZN0Rs7c/L6qg4DrJZuILYRv0j7dGF6kUKUj0XzWiPxHBT26RoyhoQ8bTgLKciGTfq 2PeO9IScGDYQUgC5pbeG2KuUq7XxpH2tP6BU8W28054p4IRONsmEE4UQL3elaa+0Y/jn lrDDKeKXJYUWKqwEtFAi1PgD7qAHraCbPuU11SwzE+4bw74tUX4nlWhHOcNiVRlWeTLe cXag== 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 f12si12254551ejf.650.2020.06.17.01.47.47; Wed, 17 Jun 2020 01:48:10 -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 S1726597AbgFQIoC (ORCPT + 99 others); Wed, 17 Jun 2020 04:44:02 -0400 Received: from mga01.intel.com ([192.55.52.88]:14792 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725964AbgFQIoB (ORCPT ); Wed, 17 Jun 2020 04:44:01 -0400 IronPort-SDR: dwPjoBtto7WtiiBkYvMWCOnm53/iyzjzZyPmTLrxJ4J/L7uCF0qpsj4DYImY1CRfkBtAcVSH5T iVjBpGf8G2Jg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jun 2020 01:44:01 -0700 IronPort-SDR: imZFkMgZf4XO7Xp6u4cI+1sICIQdqwaFEbBoAjbA2/fV2H2D8d0hEMPaKeJfYVByMYeIkiXVrV UfkeM9rLomuA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,522,1583222400"; d="scan'208";a="317471914" Received: from linux.intel.com ([10.54.29.200]) by FMSMGA003.fm.intel.com with ESMTP; 17 Jun 2020 01:44:01 -0700 Received: from [10.249.225.191] (abudanko-mobl.ccr.corp.intel.com [10.249.225.191]) by linux.intel.com (Postfix) with ESMTP id 56DAB58026B; Wed, 17 Jun 2020 01:43:59 -0700 (PDT) Subject: [PATCH v8 12/13] 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: <0781a077-aa82-5b4a-273e-c17372a72b93@linux.intel.com> Organization: Intel Corp. Message-ID: Date: Wed, 17 Jun 2020 11:43:58 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <0781a077-aa82-5b4a-273e-c17372a72b93@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 --- 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 d0b29a1070a0..0394e068dde8 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); @@ -1830,6 +1831,21 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) alarm(rec->switch_output.time); } + 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; + } + } + if (hits == rec->samples) { if (done || draining) break; -- 2.24.1