Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754728AbYJBJNb (ORCPT ); Thu, 2 Oct 2008 05:13:31 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752649AbYJBJNU (ORCPT ); Thu, 2 Oct 2008 05:13:20 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:43943 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753631AbYJBJNT (ORCPT ); Thu, 2 Oct 2008 05:13:19 -0400 Date: Thu, 2 Oct 2008 02:06:15 -0700 From: Andrew Morton To: Ingo Molnar Cc: Steven Rostedt , 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 Message-Id: <20081002020615.4840542a.akpm@linux-foundation.org> In-Reply-To: <20081002085030.GF26084@elte.hu> References: <20080930000307.GA2929@Krystal> <20080930034603.GA13801@Krystal> <20080930092001.69849210@bike.lwn.net> <1222790072.24384.21.camel@twins> <20081002085030.GF26084@elte.hu> X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.5; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2633 Lines: 65 On Thu, 2 Oct 2008 10:50:30 +0200 Ingo Molnar wrote: > > * Steven Rostedt wrote: > > > > > The current method of overlaying the page frame as the buffer page pointer > > can be very dangerous and limits our ability to do other things with > > a page from the buffer, like send it off to disk. > > > > This patch allocates the buffer_page instead of overlaying the page's > > page frame. The use of the buffer_page has hardly changed due to this. > > > > Signed-off-by: Steven Rostedt > > --- > > kernel/trace/ring_buffer.c | 54 ++++++++++++++++++++++++++------------------- > > 1 file changed, 32 insertions(+), 22 deletions(-) > > applied to tip/tracing/ftrace, with the extended changlog below - i > think this commit warrants that extra mention. > > Ingo > > ---------------> > >From da78331b4ced2763322d732ac5ba275965853bde Mon Sep 17 00:00:00 2001 > From: Steven Rostedt > Date: Wed, 1 Oct 2008 10:52:51 -0400 > Subject: [PATCH] ftrace: type cast filter+verifier > > The mmiotrace map had a bug that would typecast the entry from > the trace to the wrong type. That is a known danger of C typecasts, > there's absolutely zero checking done on them. > > Help that problem a bit by using a GCC extension to implement a > type filter that restricts the types that a trace record can be > cast into, and by adding a dynamic check (in debug mode) to verify > the type of the entry. > > 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... > --- 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? -- 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/