Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp342802ybt; Wed, 8 Jul 2020 01:06:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTElI76O0ApDLv2TBsFw1WqZNAXoKp/JVbLzlGvmaTY1Y+Yt7NEO7txbRmrmBgg7tG3QAi X-Received: by 2002:a05:6402:1494:: with SMTP id e20mr53204959edv.2.1594195568291; Wed, 08 Jul 2020 01:06:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594195568; cv=none; d=google.com; s=arc-20160816; b=rPH/eqt/EE3VkDiMPPg2W9sO6h9cGA2FMkjlIpheJctIaWPrLRO0iXScZgMkJkvHXH dIoS1rzTYG0XIxGIA4RItHdcdDEvZqQZ2Zxd5uAc45T/yxCbG72MplHu2brpzOmFtPfR 2vGaxidkrmI5jEPMSmAaBUUCqXZbgxlu7kptvlsGYpJSWrm0SPnBqXj1RPnBK6jOTnaO fpY0zlaT1gZnVJUPE4/ddkPMGn420oO5NmsUdJ7/xnR83n7xxKLG/44NZWw4eU9dl78I D+jWliUvrlTi2KHK63B+7o+P4sf6jBJV6bYY8jmLQ3Rgl9gBbbHZ2ZYS0v3RQzWc+MYI ZcDA== 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=qFXsInQbPmM7KIRBw9LJZlGHAGXKBk6YTskYBEpc8gXV8F3bv0IOJ2l9rW0Bncfa4f Z7+f2ezFT8Qbuz26KAeLQVyLgj8HAMzNfNJKpKVxRg0a1uVyJDiNNg91tsvvPcEsoHTS ZkPj2KcFvxnoSY4zJIpi+LqRNYizmfe0vQeUdv5UTPrk5GWsmUEbpdhpTETHHkCU5HdU DH3U2cQF4PDu/aD529Hksf1FTQT5lw+xiTXBworBJFDrqVOgHoy+vbV0uH61YYdQiy8d +1YAt+QZD397QmmgJ1qKb7Q+SL9ZjcKxpQZNzGpfIuU6YQ/YaPryhCR7cdcTNK5vz1ag f4zg== 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 b14si817902edx.461.2020.07.08.01.05.45; Wed, 08 Jul 2020 01:06:08 -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 S1727865AbgGHHvy (ORCPT + 99 others); Wed, 8 Jul 2020 03:51:54 -0400 Received: from mga17.intel.com ([192.55.52.151]:23569 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725747AbgGHHvy (ORCPT ); Wed, 8 Jul 2020 03:51:54 -0400 IronPort-SDR: wCQUNrMiO4H4il4WUYkMozJIgFImmRg0wigdEBxrDIsklWcrb7dxd2D+ynwsMzB3JkSHyJ0gJw uyxUs/qvv+4w== X-IronPort-AV: E=McAfee;i="6000,8403,9675"; a="127835774" X-IronPort-AV: E=Sophos;i="5.75,327,1589266800"; d="scan'208";a="127835774" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2020 00:51:52 -0700 IronPort-SDR: mvl8NFTHuO5iqMB4Nc3Vqs4jSWOypp6FZH4TyEGjdoQ87ZhC+24Qk00Z0wfNSlT0adaR2L4eYB 6MF3sayeQMvw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,327,1589266800"; d="scan'208";a="297644004" Received: from linux.intel.com ([10.54.29.200]) by orsmga002.jf.intel.com with ESMTP; 08 Jul 2020 00:51:52 -0700 Received: from [10.249.226.44] (abudanko-mobl.ccr.corp.intel.com [10.249.226.44]) by linux.intel.com (Postfix) with ESMTP id C917B5807C9; Wed, 8 Jul 2020 00:51:50 -0700 (PDT) Subject: [PATCH v10 08/15] perf stat: factor out body of event handling loop for fork case From: Alexey Budankov To: Arnaldo Carvalho de Melo , Jiri Olsa Cc: Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , Andi Kleen , linux-kernel References: <4af50c95-36f6-7a61-5a22-2949970fe7a5@linux.intel.com> Organization: Intel Corp. Message-ID: <16390e0b-f94f-d7df-0e2e-3701a3cd1383@linux.intel.com> Date: Wed, 8 Jul 2020 10:51:49 +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: <4af50c95-36f6-7a61-5a22-2949970fe7a5@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