Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp476951ybh; Wed, 22 Jul 2020 05:35:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIqEywb/cnfLzCOW9fawpK4mqYAAr3/m287AwGymTpCOZNP6QKvedS6J0ota3olUi63oQA X-Received: by 2002:a17:906:148a:: with SMTP id x10mr30914587ejc.497.1595421333956; Wed, 22 Jul 2020 05:35:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595421333; cv=none; d=google.com; s=arc-20160816; b=BO5MqQ08rxfZK8pYQZStv233U2SNSDZv3REe4Zx5+xXH6EhkcFS4h5EnxJaMzX575R 16amZ72w//JXAIuz3lKQ3N/MZBmaPXHG64uCdj4uHKyldCqhbUB5PcW3eFHtPe+SrUjC k0XiBE/f8qhBB5tnmufMeuAPU9cNECgxLNtlPU1wnL1NzlbX0/ekJCVJTeaQEj3ht8mS +N3Qzwu6SLkYRMTmCBM0WobN8LRU3FCaYGqnX/bFw7C4MOROuOUkSEZ4Nvqw1LDvwbuK mpSnsd35osBQmX1wLVOYL6BB2VrG0e18gj3XRp1I/va+mT/vWbJ1VK2SYRHNsn849EH7 6fSA== 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:from:date :dkim-signature; bh=/VODIO0pAE4a3MANMTnXYbuTJOKwOkU5HpAYIdA/ENc=; b=twjDaIzXDPjmTkHGxgo4vcSBvivamBQ02mEtgEWgefTjhw02R0BfXe13jivbvMmouc kvJ2um43dFfy4zXUZShEeF10/cPCntL521aaoz25zbNlpjdQY7xnqkvsfGk2e76WwkFd KZXjOnHLa1K5Leh4b0huCBW9WFkEmb0JXrlAcyjKFLbic1yP0uwas30vTg+QPMfub/vA umSZHQHVTu960FojxwhnLviCHkECLLsu9MKmy7JX0QlYWA5uU8emiGfKY6XxNBJDmNjx +vPXkYtuirD5nneapGE+Mr4u3YLx1sQ+wKPAkkTcgAhteEchwaL2MtTvqUhiBFPnfEyV 977A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0tT+yW2Z; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f6si15118121edv.159.2020.07.22.05.35.11; Wed, 22 Jul 2020 05:35:33 -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=@kernel.org header.s=default header.b=0tT+yW2Z; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732342AbgGVMe1 (ORCPT + 99 others); Wed, 22 Jul 2020 08:34:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:38908 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731857AbgGVMe0 (ORCPT ); Wed, 22 Jul 2020 08:34:26 -0400 Received: from quaco.ghostprotocols.net (unknown [177.17.3.185]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E8D2A2065E; Wed, 22 Jul 2020 12:34:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595421266; bh=0QEFoJLeBfGzFAv1ye3oNErTb7Vj/OYnW7+WOE6tzdg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=0tT+yW2ZgKBXhXrn8dztXfSrgS3VSxvDqUzFBdOfqK9TDw2dpUlRozq3Beg0ze+Vv FLgss7QxPlQHh6n0FflJFDzdPx+194b7x01BPHdJiCmqdXRTNAXShARbiVL0zGHTgk 5n5JkTT0iD+jnfL75uJ7oNO3d/7lANzOITz+LJbY= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id E0923404B1; Wed, 22 Jul 2020 09:34:23 -0300 (-03) Date: Wed, 22 Jul 2020 09:34:23 -0300 From: Arnaldo Carvalho de Melo To: Alexey Budankov Cc: Jiri Olsa , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , Andi Kleen , linux-kernel Subject: Re: [PATCH v12 05/15] perf evlist: implement control command handling functions Message-ID: <20200722123423.GK77866@kernel.org> References: <8d91c3a0-3db4-0a7a-ae13-299adb444bd6@linux.intel.com> <62518ceb-1cc9-2aba-593b-55408d07c1bf@linux.intel.com> <20200722122734.GJ77866@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200722122734.GJ77866@kernel.org> 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 Wed, Jul 22, 2020 at 09:27:34AM -0300, Arnaldo Carvalho de Melo escreveu: > Em Fri, Jul 17, 2020 at 10:01:33AM +0300, Alexey Budankov escreveu: > > > > Implement functions of initialization, finalization and processing > > of control command messages coming from control file descriptors. > > Allocate control file descriptor as descriptor at struct pollfd > > object of evsel_list for atomic poll() operation. > > > > Signed-off-by: Alexey Budankov > > Acked-by: Jiri Olsa > > Acked-by: Namhyung Kim > > I'm applying locally for testing, but can you answer what is the reason > for that newline in the CMD_ACK_TAG? I tried looking at previous > discussion but couldn't quickly find any reasoning for that > > - Arnaldo > > > +++ b/tools/perf/util/evlist.h > > @@ -359,4 +359,22 @@ void perf_evlist__force_leader(struct evlist *evlist); > > struct evsel *perf_evlist__reset_weak_group(struct evlist *evlist, > > struct evsel *evsel, > > bool close); > > +#define EVLIST_CTL_CMD_ENABLE_TAG "enable" > > +#define EVLIST_CTL_CMD_DISABLE_TAG "disable" > > +#define EVLIST_CTL_CMD_ACK_TAG "ack\n" > > What for? That '\n'? Oh, I see, this is not a _command_, it is a _response_, and the sender expects a newline, right? So I think this needs to be marked clearly as: // Commands accepted by 'perf record' #define EVLIST_CTL_CMD_ENABLE_TAG "enable" #define EVLIST_CTL_CMD_DISABLE_TAG "disable" // Responses sent by 'perf record' #define EVLIST_CTL_RSP_ACK "ack" And then make the response add the newline, as conceivably we could have something like "nack", "invalid", "enoperm", etc, no? Anyway, this can be done on top of this series, so I'm continuing processing it locally. - Arnaldo