Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2110625ybt; Fri, 3 Jul 2020 00:45:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXgp5WQhylv623X7R+IesPfa8eSJKT39XBSEFv4MSr/cQb1yBxy3q5mG6oZ2RMrjWlKi8d X-Received: by 2002:aa7:c656:: with SMTP id z22mr25852520edr.101.1593762320761; Fri, 03 Jul 2020 00:45:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593762320; cv=none; d=google.com; s=arc-20160816; b=tvMVbSTJdHUPzSqkDg3e8Gqnujx9FRvdNDE+33Uap7ZjVWNp3Gd+kknQm6A1anC40L g+03QXzKt69sovmVLKB4b4pCeZ591iVdAkQ++Kp+2lJpL8O+ZDwZZ7G6rIhBfCMJIkgv wa45cwP2eVnFmmuqcbRswd/eT6vhlOmBW17h+P7hFGIjKKAipTTtshW3PQDG3nGpUgnn KkP/hxvvMAORoaWevBQVh0MTOXrawbOEf49o2yew/aRtRnu6mXXOcnF9KU3zkOLTIchY 64amYKp7IhdTEpm5qFEx0LTm4PKk+OPbgDZ1Os6WM1K7Jny004xvFD2eXry6lGviNG9d /8dQ== 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=PUKsWwf2J3jlVbSZllN21TXbl82/VRDDytfeUGc8QJU=; b=isqBgc0ZcRyoiIniDq4UiljF/epFosZzr3MNmiAJPqjeZdLCb7shm50dBfpM3mjSnF ZHF/STTcpACJxkZhEBIQpMu8Yx7rxaiuRRjha+ZFkXS+y6JjTegwEgKfLFYVn3+yVFjm MotxGrsIcRx5y+r82pwXBwPQhwnKEhjwx9mu/ngW86sgyRo3EO0eC0Fj3xpDnu7SF4xQ jk/61vwMk+RydNKtH1Sbi4XikSfl7B0zJpJyeAKcxBqSqngfZkqKr66/UyTEvoO5ZTL8 UkSMmAPRuZ4WtODKj+idEuYW4QEr0KDkWGTMsC9sZnhYwKAdo1HxlgOMF9NvBE7Pw+xP xBWw== 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 v26si7925676edx.137.2020.07.03.00.44.58; Fri, 03 Jul 2020 00:45:20 -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 S1726367AbgGCHm3 (ORCPT + 99 others); Fri, 3 Jul 2020 03:42:29 -0400 Received: from mga04.intel.com ([192.55.52.120]:50470 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725779AbgGCHm2 (ORCPT ); Fri, 3 Jul 2020 03:42:28 -0400 IronPort-SDR: nO21T2mnvmOsbrghMyAX8kKroA/JG2RivgdXqTfoN0i58EVKAQOEAndxVkrhGZBxUSnBI+wu/Z yY2VCGxizoJQ== X-IronPort-AV: E=McAfee;i="6000,8403,9670"; a="144632551" X-IronPort-AV: E=Sophos;i="5.75,307,1589266800"; d="scan'208";a="144632551" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2020 00:42:28 -0700 IronPort-SDR: 6k6wbxWM8Gt79kK5XHdkrZnjuch3hvq0tBmUka+RQBXiXtJFtAapJdU6y5qCya95NPA4nmbYxI 0Cd2np4ZUosg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,307,1589266800"; d="scan'208";a="296142830" Received: from linux.intel.com ([10.54.29.200]) by orsmga002.jf.intel.com with ESMTP; 03 Jul 2020 00:42:28 -0700 Received: from [10.249.231.67] (abudanko-mobl.ccr.corp.intel.com [10.249.231.67]) by linux.intel.com (Postfix) with ESMTP id 55C5D580784; Fri, 3 Jul 2020 00:42:26 -0700 (PDT) Subject: [PATCH v9 03/15] tools/libperf: don't count nonfilterable fds by fdarray__filter() From: Alexey Budankov To: Arnaldo Carvalho de Melo , Jiri Olsa Cc: Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , Andi Kleen , linux-kernel References: Organization: Intel Corp. Message-ID: Date: Fri, 3 Jul 2020 10:42:25 +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: 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 Avoid counting of struct pollfd *entries objects with fdarray_prop__nonfilterable propery by fdarray__filter(). Non-filterable objects are still processed if monitored events have been signaled for them. Signed-off-by: Alexey Budankov --- tools/lib/api/fd/array.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/lib/api/fd/array.c b/tools/lib/api/fd/array.c index a4223f8cb1ce..e902c0260414 100644 --- a/tools/lib/api/fd/array.c +++ b/tools/lib/api/fd/array.c @@ -105,7 +105,8 @@ int fdarray__filter(struct fdarray *fda, short revents, continue; } - ++nr; + if (!(fda->prop[fd].bits & fdarray_prop__nonfilterable)) + ++nr; } return nr; -- 2.24.1