From patchwork Thu Jul 14 08:34:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 71995 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1413158qga; Thu, 14 Jul 2016 01:37:51 -0700 (PDT) X-Received: by 10.98.59.70 with SMTP id i67mr10530433pfa.45.1468485470653; Thu, 14 Jul 2016 01:37:50 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id uv5si1767527pac.274.2016.07.14.01.37.50; Thu, 14 Jul 2016 01:37:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751556AbcGNIhl (ORCPT + 30 others); Thu, 14 Jul 2016 04:37:41 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:6547 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751855AbcGNIfR (ORCPT ); Thu, 14 Jul 2016 04:35:17 -0400 Received: from 172.24.1.60 (EHLO szxeml428-hub.china.huawei.com) ([172.24.1.60]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DNQ19060; Thu, 14 Jul 2016 16:35:07 +0800 (CST) Received: from linux-4hy3.site (10.107.193.248) by szxeml428-hub.china.huawei.com (10.82.67.183) with Microsoft SMTP Server id 14.3.235.1; Thu, 14 Jul 2016 16:34:52 +0800 From: Wang Nan To: CC: , , , Wang Nan , Arnaldo Carvalho de Melo , He Kuang , Jiri Olsa , Masami Hiramatsu , Namhyung Kim , Nilay Vaish , Adrian Hunter , David Ahern , Peter Zijlstra Subject: [PATCH v16 02/15] tools lib fd array: Allow associating a pointer cookie with each entry Date: Thu, 14 Jul 2016 08:34:34 +0000 Message-ID: <1468485287-33422-3-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1468485287-33422-1-git-send-email-wangnan0@huawei.com> References: <1468485287-33422-1-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.107.193.248] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090202.57874EBC.0478, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 9dfde596f1f4f8f436a9712c9908864d Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a 'ptr' field to fdarray->priv array. This feature will be used by following commits, which introduce muiltiple 'struct perf_mmap' array for different types of mapping. Because of this, during fdarray__filter(), a simple 'idx' is not enough. Add a pointer cookie allows directly associate a 'struct perf_mmap' pointer to an fdarray entry. Signed-off-by: Wang Nan Cc: Arnaldo Carvalho de Melo Cc: He Kuang Cc: Jiri Olsa Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Zefan Li Cc: Nilay Vaish Cc: Adrian Hunter Cc: David Ahern Cc: Peter Zijlstra Cc: pi3orama@163.com --- tools/lib/api/fd/array.h | 1 + 1 file changed, 1 insertion(+) -- 1.8.3.4 diff --git a/tools/lib/api/fd/array.h b/tools/lib/api/fd/array.h index e87fd80..71287dd 100644 --- a/tools/lib/api/fd/array.h +++ b/tools/lib/api/fd/array.h @@ -22,6 +22,7 @@ struct fdarray { struct pollfd *entries; union { int idx; + void *ptr; } *priv; };