Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1771380ybh; Fri, 17 Jul 2020 00:06:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhEBu+OeMxOMEsuf2LSqMX78q7+wlBBNSDVqTAMuCKxrU/o0G+hFWS2p38+tEO85a6p2JY X-Received: by 2002:a1c:6289:: with SMTP id w131mr7457069wmb.64.1594969578650; Fri, 17 Jul 2020 00:06:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594969578; cv=none; d=google.com; s=arc-20160816; b=hr71Z/PJMcH0JVeOfsMV71dwKIAFqF7fh3r/zMD+VCo0wfUWPnexumn/ZctbP1MQYE uLI7VsmXoZw6t4QQTr4U1gaRqoVCWP93mR8xf3k8kh9YhW9g07PJbpHOWSoY5BWcJY3x a9d1fKcW/CRMQOkTtVmc8oFqUmhR8aLmZTVmMDCE+TOTpgx8n0cECcgi0sW6WXwLQ+d9 fiuc4p6bHdfE4W54La8jWIYwCBjlZaQZOx3+8OaeWljLB2Nzn3SLbzXNDOutL7NB9fJp 3CPJGjdJR3H1JtbRVujLSSH+Mo8Q764zX3GFzxVt9fzlPnPGy+3cQvCUW+7HbNNEH/A+ tdWA== 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:references:cc:to:from:subject:ironport-sdr :ironport-sdr; bh=N9SfWIH8VDe9HVJ82cbr0z6Gc6saWHAAMbsM7Ijpvds=; b=ZSC3EpKQ00Oh7HLNcusnWaoP5+vcS/yp+OVctdHgeFB1355IdrJ550OhxLJoRrxzi6 0huEHECRn2ze2EVIqSVecKTleqrinjd9Io4z+uEj236YH4SIrsj7od4oelmLRoUOLPSJ UsYcw05IrcEwRy47AzR79tMIvonwUuHmmuebAtgJfwiwprSZ748zlfJeD0C8StA2VqNm /9g7ljiOfh9Pp1cfJllUUmYRyKZtrsLorq5rDlszsiECM/9PwCHF0uP/SInq66dH2CVL XHKytjiqYgPb6gaLAt8HCOBz4bu+FGYirre6Cy4V+0Lt398sXfMSv2bxaFh68I+DKgi8 JdwQ== 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 n20si4271035ejs.158.2020.07.17.00.05.55; Fri, 17 Jul 2020 00:06:18 -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 S1727825AbgGQHDX (ORCPT + 99 others); Fri, 17 Jul 2020 03:03:23 -0400 Received: from mga09.intel.com ([134.134.136.24]:32324 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726200AbgGQHDW (ORCPT ); Fri, 17 Jul 2020 03:03:22 -0400 IronPort-SDR: gnJAOqzq018Wven8M7x4vsowdHO3PpnoGjQxAAbQBpMpxcGQDSDOHKCkloO7aFS4lMo6JuO+S9 7ICFkP1CVBvg== X-IronPort-AV: E=McAfee;i="6000,8403,9684"; a="150927248" X-IronPort-AV: E=Sophos;i="5.75,362,1589266800"; d="scan'208";a="150927248" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2020 00:03:22 -0700 IronPort-SDR: xKl6nepEO351LRxr8y0AtZ903TiiFfrbX/TBHa7G37TcHntZf3IDgYk3Xc7O66VfFgOV60zcTk 1el2k4D0LQLA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,362,1589266800"; d="scan'208";a="326764750" Received: from linux.intel.com ([10.54.29.200]) by orsmga007.jf.intel.com with ESMTP; 17 Jul 2020 00:03:22 -0700 Received: from [10.249.224.34] (abudanko-mobl.ccr.corp.intel.com [10.249.224.34]) by linux.intel.com (Postfix) with ESMTP id A0D9758066D; Fri, 17 Jul 2020 00:03:20 -0700 (PDT) Subject: [PATCH v12 08/15] perf stat: factor out body of event handling loop for fork case From: Alexey Budankov To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , Andi Kleen , linux-kernel References: <8d91c3a0-3db4-0a7a-ae13-299adb444bd6@linux.intel.com> Organization: Intel Corp. Message-ID: Date: Fri, 17 Jul 2020 10:03:19 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <8d91c3a0-3db4-0a7a-ae13-299adb444bd6@linux.intel.com> 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 Factor out body of event handling loop for fork case reusing handle_interval() function. Signed-off-by: Alexey Budankov Acked-by: Jiri Olsa Acked-by: Namhyung Kim --- tools/perf/builtin-stat.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 87eebf3f55ae..91f31518948e 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -792,10 +792,7 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx) if (interval || timeout) { while (!waitpid(child_pid, &status, WNOHANG)) { nanosleep(&ts, NULL); - if (timeout) - break; - process_interval(); - if (interval_count && !(--times)) + if (timeout || handle_interval(interval, ×)) break; } } -- 2.24.1