lkml.org 
[lkml]   [2012]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH -tip 1/9] ftrace: Add pt_regs acceptable trace callback
From
Date
On Tue, 2012-05-29 at 21:48 +0900, Masami Hiramatsu wrote:

> struct ftrace_ops {
> - ftrace_func_t func;
> + union {
> + ftrace_func_t func;
> + ftrace_regs_func_t regs_func;
> + };
> struct ftrace_ops *next;
> unsigned long flags;
> int __percpu *disabled;
> @@ -164,6 +182,7 @@ static inline int ftrace_function_local_disabled(struct ftrace_ops *ops)
> }

[..]

>
> static struct ftrace_ops global_ops = {
> - .func = ftrace_stub,
> + .regs_func = ftrace_regs_stub,
> .notrace_hash = EMPTY_HASH,
> .filter_hash = EMPTY_HASH,
> + .flags = FTRACE_OPS_FL_SAVE_REGS,
> };
>
> static DEFINE_MUTEX(ftrace_regex_lock);
> @@ -3911,7 +3924,8 @@ void __init ftrace_init(void)
> #else
>
> static struct ftrace_ops global_ops = {
> - .func = ftrace_stub,
> + .regs_func = ftrace_regs_stub,
> + .flags = FTRACE_OPS_FL_SAVE_REGS,
> };
>

Ug, this wont compile with some versions of gcc :-(

The one I stumbled on is gcc 4.5.1 (which I test builds against 4.5.1
and 4.6.0). Then I saw this BZ:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676

This can't be a union :-( Then we can not initialize it.

I may go with my old approach and just change all callers to have a regs
parameter.

-- Steve




\
 
 \ /
  Last update: 2012-06-02 04:41    [W:0.398 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site