Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304954
b: refs/heads/master
c: 8ed3e2c
h: refs/heads/master
v: v3
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed May 17, 2012
1 parent da85754 commit 0abae54
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f0cf973a224a3e3c1dec3395af3ba01cf14b1ff4
refs/heads/master: 8ed3e2cfe40ffe43630fd8efa34fc97c95b4c298
2 changes: 2 additions & 0 deletions trunk/include/linux/ftrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ extern void ftrace_caller(void);
extern void ftrace_call(void);
extern void mcount_call(void);

void ftrace_modify_all_code(int command);

#ifndef FTRACE_ADDR
#define FTRACE_ADDR ((unsigned long)ftrace_caller)
#endif
Expand Down
21 changes: 13 additions & 8 deletions trunk/kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1811,22 +1811,27 @@ int __weak ftrace_arch_code_modify_post_process(void)
return 0;
}

static int __ftrace_modify_code(void *data)
void ftrace_modify_all_code(int command)
{
int *command = data;

if (*command & FTRACE_UPDATE_CALLS)
if (command & FTRACE_UPDATE_CALLS)
ftrace_replace_code(1);
else if (*command & FTRACE_DISABLE_CALLS)
else if (command & FTRACE_DISABLE_CALLS)
ftrace_replace_code(0);

if (*command & FTRACE_UPDATE_TRACE_FUNC)
if (command & FTRACE_UPDATE_TRACE_FUNC)
ftrace_update_ftrace_func(ftrace_trace_function);

if (*command & FTRACE_START_FUNC_RET)
if (command & FTRACE_START_FUNC_RET)
ftrace_enable_ftrace_graph_caller();
else if (*command & FTRACE_STOP_FUNC_RET)
else if (command & FTRACE_STOP_FUNC_RET)
ftrace_disable_ftrace_graph_caller();
}

static int __ftrace_modify_code(void *data)
{
int *command = data;

ftrace_modify_all_code(*command);

return 0;
}
Expand Down

0 comments on commit 0abae54

Please sign in to comment.