Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1600685ybh; Tue, 14 Jul 2020 02:08:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAcp27dUnF3UsgzEmEd12H3hYWWtkaLX4PYAxzOqYBViOac5tBov0Z5v50CpsVluEcFioq X-Received: by 2002:a17:906:6959:: with SMTP id c25mr3462248ejs.375.1594717725620; Tue, 14 Jul 2020 02:08:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594717725; cv=none; d=google.com; s=arc-20160816; b=XiRNxWxC7DY177HD9NQWleuQbaN/nahjaeCEk8dkKzaqecvB7znusybfV7Q3dRn3gy MspDpLrpmdTR455m0vUL1yQgSIznX3+FZ7U1jWIlvUeeefbUejSDZBlXMeug2X18OqTt T0cHJjtsG1+nQsn4xBvGs0IavU+Vo57csomO4X0gWNgXZJulTHJK/sCfEJgQ2UFR8K8S g2T8EsDpz13ofHdoBPVI4WxheZnZ0TbhU8GzUOKAcYh4RSESm79Z7RVPfR+DkcMDgQTJ SkTCtfLs5NVnI0aj5hmMIMa3IOfBHjAtm9q55vRciZFXkslD1S51kPO+/TgYzSOLBQDt 0kvg== 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=DKzUInn/C5QiisL9hKkukCPTSybBV6qNNAiTfd4wK/8=; b=FZsPQ6RbUVBEgwsq7Tyuy8jvyWcCfrvBRMfcWRFKaRmTKR4Xu6C055MipI9LiLKiLp QwJxaGDQAFDpqaLZr9zDQEWdT3efCrXW1b8h59n/0xcQ40Rj5rf1tvp8askjMdVNrng0 kubQJld+UMRaPrL6ylGJrSFCdGH3U3Oupf/H8laVzGky8eGSxPJu8UML3NvbPGEGaBUw wO7/tT1/nL6M20AMI382CWy1Dqwlph6iJWfcWeQRNahv6BD04X9dLZgffqZi8Z1aSbhK zpyOWV6kdHW1uo3exbDgVV87Nf/OVPrxIxNVniEzddX7KIDFsGsrVXyWpr6gw7AyC290 hTgA== 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 h6si8244754ejq.405.2020.07.14.02.08.22; Tue, 14 Jul 2020 02:08:45 -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 S1726456AbgGNJID (ORCPT + 99 others); Tue, 14 Jul 2020 05:08:03 -0400 Received: from mga03.intel.com ([134.134.136.65]:21673 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725820AbgGNJID (ORCPT ); Tue, 14 Jul 2020 05:08:03 -0400 IronPort-SDR: 5Zult3gZvu7MI0Fuwy03hVapUUoucoU1KW2dNTDbUEN6xXxe1q0jxyFczj0XDWPfnJClhJkLsl oLgv1aC6L6ew== X-IronPort-AV: E=McAfee;i="6000,8403,9681"; a="148852561" X-IronPort-AV: E=Sophos;i="5.75,350,1589266800"; d="scan'208";a="148852561" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2020 02:08:03 -0700 IronPort-SDR: rsretidoWbVwg/N4AOXPc8QDnFGkuoR56SNARDaoDLTpbziD0at3pS3aDTHTXN8NgzdscyYehk m0LoBHWWjHvQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,350,1589266800"; d="scan'208";a="269957054" Received: from linux.intel.com ([10.54.29.200]) by fmsmga008.fm.intel.com with ESMTP; 14 Jul 2020 02:08:02 -0700 Received: from [10.249.230.149] (abudanko-mobl.ccr.corp.intel.com [10.249.230.149]) by linux.intel.com (Postfix) with ESMTP id 985B5580810; Tue, 14 Jul 2020 02:07:58 -0700 (PDT) Subject: [PATCH v11 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: <037d737f-0ada-a9f0-9686-f7521ca6fbc3@linux.intel.com> Organization: Intel Corp. Message-ID: <75e03994-ba68-e56e-a4d1-28eb923b7046@linux.intel.com> Date: Tue, 14 Jul 2020 12:07:56 +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: <037d737f-0ada-a9f0-9686-f7521ca6fbc3@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 --- 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