Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1599612ybh; Tue, 14 Jul 2020 02:07:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhVpRUs1n6tNL407a8iYSmrhmqg5j95elN3/AAjqU5oVCAD/KywmM7jGMKQsQxkwlBRz36 X-Received: by 2002:a05:6402:2067:: with SMTP id bd7mr3458758edb.143.1594717622620; Tue, 14 Jul 2020 02:07:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594717622; cv=none; d=google.com; s=arc-20160816; b=ocn76VwI6wCVSTFuqkErFe0T0FcyMkRG9FFHCqoFX6b8GPzbKIX2rWukh/ENKuTB6T A1fmEQVOWcZnZd76MONTliDWzkPE0jOf7VSRWxTwsns2y6VBQy66zKxSo87anBqODrJX kio/fjm5PSz9982iAtYowIBu48+pUhM+hcl6X2XJ1djRw2/I8aDG98k9lUVIB+4oSadb 21HwMoMvStpJRyUcq52PR/xEh5zqHXbgJ2BMI8g7yorSPmZlp/HfKIvtrSRhFGbjm38w erwTqoZAqHZwm72znAa6zpzgY7wLvykfGihrNGxur88WduUdKVfGS/2t0ZnkxaxZdaDG o1qQ== 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=mZTmONmy4S+gKa6SUL9F9C/wYkErcdvXCgaO50a/Sg4=; b=ObKQW5veHH6JTa/QSOP76e646cESXy4xzH2bt+aR9cbt+WuKrdlNRfyDXeWchIrRVR WW7a7Smc22sX1Yj7iM2pmv74hkMf6YJDZCA0TG7LB84YyfYJ+R0wIMynwXYakjsROtws ALuQUFjcjar0BsxbnjFsXjV75uCfMAfNFKIcgXkzbKibnjePUHaFeCFfxcNc99rH2THP 7H+iTCcYvzfhJrqBuMwDI4V8fa9jnKPlpobLoGPtuPcJHrt7vb0katHCVD5FAyr64Y8D NRvQdJHW5jvhm7fAuflIPkPXyqyMgVndn6IsKcVBG8in18UI4b7jq3w408ZZBCm3DGd5 piOA== 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 e9si10607272edn.579.2020.07.14.02.06.39; Tue, 14 Jul 2020 02:07:02 -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 S1726762AbgGNJEj (ORCPT + 99 others); Tue, 14 Jul 2020 05:04:39 -0400 Received: from mga07.intel.com ([134.134.136.100]:47839 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726431AbgGNJEi (ORCPT ); Tue, 14 Jul 2020 05:04:38 -0400 IronPort-SDR: TiZdxSlaRL5Qi/iOnWV4fz/fp+QKSvdk0URFJKrgB+DPaABXNvPul89CaOoAKeTbWhc2BklC5t KQ+MLniIR61A== X-IronPort-AV: E=McAfee;i="6000,8403,9681"; a="213655114" X-IronPort-AV: E=Sophos;i="5.75,350,1589266800"; d="scan'208";a="213655114" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2020 02:04:38 -0700 IronPort-SDR: BD4dmx4DWuCA2manCzPyNhWs0KHP96TE+GGFMnX6kAoTOpErQ3Xi+zlrR/GXyePQArceBvpUjD MFZx6UGCyFSQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,350,1589266800"; d="scan'208";a="299469547" Received: from linux.intel.com ([10.54.29.200]) by orsmga002.jf.intel.com with ESMTP; 14 Jul 2020 02:04:38 -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 D8155580814; Tue, 14 Jul 2020 02:04:33 -0700 (PDT) Subject: [PATCH v11 03/15] tools/libperf: avoid counting of nonfilterable fdarray fds 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: <7123e415-4b42-1884-18d9-a0e9e150470b@linux.intel.com> Date: Tue, 14 Jul 2020 12:04:31 +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 Avoid counting of struct pollfd *entries objects with fdarray_flag__nonfilterable flag by fdarray__filter(). Nonfilterable objects are still processed if requested revents 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 37f291e6fc21..d638484c4bbd 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->priv[fd].flags & fdarray_flag__nonfilterable)) + ++nr; } return nr; -- 2.24.1