From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753799Ab1AYN4Q (ORCPT ); Tue, 25 Jan 2011 08:56:16 -0500 Received: from bombadil.infradead.org ([18.85.46.34]:60153 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753750Ab1AYN4L convert rfc822-to-8bit (ORCPT ); Tue, 25 Jan 2011 08:56:11 -0500 Subject: Re: [RFC] [PATCH 2.6.37-rc5-tip 4/20] 4: uprobes: Adding and remove a uprobe in a rb tree. From: Peter Zijlstra To: Srikar Dronamraju Cc: Ingo Molnar , Steven Rostedt , Arnaldo Carvalho de Melo , Linus Torvalds , Masami Hiramatsu , Christoph Hellwig , Andi Kleen , Oleg Nesterov , LKML , SystemTap , Linux-mm , Jim Keniston , Frederic Weisbecker , Ananth N Mavinakayanahalli , Andrew Morton , "Paul E. McKenney" In-Reply-To: <20101216095803.23751.41491.sendpatchset@localhost6.localdomain6> References: <20101216095714.23751.52601.sendpatchset@localhost6.localdomain6> <20101216095803.23751.41491.sendpatchset@localhost6.localdomain6> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Date: Tue, 25 Jan 2011 14:56:13 +0100 Message-ID: <1295963773.28776.1054.camel@laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2010-12-16 at 15:28 +0530, Srikar Dronamraju wrote: > +struct uprobe_consumer { > + int (*handler)(struct uprobe_consumer *self, struct pt_regs *regs); > + /* > + * filter is optional; If a filter exists, handler is run > + * if and only if filter returns true. > + */ > + bool (*filter)(struct uprobe_consumer *self, struct task_struct *task); > + > + struct uprobe_consumer *next; > + void *fvalue; /* filter value */ > +}; Since you pass in a pointer to this structure at register_uprobe() its user allocated, hence you can remove the fvalue thing and let the user embed this in a larger struct if needed, the filter functions can then use container_of() to get at the larger data structure.