Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757502AbYA3IsT (ORCPT ); Wed, 30 Jan 2008 03:48:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754400AbYA3IsJ (ORCPT ); Wed, 30 Jan 2008 03:48:09 -0500 Received: from bombadil.infradead.org ([18.85.46.34]:39359 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753986AbYA3IsI (ORCPT ); Wed, 30 Jan 2008 03:48:08 -0500 Subject: Re: [PATCH 02/22 -v7] Add basic support for gcc profiler instrumentation From: Peter Zijlstra To: Steven Rostedt Cc: LKML , Ingo Molnar , Linus Torvalds , Andrew Morton , Christoph Hellwig , Mathieu Desnoyers , Gregory Haskins , Arnaldo Carvalho de Melo , Thomas Gleixner , Tim Bird , Sam Ravnborg , "Frank Ch. Eigler" , Jan Kiszka , John Stultz , Arjan van de Ven , Steven Rostedt In-Reply-To: <20080130031840.337019504@goodmis.org> References: <20080130031521.258552785@goodmis.org> <20080130031840.337019504@goodmis.org> Content-Type: text/plain Date: Wed, 30 Jan 2008 09:46:41 +0100 Message-Id: <1201682801.28547.162.camel@lappy> Mime-Version: 1.0 X-Mailer: Evolution 2.21.5 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1017 Lines: 35 On Tue, 2008-01-29 at 22:15 -0500, Steven Rostedt wrote: > +int register_mcount_function(struct mcount_ops *ops) > +{ > + unsigned long flags; > + > + spin_lock_irqsave(&mcount_func_lock, flags); > + ops->next = mcount_list; > + /* must have next seen before we update the list pointer */ > + smp_wmb(); That comment does not explain which race it closes; this is esp important as there is no paired barrier to give hints. > + mcount_list = ops; > + /* > + * For one func, simply call it directly. > + * For more than one func, call the chain. > + */ > + if (ops->next == &mcount_list_end) > + mcount_trace_function = ops->func; > + else > + mcount_trace_function = mcount_list_func; > + spin_unlock_irqrestore(&mcount_func_lock, flags); > + > + return 0; > +} -- 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/