Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp901136ybj; Thu, 7 May 2020 10:07:36 -0700 (PDT) X-Google-Smtp-Source: APiQypKqWlhhFCaO4NqfbEjCvAlez2+AzY9JbDszg/QvVQ3l/CwffWHWNioA29x8agNH0//3hjQr X-Received: by 2002:a17:906:f74e:: with SMTP id jp14mr13580767ejb.15.1588871256303; Thu, 07 May 2020 10:07:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588871256; cv=none; d=google.com; s=arc-20160816; b=FHLTz1rtdstffu1ou5fGnBmLJen4jSHNCw/bAnSv4Wz2t8uzXg9kAHm+TmjED2fm8M k74KWV+BngoviC6I5xmvr4Qgy8i325DGbgZ7NztsliHPiF9rhSGO1Wi7DiRGRLwDmYzR yHI3qhD3oxmUYqQZi3YU9e1YD0IbUH6gY32YRpi9erL0y7dMwTo75nPBOGO0L/EIpwla c31yGN/NJrVt/2tk0zWOd4nlIa8uoBEjX7MMVIK5yei5yDdXoXGn3hQZlO7rEushbo+3 JrcRHxsQPPZm92hBtr7DhLDSF8foZbFf8d4ld5bekEjXxsZSF0EVkPL6+7EkYMDGkwD9 rgnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :dkim-signature; bh=yAHhylpwtOslrc/dOUKgfB3SOwKO6Omu8a9EnpJ1Fhc=; b=lrij9Zy3HeMJ3VVqjcG0gP4i6JjktnRs9Tcedzg6Vg0umDsmTHGamn9+icnAcAZUpy 5cXdwc3HGx1Uksw4LVSt0joVQQsk1cF6xqs57OAwLxtuhi8ITEX70217VrA1oV9z4yTk KlIay0jP0BpYdZ4TgTsy8x+V30YMclLWrYIavY7xpgWaBL+DtWGaXWaHnSNeEp+KoKl3 B0QtaEbFlg0SURbI771WnT1zK7yDzybLTo8Z7WJF2nEcUy0PY8OBIuwDtnOPrVICuT0K D/5XfGg2RHhj/mgAC4Ijs0ErJ90dxkFUBpTLjixQ2lqCVVIekx9TmrHiE/Qkn2RRUtGl qE/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Du2GXZKc; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t28si2846913edi.408.2020.05.07.10.07.11; Thu, 07 May 2020 10:07:36 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Du2GXZKc; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727780AbgEGRC2 (ORCPT + 99 others); Thu, 7 May 2020 13:02:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726518AbgEGRC2 (ORCPT ); Thu, 7 May 2020 13:02:28 -0400 Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73195C05BD43 for ; Thu, 7 May 2020 10:02:28 -0700 (PDT) Received: by mail-qk1-x742.google.com with SMTP id b188so6857533qkd.9 for ; Thu, 07 May 2020 10:02:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=yAHhylpwtOslrc/dOUKgfB3SOwKO6Omu8a9EnpJ1Fhc=; b=Du2GXZKcBr3UQ2ZVdisEy2jQtSYaJPXnxqv3b4UJoX49dZG/SwbUbnI3tLEIbs3iFW IDe1t4N9V8dsqJPAYg5R5aT6jvPXuXjlseJ0Suvk/FPBH5za0Rb0nIQ3u0cjo6cdpthG vRdjPKq10gaRIX2r0EfFFRVShWHUrjzatSQsEOplvhy9N2h9fimSDZqWh9/wAzkLL44v fiLiF1deMlmHbR5PBC1fJ20wb/x3oEY1DEgf+7wMNPUKkXXG3smwPmVwpCFAx8n7K3Lr JGErrUt7zG8gdRY3+DbhIeC6LWWiog1PY03vSl1D5tRO9cXPcExIxV8czMd19nzXhG4i SZ+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=yAHhylpwtOslrc/dOUKgfB3SOwKO6Omu8a9EnpJ1Fhc=; b=kv/EjYh3tmm2PIbYYbMHFdT6/d/D46dysWOu3iHlmO1BmYqsZny6S7oZ2D8e3BIjmG kl671oZ0CnPLiHz8TyLZUq4N6vvVd2TlzlKPa+sC9CaNWp1ieSVHnk6oxwKVNo1AVTLa wavzPrF1KxUTnoahhBsDMr7LTM8jqX4URxP9vNkaWM4EGPCH9dfpdmNf1ylFf+O9uc+Q YL54zVjDEzzux+poJDbFcPZoKhl0Mct6vuKAGCHTEqLWAdoN1B1pCaGwOx4QN62Dlr7s hSj64nRRvCig2glXGjrXH6irUcG+mHNv9wU6VsQcS+bLOTfuWrDhylZOzV8VeuPfJlzW 8A8w== X-Gm-Message-State: AGi0Pub6XSTFxMLvuWibb3bso7qEBdSGaH6sqk9iJgJmttp7QhExvRo9 XbefTekq+VpkSMpUC07nhPw= X-Received: by 2002:a37:49c6:: with SMTP id w189mr14602032qka.444.1588870947613; Thu, 07 May 2020 10:02:27 -0700 (PDT) Received: from quaco.ghostprotocols.net ([179.97.37.151]) by smtp.gmail.com with ESMTPSA id y185sm4649121qkd.29.2020.05.07.10.02.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2020 10:02:26 -0700 (PDT) From: Arnaldo Carvalho de Melo X-Google-Original-From: Arnaldo Carvalho de Melo Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 92B4340AFD; Thu, 7 May 2020 14:02:24 -0300 (-03) Date: Thu, 7 May 2020 14:02:24 -0300 To: Alexey Budankov Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , Andi Kleen , linux-kernel Subject: Re: [PATCH v2 09/11] perf record: implement control commands handling Message-ID: <20200507170224.GH31109@kernel.org> References: <20200506202339.GH9893@kernel.org> <4971d2b6-a95a-d53d-515d-7f0ba95fb2f8@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4971d2b6-a95a-d53d-515d-7f0ba95fb2f8@linux.intel.com> X-Url: http://acmel.wordpress.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, May 07, 2020 at 11:58:45AM +0300, Alexey Budankov escreveu: > > On 06.05.2020 23:23, Arnaldo Carvalho de Melo wrote: > > Em Wed, May 06, 2020 at 09:29:05PM +0300, Alexey Budankov escreveu: > >> > >> Implement handling of 'enable' and 'disable' control commands > >> coming from control file descriptor. > >> > >> Signed-off-by: Alexey Budankov > >> --- > >> tools/perf/builtin-record.c | 18 +++++++++++++++++- > >> 1 file changed, 17 insertions(+), 1 deletion(-) > >> > >> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c > >> index 8a14e68b86ad..2278a3efc747 100644 > >> --- a/tools/perf/builtin-record.c > >> +++ b/tools/perf/builtin-record.c > >> @@ -1496,6 +1496,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 = CTL_CMD_UNSUPPORTED; > >> > >> atexit(record__sig_exit); > >> signal(SIGCHLD, sig_handler); > >> @@ -1793,8 +1794,23 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) > >> * Propagate error, only if there's any. Ignore positive > >> * number of returned events and interrupt error. > >> */ > >> - if (err > 0 || (err < 0 && errno == EINTR)) > >> + if (err > 0 || (err < 0 && errno == EINTR)) { > >> err = 0; > >> + if (perf_evlist__ctlfd_process(rec->evlist, &cmd) > 0) { > >> + switch (cmd) { > >> + case CTL_CMD_ENABLE: > >> + pr_info(PERF_EVLIST__ENABLED_MSG); > >> + break; > >> + case CTL_CMD_DISABLE: > >> + pr_info(PERF_EVLIST__DISABLED_MSG); > >> + break; > >> + case CTL_CMD_ACK: > >> + case CTL_CMD_UNSUPPORTED: > > > > Shouldn't we have a pr_debug() or even pr_err() for the unsupported one? > > It already exists on lower level, at perf_evlist__ctlfd_process() (see patch 02/11). oic > ~Alexey -- - Arnaldo