Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932859Ab1CRWLy (ORCPT ); Fri, 18 Mar 2011 18:11:54 -0400 Received: from mout.perfora.net ([74.208.4.194]:64235 "EHLO mout.perfora.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757304Ab1CRWLs (ORCPT ); Fri, 18 Mar 2011 18:11:48 -0400 Date: Fri, 18 Mar 2011 18:10:42 -0400 From: Stephen Wilson To: Srikar Dronamraju Cc: Peter Zijlstra , Ingo Molnar , Steven Rostedt , Linux-mm , Arnaldo Carvalho de Melo , Linus Torvalds , Christoph Hellwig , Masami Hiramatsu , Ananth N Mavinakayanahalli , Oleg Nesterov , LKML , SystemTap , Jim Keniston , Roland McGrath , Andi Kleen , Andrew Morton , "Paul E. McKenney" Subject: Re: [PATCH v2 2.6.38-rc8-tip 17/20] 17: uprobes: filter chain Message-ID: <20110318221042.GA3586@fibrous.localdomain> References: <20110314133403.27435.7901.sendpatchset@localhost6.localdomain6> <20110314133722.27435.55663.sendpatchset@localhost6.localdomain6> <20110315194914.GA24972@fibrous.localdomain> <20110318191648.GD31152@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110318191648.GD31152@linux.vnet.ibm.com> User-Agent: Mutt/1.5.19 (2009-01-05) X-Provags-ID: V02:K0:yT1HhYGud4qwdcAVX7yVOdos19NQ9c9UFulYJNwAJkB 8lstwYSeOZLsh+YuqGDimBa/WcfeE7IeAgGNcRQqgTvK+PDhNn LglMbh61kqgudaTiXlotW9/EEvASNcsZcfTGB5l2WOmTF9LTRK VUPOmPiCID+xewlsDBCJrJ7oVcUwghV2zJUz5IlI0LcFfU5f09 F9N4FT9dlwQcutOGquJGnrHM4NwlYpKm7DkWKx6lmI= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1275 Lines: 39 On Sat, Mar 19, 2011 at 12:46:48AM +0530, Srikar Dronamraju wrote: > > > + for (consumer = uprobe->consumers; consumer; > > > + consumer = consumer->next) { > > > + if (!consumer->filter || consumer->filter(consumer, t)) { > > > > The implementation does not seem to match the changelog description. > > Should this not be: > > > > if (consumer->filter && consumer->filter(consumer, t)) > > > > ? > > filter is optional; if filter is present, then it means that the > tracer is interested in a specific set of processes that maps this > inode. If there is no filter; it means that it is interested in all > processes that map this filter. Ah OK. That does make sense then. Thanks! > filter_chain() should return true if any consumer is interested in > tracing this task. if there is a consumer who hasnt defined a filter > then we dont need to loop thro remaining consumers. > > Hence > > if (!consumer->filter || consumer->filter(consumer, t)) { > > seems better suited to me. -- steve -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/