Re: [PATCH 2/2] ftrace - add ftrace function_graph support on ARM

From: Frederic Weisbecker
Date: Fri Mar 05 2010 - 22:28:34 EST


On Fri, Mar 05, 2010 at 04:31:26PM -0800, Tim Bird wrote:
> +++ b/arch/arm/kernel/ftrace_graph.c
> @@ -0,0 +1,46 @@
> +/*
> + * function graph tracing support.
> + *
> + * Copyright (C) 2009 Tim Bird <tim.bird@xxxxxxxxxxx>
> + *
> + * For licencing details, see COPYING.
> + *
> + * Defines routine needed for ARM return trampoline for tracing
> + * function exits.
> + */
> +
> +#include <linux/ftrace.h>
> +
> +/*
> + * Hook the return address and push it in the stack of return addrs
> + * in current thread info.
> + */
> +void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
> + unsigned long frame_pointer)
> +{
> + unsigned long old;
> +
> + struct ftrace_graph_ent trace;
> + unsigned long return_hooker = (unsigned long)
> + &return_to_handler;
> +
> + if (unlikely(atomic_read(&current->tracing_graph_pause)))
> + return;
> +
> + old = *parent;
> + *parent = return_hooker;
> +
> + if (ftrace_push_return_trace(old, self_addr, &trace.depth,
> + frame_pointer) == -EBUSY) {
> + *parent = old;
> + return;
> + }
> +
> + trace.func = self_addr;
> +
> + /* Only trace if the calling function expects to */
> + if (!ftrace_graph_entry(&trace)) {
> + current->curr_ret_stack--;
> + *parent = old;
> + }
> +}




This could have been done in ftrace.c

Other than that,
Acked-by: Frederic Weisbecker <fweisbec@xxxxxxxxx>

Thanks.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/