From patchwork Tue Jul 12 10:00:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 71801 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp383880qga; Tue, 12 Jul 2016 03:01:01 -0700 (PDT) X-Received: by 10.98.33.23 with SMTP id h23mr43165177pfh.42.1468317661460; Tue, 12 Jul 2016 03:01:01 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a78si2192925pfg.228.2016.07.12.03.01.01; Tue, 12 Jul 2016 03:01:01 -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 S932306AbcGLKAn (ORCPT + 30 others); Tue, 12 Jul 2016 06:00:43 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:54901 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751141AbcGLKAl (ORCPT ); Tue, 12 Jul 2016 06:00:41 -0400 Received: from 172.24.1.136 (EHLO szxeml425-hub.china.huawei.com) ([172.24.1.136]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DNN97450; Tue, 12 Jul 2016 18:00:29 +0800 (CST) Received: from linux-4hy3.site (10.107.193.248) by szxeml425-hub.china.huawei.com (10.82.67.180) with Microsoft SMTP Server id 14.3.235.1; Tue, 12 Jul 2016 18:00:17 +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 v15 02/12] tools lib fd array: Allow associating a pointer cookie with each entry Date: Tue, 12 Jul 2016 10:00:02 +0000 Message-ID: <1468317612-11598-3-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1468317612-11598-1-git-send-email-wangnan0@huawei.com> References: <1468317612-11598-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.0A090206.5784BFBE.0047, 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: dca03addaced0762c27e78fd161e0da5 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; };