Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1397037ybt; Thu, 25 Jun 2020 05:13:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTl5nQgefpE/kKQblGJqzR6HGwXCq3LhipTmzE6LvAUtD1abx57lY6vpPPSm1d794bV3Vr X-Received: by 2002:aa7:d70f:: with SMTP id t15mr20121299edq.237.1593087238040; Thu, 25 Jun 2020 05:13:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593087238; cv=none; d=google.com; s=arc-20160816; b=kIZYvV1+DNHms2iYBdQj+NzLkufWtRWqbHQvgQSvURuOwySevRB4KqTAaDv1I/U5Iz J0I88tKP4hTuHTN6YSXw1xpO5bRJIY8WvWpS8kXaXZiLaVQveKElZbc1TeOnXK2o+604 D+ZF+JHelP7Pf1XiCShVf+BPDjJa6fjyDJDV2uw1A1+TwBelCoNJLnbNMLFG162+MNqx hUhh1BF9HRKWuWEu39kpv9eqSeg5j4X+TqGHGg669b8Cn7SFDbiX0huENXvhGsiwHgCf ajZ2/R+CkqoUCLSpDN+gh6sFnlqUhDCmxgjR4jzbKdgx/R2hLYVmQwzVhvJTovHTiePn 2VEA== 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=0d5k1uyW/+te7o3Y+6MyeKrsTLgzk3JPsSgjnWxQ3DM=; b=n3r4cyPhxpdZwWNLXuguuElYoliJX8MoA4f1TVkS85B5VmFZjstHdVZ4jShFltaWk3 LjC0MQTZbEydg3ABIrkEu3yudQpKdef5nGtGe+5X1U3Li5pNOQJrC7ZGsyTJ4+og8US9 qwXfy+8iGDdPBjv8BjV+uaZNWO5Mmh92/EV4IJQn8udt4ggXYqdnfoLgo8GUDxDLKSYW GiW1DGB2WxMCxi5za2RDifWroBjSKK0BlxW8XexKhh+O6BWwM+Ha4jK8rA0yJpa233uI v6UjSKMqxPYK2KQajRMChRl7KifkPrVodE4Tn9MCop1p3MEkJtP34brFqJh5iU2j/1K3 2CzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FdPjgmbH; 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 r8si3719811ejs.462.2020.06.25.05.13.34; Thu, 25 Jun 2020 05:13:58 -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=FdPjgmbH; 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 S2404480AbgFYMM2 (ORCPT + 99 others); Thu, 25 Jun 2020 08:12:28 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:57975 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2404397AbgFYMM1 (ORCPT ); Thu, 25 Jun 2020 08:12:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593087146; 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=0d5k1uyW/+te7o3Y+6MyeKrsTLgzk3JPsSgjnWxQ3DM=; b=FdPjgmbHnASTzsIiTxlwXWPYPDm1H0bqstx+E3BRlzxYnr4eKFZIApKSQKKKYQXnR6rYuX oqRgYg6Ir+IHerW8R/eqs2Qi+zlcos7zRMnT21hR9dWMQMMCb4UIX+Z9/adD8vrpG3okfU 2EiBnDQKRFPJzVTuqt3AwRBQrdKtc5Y= 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-460-Cj5RPVAHOmiaPvEnCyYFCw-1; Thu, 25 Jun 2020 08:12:22 -0400 X-MC-Unique: Cj5RPVAHOmiaPvEnCyYFCw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5C4B7100A8E9; Thu, 25 Jun 2020 12:12:21 +0000 (UTC) Received: from krava (unknown [10.40.193.172]) by smtp.corp.redhat.com (Postfix) with SMTP id 7280D1019606; Thu, 25 Jun 2020 12:12:19 +0000 (UTC) Date: Thu, 25 Jun 2020 14:12:18 +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 v8 09/13] perf stat: implement control commands handling Message-ID: <20200625121218.GG2719003@krava> References: <0781a077-aa82-5b4a-273e-c17372a72b93@linux.intel.com> <5ed69a1e-052a-9790-7642-cb9c9a53d786@linux.intel.com> <20200623145458.GG2619137@krava> <9bf22a7b-0b56-c55f-c8b2-60c8e6ed0ef9@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9bf22a7b-0b56-c55f-c8b2-60c8e6ed0ef9@linux.intel.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 24, 2020 at 04:39:11PM +0300, Alexey Budankov wrote: > > > On 23.06.2020 17:54, Jiri Olsa wrote: > > On Wed, Jun 17, 2020 at 11:41:30AM +0300, Alexey Budankov wrote: > >> > >> Implement handling of 'enable' and 'disable' control commands > >> coming from control file descriptor. process_evlist() function > >> checks for events on control fds and makes required operations. > >> If poll event splits initiated timeout interval then the reminder > >> is calculated and still waited in the following poll() syscall. > >> > >> Signed-off-by: Alexey Budankov > >> --- > >> tools/perf/builtin-stat.c | 67 +++++++++++++++++++++++++++++---------- > >> 1 file changed, 50 insertions(+), 17 deletions(-) > >> > >> diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c > >> index f88d5ee55022..cc56d71a3ed5 100644 > >> --- a/tools/perf/builtin-stat.c > >> +++ b/tools/perf/builtin-stat.c > >> @@ -492,6 +492,31 @@ static bool process_timeout(int timeout, unsigned int interval, int *times) > >> return print_interval(interval, times); > >> } > >> > >> +static bool process_evlist(struct evlist *evlist, unsigned int interval, int *times) > >> +{ > >> + bool stop = false; > >> + enum evlist_ctl_cmd cmd = EVLIST_CTL_CMD_UNSUPPORTED; > >> + > >> + if (evlist__ctlfd_process(evlist, &cmd) > 0) { > >> + switch (cmd) { > >> + case EVLIST_CTL_CMD_ENABLE: > >> + pr_info(EVLIST_ENABLED_MSG); > >> + stop = print_interval(interval, times); > > > > why is interval printed in here? > > > >> + break; > >> + case EVLIST_CTL_CMD_DISABLE: > >> + stop = print_interval(interval, times); > > > > and here? > > > > it should be called from the main loop when the interval time is elapsed no? > > It is called from the main loop too and it is also additionally called here > to provide indication and counter values on commands processing times. so it prints interval out of order? jirka