Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1710603ybt; Thu, 25 Jun 2020 12:12:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycGLIIoUkkt7k8asPABdT4PgRDESFEzXI3ReZYzyvMki2K3TTcXGVRrz+/NQAXFJnpEaI7 X-Received: by 2002:a17:907:7294:: with SMTP id dt20mr30280847ejc.355.1593112354889; Thu, 25 Jun 2020 12:12:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593112354; cv=none; d=google.com; s=arc-20160816; b=a2NxC6UlVTirucSTq9XjADRKG/CGJOOvyVHkt/eKb5e5+TGGxB0xV2hX2qkIK4lPRT IV7qcyGsqaJuBvQoUnaidXdAPcEiZ4HZFodRysWTvfBQdjYh+hChGq33biI81mcwXg0/ 7KEPcjXz076nMPZp2x7gqt6qbqRLh810rWZhrrx9iXQg7DLgSGT8CtwE/BE7zhke4GwW 2ZdmhvW0gQWl9MRnjoDtYMCjmP6q6Wmt+bPQPKSUAIdUYwr0xkblMW11uvEL9LG0+smc nP7qSmhZfyTg7rufVTSFhNcTXTBvjUh8LdyhFOod3cq5fvGcrO0yMZWlJyUVWE7moZ0s MuwA== 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:from:references:cc:to:subject:ironport-sdr :ironport-sdr; bh=x0jXdBkUVX0GPPvaRUiCdf14rYLqa1tDYjgYDwKnyr4=; b=NRc9aqM2zJkkCUHBaIOn9RGQh1L7TohKjfTet6adGod5zUbLuU82x3P/LATztPh6/m PAV7bqLO5xwBzBLPOF72FSP+ttudY60dQ8271SjL8F8LcnslQeRxtmLvXufSpsZZdcRc CZW1NrG4QjHhRkR2BGysTqKneBxZIwNjbcEHW91LkSkscO+iu9MynNAgSfGenj21ErMe LuvkHWPulkDyrcQaZ0bUDWlw0ThQZfHQ8XVu5L1Wp4blxyxxPo5KTaNXAEo91YJzyvyt WporCDywKfSq5cmiPi3cIttyMqaDDeukueHFqa9J6i4eM4RiNdsEqR330EFcBEhGsE4q ujOQ== 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 bq21si3049730ejb.301.2020.06.25.12.12.11; Thu, 25 Jun 2020 12:12:34 -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 S2406182AbgFYSoB (ORCPT + 99 others); Thu, 25 Jun 2020 14:44:01 -0400 Received: from mga12.intel.com ([192.55.52.136]:33033 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728204AbgFYSoA (ORCPT ); Thu, 25 Jun 2020 14:44:00 -0400 IronPort-SDR: rIUllYmNahFG2m25SkZOMUB7eLy6lRlx+DbnbLOlLGyWA7QfPYnUe96q0BbUPdNOOFswlVZIVF efSOtjdcsoGw== X-IronPort-AV: E=McAfee;i="6000,8403,9663"; a="124682849" X-IronPort-AV: E=Sophos;i="5.75,280,1589266800"; d="scan'208";a="124682849" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2020 11:44:00 -0700 IronPort-SDR: 7VFDsXUtH/V25cueaVbWkXpwsCSEhRRssv1kpfVQ8dl/rAyQ5IkKFTU+g1VaMJrYqNZ0OhR3jG /fs6vLc62dpg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,280,1589266800"; d="scan'208";a="319813773" Received: from linux.intel.com ([10.54.29.200]) by FMSMGA003.fm.intel.com with ESMTP; 25 Jun 2020 11:44:00 -0700 Received: from [10.249.229.54] (abudanko-mobl.ccr.corp.intel.com [10.249.229.54]) by linux.intel.com (Postfix) with ESMTP id 3AE3C5804B4; Thu, 25 Jun 2020 11:43:55 -0700 (PDT) Subject: Re: [PATCH v8 04/13] perf stat: factor out body of event handling loop for system wide To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , Andi Kleen , linux-kernel References: <0781a077-aa82-5b4a-273e-c17372a72b93@linux.intel.com> <20200623145630.GK2619137@krava> <51d5511a-e9a7-2865-c81b-57488e820f8d@linux.intel.com> <20200625121719.GI2719003@krava> <20200625171300.GK2719003@krava> From: Alexey Budankov Organization: Intel Corp. Message-ID: <78a2f7cf-3f5c-decc-fd91-5a2c38548f52@linux.intel.com> Date: Thu, 25 Jun 2020 21:43:54 +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: <20200625171300.GK2719003@krava> 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 On 25.06.2020 20:13, Jiri Olsa wrote: > On Thu, Jun 25, 2020 at 07:01:08PM +0300, Alexey Budankov wrote: > > SNIP > >>>> >>>> Well, ok. >>>> >>>> I will rename process_interval() to __process_interval() and >>>> then print_interval() to process_interval(). >>>> >>>> Regarding timeout let's have it like this: >>>> >>>> static bool process_timeout(int timeout) >>>> { >>>> return timeout ? true : false; >>>> } >>> >>> can't this just stay as value check after finished poll? >>> >>> if (timeout) >>> break; >>> >>> and then separate call to process_interval(interval, times)? >> >> Like this? Still makes sense to have it in a single function. >> >> static bool process_timing_settings(int timeout, unsigned int interval, int *times) >> { >> bool res = timeout ? true : false; >> if (!res) >> res = process_interval(interval, times); >> return res; >> } > > I don't see the connection between timeout and interval > IMO this just complicates things, is there a problem to > keep it separated as it is now? Not a problem. Can duplicate it in dispatch_events(). ~Alexey