Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3667444ybt; Tue, 23 Jun 2020 08:00:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/ziTNai60dz3H3I/QTcXAjyeyVHiBRF6CN0Az1WeILFaqTrA8ltJO40JeLbcnmUcqH9dq X-Received: by 2002:a17:906:c10f:: with SMTP id do15mr21654258ejc.249.1592924410711; Tue, 23 Jun 2020 08:00:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592924410; cv=none; d=google.com; s=arc-20160816; b=02UMRlAECqWv2D/gqc3/mi0jZ0eYNpmUjolHh2g+8F4ifBizcEEEQs1HlSsvhdD5Z1 n7IWtj97kAAC/ufykk6tAJz4SZ/gIScCiU1tIOA+npV3AL+OPNE7Kz8CTEFQtMDCakgp wO0dRH9WxCZcP3TsJfv64d+VmCl3rZEEiJPH804H+yEcgsDBVFjY+sDOaIB4nYaIXL3x NNAEtJRUSpBwYJCC6LEGU+wJAE5rUjdD63IJIi/W9gH0lHTPcTVf0hSLbPNuvHxB1NAv LKppwD6uB6fi3lryP/SJMKlTu/wwJuXljhVgnvwXlZMnKr+DVFC8jF7hJrTWVs3iI8n7 ztYg== 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=zX5l+igiDXxjHKbiKasVHbs9DlDXfu+pmjhSPoSV2Mo=; b=m8RBtf//gO/HSN2vzUK6Zy7/zJLcT7GpE3ifQsY24Qm8ApXCSDdEZ2JQLBLx4FAQzy K9eX8yna+2FD732gTSgWXtQ0KRlohRyaHXC4aT4XpcCfedFI1mAsIS5lVH4pssnh9n2X KINkepiNozWGyfr4p5Ffch76YapR+2hCKX4PuDAvhCW8Ff45Up+1gLhsMgitQ+fQrYv/ OwgsFKYCt4PYNQnVcqDAegbUYI02ri4U0EVglwVFr3tZyMNRKAMB9J8cJHSoe53Anc4o Y7HFbZnIXSO1cir9pL5rlkqDG5q9ZuetjAEqAZ3008PRm+S7bCFLFyx8txrniNou9kIE L/mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SDiQkved; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fi17si4533050ejb.724.2020.06.23.07.59.47; Tue, 23 Jun 2020 08:00: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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SDiQkved; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732930AbgFWOy7 (ORCPT + 99 others); Tue, 23 Jun 2020 10:54:59 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:31009 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732821AbgFWOy7 (ORCPT ); Tue, 23 Jun 2020 10:54:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592924097; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zX5l+igiDXxjHKbiKasVHbs9DlDXfu+pmjhSPoSV2Mo=; b=SDiQkved8k0/9+0M0+u9qeb1K8c3DLdZLjiNSTZvUnl/xLDf/NfJ78GQm9GNHrcpS0Y1Zy DCL3rUHzhhDmVfFMrJYbWN6WrKJMlEukkseJXwOJWOVUpBDB7WgYi3WA5AjG8tKV40GcEl o51yzBc3Zmbw224El0Fy5+Nzeh19d6E= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-472-hvqOmfvHMTebEwcPPzNrVg-1; Tue, 23 Jun 2020 10:54:54 -0400 X-MC-Unique: hvqOmfvHMTebEwcPPzNrVg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 49C138018D9; Tue, 23 Jun 2020 14:54:53 +0000 (UTC) Received: from krava (unknown [10.40.192.77]) by smtp.corp.redhat.com (Postfix) with SMTP id 3782B60F8D; Tue, 23 Jun 2020 14:54:51 +0000 (UTC) Date: Tue, 23 Jun 2020 16:54:50 +0200 From: Jiri Olsa To: Alexey Budankov Cc: Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , Andi Kleen , linux-kernel Subject: Re: [PATCH v7 03/13] perf evlist: implement control command handling functions Message-ID: <20200623145450.GF2619137@krava> References: <5de4b954-24f0-1e8d-5a0d-7b12783b8218@linux.intel.com> <88988ce1-52d3-21e7-f0dc-bac5fde63cb2@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <88988ce1-52d3-21e7-f0dc-bac5fde63cb2@linux.intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 03, 2020 at 06:54:47PM +0300, Alexey Budankov wrote: SNIP > + case EVLIST_CTL_CMD_ACK: > + case EVLIST_CTL_CMD_UNSUPPORTED: > + default: > + pr_debug("ctlfd: unsupported %d\n", *cmd); > + break; > + } > + if (!(*cmd == EVLIST_CTL_CMD_ACK || *cmd == EVLIST_CTL_CMD_UNSUPPORTED)) > + evlist__ctlfd_ack(evlist); > + } > + } > + > + if (stat_entries[ctlfd_pos].revents & (POLLHUP | POLLERR)) > + evlist__finalize_ctlfd(evlist); > + else > + stat_entries[ctlfd_pos].revents = 0; > + > + return err; > +} > diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h > index 0d8b361f1c8e..bccf0a970371 100644 > --- a/tools/perf/util/evlist.h > +++ b/tools/perf/util/evlist.h > @@ -360,4 +360,21 @@ 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" why the \n at the end of ack? jirka