Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754238AbYJBNGY (ORCPT ); Thu, 2 Oct 2008 09:06:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753505AbYJBNGP (ORCPT ); Thu, 2 Oct 2008 09:06:15 -0400 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.125]:56447 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753504AbYJBNGO (ORCPT ); Thu, 2 Oct 2008 09:06:14 -0400 Date: Thu, 2 Oct 2008 09:06:11 -0400 (EDT) From: Steven Rostedt X-X-Sender: rostedt@gandalf.stny.rr.com To: Andrew Morton cc: Ingo Molnar , Linus Torvalds , Peter Zijlstra , Jonathan Corbet , Mathieu Desnoyers , LKML , Thomas Gleixner , prasad@linux.vnet.ibm.com, "Frank Ch. Eigler" , David Wilder , hch@lst.de, Martin Bligh , Christoph Hellwig , Masami Hiramatsu , Steven Rostedt , Arnaldo Carvalho de Melo Subject: Re: [PATCH] ring_buffer: allocate buffer page pointer In-Reply-To: <20081002020615.4840542a.akpm@linux-foundation.org> Message-ID: References: <20080930000307.GA2929@Krystal> <20080930034603.GA13801@Krystal> <20080930092001.69849210@bike.lwn.net> <1222790072.24384.21.camel@twins> <20081002085030.GF26084@elte.hu> <20081002020615.4840542a.akpm@linux-foundation.org> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1732 Lines: 46 On Thu, 2 Oct 2008, Andrew Morton wrote: > > > > This patch adds a macro to assign all entries of ftrace using the type > > of the variable and checking the entry id. The typecasts are now done > > in the macro for only those types that it knows about, which should > > be all the types that are allowed to be read from the tracer. > > > > I'm somewhat at a loss here because I'm unable to find any version of > kernel/trace/trace.c which looks anything like the one which is being > patched, but... As Ingo mentioned, you don't have this yet. And be happy that you don't ;-) This patch is to fix the patch that did this. > > > --- a/kernel/trace/trace.c > > +++ b/kernel/trace/trace.c > > @@ -1350,7 +1350,9 @@ print_lat_fmt(struct trace_iterator *iter, unsigned int trace_idx, int cpu) > > } > > switch (entry->type) { > > case TRACE_FN: { > > - struct ftrace_entry *field = (struct ftrace_entry *)entry; > > Why was this code using a cast in the first place? It should be using > entry->some_field_i_dont_have_here? That was the whole point in using > the anonymous union in struct trace_entry? Because the ring_buffer now allows for variable length entries, having a one size fits all entry is not optimal. But because C is not the best for typecasting, we have this macro to help solve the issue. Instead of registering everything into a single union and causing small fields to be large, we have a macro you can register your type with instead. -- 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/