Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1768818ybh; Fri, 17 Jul 2020 00:01:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtL4bCLamjerYkWxx48TeLRoobizNe2JAWzVCmasqXrRhM9D39hb91q6I8hsEjXwE0WQst X-Received: by 2002:a17:906:2681:: with SMTP id t1mr7136273ejc.350.1594969318567; Fri, 17 Jul 2020 00:01:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594969318; cv=none; d=google.com; s=arc-20160816; b=ly5a1u1T7EbSKrcCLDESiWO1B7tViQESvKC0fL2UwnqcPjoz13HDXuZBZuv0vw9vn1 lqDUlBtyymFpIanqqbJqEeqQNW/V/wO0H3hoLQz3Z2c2TPSZAcNQg8xZKdklNZh0GqEg GpasXtkDXIekWTkI1l6hD9fk1n9oTjDFayhU7MnU5s8k7Pgf46bMp0DLEABOOJEEhl3j jjZfzQjR1uxWJYUzrI7Sl3C36CnsNuRkiN0j/zl8F5MAws6NmpCWjM2Oz89StpSwwHcq inj03LLXjBbHT/w7beOikCnESDER2rpx394xSr4B0k2UTMuV+AQpsS1W1oipW3IKJFix FHoQ== 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=oCjMYbgfkACz/hWuhH29yD5xoSVfOX158dmChC9GY48=; b=ltkvgX/hKqzUPD4FaIa1IwUk+k7jupkJ4KiPogVAieoR5XrxUbKTbWxNyi/58CDSYg kFXQAhUYrZMvVvbwvFHFJghm12pNL3RP4SRbwb4DPhlUL+0bzS2vYJMVWicLaya3fuVH Y1Pw8w68LSDWcIpGSMcVcyE9knKy3EgVhvuklYT61FNW0q9w+BxF1qwDUn0kBji7uhEE w4OTvpsFs+YzHw3vU6UKxypNB2mqXUCDKuBy1q/WnBd1B1FBKlMrdr9PWHMYg4v0SnHZ fOzcX/O4oMy2bz2mkys7vg31e1+Pu4ZrUm/walgtPgFSGJhCncunFMvR5ryCn1Io6bnk 2+aA== 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 d2si4713398edv.375.2020.07.17.00.01.35; Fri, 17 Jul 2020 00:01:58 -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 S1726945AbgGQHAU (ORCPT + 99 others); Fri, 17 Jul 2020 03:00:20 -0400 Received: from mga09.intel.com ([134.134.136.24]:32068 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726201AbgGQHAU (ORCPT ); Fri, 17 Jul 2020 03:00:20 -0400 IronPort-SDR: WfG1cA4qz+B4PF/0Db3of46Men9YP2Y4uDl12UculO5woWH1d7DnAtE4KClSkdaHybDdQQtKtJ n1DvQNvQJFNQ== X-IronPort-AV: E=McAfee;i="6000,8403,9684"; a="150926874" X-IronPort-AV: E=Sophos;i="5.75,362,1589266800"; d="scan'208";a="150926874" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2020 00:00:19 -0700 IronPort-SDR: wuSioCnoWCGde7JobIhlkndenf9keMinGmAjhxVQuUbXwcUaFzVikvqIlvRgKwnUNStwFZL4oJ tet4gaEeJ8iA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,362,1589266800"; d="scan'208";a="286729909" Received: from linux.intel.com ([10.54.29.200]) by orsmga006.jf.intel.com with ESMTP; 17 Jul 2020 00:00:19 -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 050CE58066D; Fri, 17 Jul 2020 00:00:16 -0700 (PDT) Subject: [PATCH v12 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: <8d91c3a0-3db4-0a7a-ae13-299adb444bd6@linux.intel.com> Organization: Intel Corp. Message-ID: Date: Fri, 17 Jul 2020 10:00:15 +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 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 Acked-by: Jiri Olsa Acked-by: Namhyung Kim --- 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 01b3b89f9797..5e6cb9debe37 100644 --- a/tools/lib/api/fd/array.c +++ b/tools/lib/api/fd/array.c @@ -109,7 +109,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