lkml.org 
[lkml]   [2008]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] ring_buffer: allocate buffer page pointer
    On Thu, 2 Oct 2008 10:50:30 +0200 Ingo Molnar <mingo@elte.hu> wrote:

    >
    > * Steven Rostedt <rostedt@goodmis.org> 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 <srostedt@redhat.com>
    > > ---
    > > 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 <rostedt@goodmis.org>
    > 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?



    \
     
     \ /
      Last update: 2008-10-02 11:17    [W:3.529 / U:0.088 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site