diff options
author | Steven Rostedt <srostedt@redhat.com> | 2011-05-03 21:55:54 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2011-05-18 15:29:48 -0400 |
commit | bd69c30b1d08032d97ab0dabd7a1eb7fb73ca2b2 (patch) | |
tree | e8bd00dc87de4f10f049e0c41fd09f630b96585d /kernel/trace | |
parent | 647bcd03d5b2fb44fd9c9ef1a4f50c2eee8f779a (diff) |
ftrace: Add ops parameter to ftrace_startup/shutdown functions
In order to allow different ops to enable different functions,
the ftrace_startup() and ftrace_shutdown() functions need the
ops parameter passed to them.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/ftrace.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 065f1e61e103..8fef1d99bbbf 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -1522,10 +1522,8 @@ static void ftrace_startup_enable(int command) | |||
1522 | ftrace_run_update_code(command); | 1522 | ftrace_run_update_code(command); |
1523 | } | 1523 | } |
1524 | 1524 | ||
1525 | static void ftrace_startup(int command) | 1525 | static void ftrace_startup(struct ftrace_ops *ops, int command) |
1526 | { | 1526 | { |
1527 | struct ftrace_ops *ops = &global_ops; | ||
1528 | |||
1529 | if (unlikely(ftrace_disabled)) | 1527 | if (unlikely(ftrace_disabled)) |
1530 | return; | 1528 | return; |
1531 | 1529 | ||
@@ -1539,10 +1537,8 @@ static void ftrace_startup(int command) | |||
1539 | ftrace_startup_enable(command); | 1537 | ftrace_startup_enable(command); |
1540 | } | 1538 | } |
1541 | 1539 | ||
1542 | static void ftrace_shutdown(int command) | 1540 | static void ftrace_shutdown(struct ftrace_ops *ops, int command) |
1543 | { | 1541 | { |
1544 | struct ftrace_ops *ops = &global_ops; | ||
1545 | |||
1546 | if (unlikely(ftrace_disabled)) | 1542 | if (unlikely(ftrace_disabled)) |
1547 | return; | 1543 | return; |
1548 | 1544 | ||
@@ -2362,7 +2358,7 @@ static void __enable_ftrace_function_probe(void) | |||
2362 | return; | 2358 | return; |
2363 | 2359 | ||
2364 | __register_ftrace_function(&trace_probe_ops); | 2360 | __register_ftrace_function(&trace_probe_ops); |
2365 | ftrace_startup(0); | 2361 | ftrace_startup(&global_ops, 0); |
2366 | ftrace_probe_registered = 1; | 2362 | ftrace_probe_registered = 1; |
2367 | } | 2363 | } |
2368 | 2364 | ||
@@ -2381,7 +2377,7 @@ static void __disable_ftrace_function_probe(void) | |||
2381 | 2377 | ||
2382 | /* no more funcs left */ | 2378 | /* no more funcs left */ |
2383 | __unregister_ftrace_function(&trace_probe_ops); | 2379 | __unregister_ftrace_function(&trace_probe_ops); |
2384 | ftrace_shutdown(0); | 2380 | ftrace_shutdown(&global_ops, 0); |
2385 | ftrace_probe_registered = 0; | 2381 | ftrace_probe_registered = 0; |
2386 | } | 2382 | } |
2387 | 2383 | ||
@@ -3267,6 +3263,10 @@ void __init ftrace_init(void) | |||
3267 | 3263 | ||
3268 | #else | 3264 | #else |
3269 | 3265 | ||
3266 | struct ftrace_ops global_ops = { | ||
3267 | .func = ftrace_stub, | ||
3268 | }; | ||
3269 | |||
3270 | static int __init ftrace_nodyn_init(void) | 3270 | static int __init ftrace_nodyn_init(void) |
3271 | { | 3271 | { |
3272 | ftrace_enabled = 1; | 3272 | ftrace_enabled = 1; |
@@ -3277,8 +3277,8 @@ device_initcall(ftrace_nodyn_init); | |||
3277 | static inline int ftrace_init_dyn_debugfs(struct dentry *d_tracer) { return 0; } | 3277 | static inline int ftrace_init_dyn_debugfs(struct dentry *d_tracer) { return 0; } |
3278 | static inline void ftrace_startup_enable(int command) { } | 3278 | static inline void ftrace_startup_enable(int command) { } |
3279 | /* Keep as macros so we do not need to define the commands */ | 3279 | /* Keep as macros so we do not need to define the commands */ |
3280 | # define ftrace_startup(command) do { } while (0) | 3280 | # define ftrace_startup(ops, command) do { } while (0) |
3281 | # define ftrace_shutdown(command) do { } while (0) | 3281 | # define ftrace_shutdown(ops, command) do { } while (0) |
3282 | # define ftrace_startup_sysctl() do { } while (0) | 3282 | # define ftrace_startup_sysctl() do { } while (0) |
3283 | # define ftrace_shutdown_sysctl() do { } while (0) | 3283 | # define ftrace_shutdown_sysctl() do { } while (0) |
3284 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 3284 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
@@ -3583,7 +3583,7 @@ int register_ftrace_function(struct ftrace_ops *ops) | |||
3583 | goto out_unlock; | 3583 | goto out_unlock; |
3584 | 3584 | ||
3585 | ret = __register_ftrace_function(ops); | 3585 | ret = __register_ftrace_function(ops); |
3586 | ftrace_startup(0); | 3586 | ftrace_startup(&global_ops, 0); |
3587 | 3587 | ||
3588 | out_unlock: | 3588 | out_unlock: |
3589 | mutex_unlock(&ftrace_lock); | 3589 | mutex_unlock(&ftrace_lock); |
@@ -3602,7 +3602,7 @@ int unregister_ftrace_function(struct ftrace_ops *ops) | |||
3602 | 3602 | ||
3603 | mutex_lock(&ftrace_lock); | 3603 | mutex_lock(&ftrace_lock); |
3604 | ret = __unregister_ftrace_function(ops); | 3604 | ret = __unregister_ftrace_function(ops); |
3605 | ftrace_shutdown(0); | 3605 | ftrace_shutdown(&global_ops, 0); |
3606 | mutex_unlock(&ftrace_lock); | 3606 | mutex_unlock(&ftrace_lock); |
3607 | 3607 | ||
3608 | return ret; | 3608 | return ret; |
@@ -3825,7 +3825,7 @@ int register_ftrace_graph(trace_func_graph_ret_t retfunc, | |||
3825 | ftrace_graph_return = retfunc; | 3825 | ftrace_graph_return = retfunc; |
3826 | ftrace_graph_entry = entryfunc; | 3826 | ftrace_graph_entry = entryfunc; |
3827 | 3827 | ||
3828 | ftrace_startup(FTRACE_START_FUNC_RET); | 3828 | ftrace_startup(&global_ops, FTRACE_START_FUNC_RET); |
3829 | 3829 | ||
3830 | out: | 3830 | out: |
3831 | mutex_unlock(&ftrace_lock); | 3831 | mutex_unlock(&ftrace_lock); |
@@ -3842,7 +3842,7 @@ void unregister_ftrace_graph(void) | |||
3842 | ftrace_graph_active--; | 3842 | ftrace_graph_active--; |
3843 | ftrace_graph_return = (trace_func_graph_ret_t)ftrace_stub; | 3843 | ftrace_graph_return = (trace_func_graph_ret_t)ftrace_stub; |
3844 | ftrace_graph_entry = ftrace_graph_entry_stub; | 3844 | ftrace_graph_entry = ftrace_graph_entry_stub; |
3845 | ftrace_shutdown(FTRACE_STOP_FUNC_RET); | 3845 | ftrace_shutdown(&global_ops, FTRACE_STOP_FUNC_RET); |
3846 | unregister_pm_notifier(&ftrace_suspend_notifier); | 3846 | unregister_pm_notifier(&ftrace_suspend_notifier); |
3847 | unregister_trace_sched_switch(ftrace_graph_probe_sched_switch, NULL); | 3847 | unregister_trace_sched_switch(ftrace_graph_probe_sched_switch, NULL); |
3848 | 3848 | ||