aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.h
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2014-01-10 17:01:58 -0500
committerSteven Rostedt <rostedt@goodmis.org>2014-04-21 13:59:25 -0400
commit4104d326b670c2b66f575d2004daa28b2d1b4c8d (patch)
tree9eb7a3084d9bc9d7d5b6eccb0d17d37481020c61 /kernel/trace/trace.h
parenta798c10faf62a505d24e5f6213fbaf904a39623f (diff)
ftrace: Remove global function list and call function directly
Instead of having a list of global functions that are called, as only one global function is allow to be enabled at a time, there's no reason to have a list. Instead, simply have all the users of the global ops, use the global ops directly, instead of registering their own ftrace_ops. Just switch what function is used before enabling the function tracer. This removes a lot of code as well as the complexity involved with it. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r--kernel/trace/trace.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 2e29d7ba5a52..df5256be64cd 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -416,13 +416,7 @@ enum {
416 TRACE_FTRACE_IRQ_BIT, 416 TRACE_FTRACE_IRQ_BIT,
417 TRACE_FTRACE_SIRQ_BIT, 417 TRACE_FTRACE_SIRQ_BIT,
418 418
419 /* GLOBAL_BITs must be greater than FTRACE_BITs */ 419 /* INTERNAL_BITs must be greater than FTRACE_BITs */
420 TRACE_GLOBAL_BIT,
421 TRACE_GLOBAL_NMI_BIT,
422 TRACE_GLOBAL_IRQ_BIT,
423 TRACE_GLOBAL_SIRQ_BIT,
424
425 /* INTERNAL_BITs must be greater than GLOBAL_BITs */
426 TRACE_INTERNAL_BIT, 420 TRACE_INTERNAL_BIT,
427 TRACE_INTERNAL_NMI_BIT, 421 TRACE_INTERNAL_NMI_BIT,
428 TRACE_INTERNAL_IRQ_BIT, 422 TRACE_INTERNAL_IRQ_BIT,
@@ -449,9 +443,6 @@ enum {
449#define TRACE_FTRACE_START TRACE_FTRACE_BIT 443#define TRACE_FTRACE_START TRACE_FTRACE_BIT
450#define TRACE_FTRACE_MAX ((1 << (TRACE_FTRACE_START + TRACE_CONTEXT_BITS)) - 1) 444#define TRACE_FTRACE_MAX ((1 << (TRACE_FTRACE_START + TRACE_CONTEXT_BITS)) - 1)
451 445
452#define TRACE_GLOBAL_START TRACE_GLOBAL_BIT
453#define TRACE_GLOBAL_MAX ((1 << (TRACE_GLOBAL_START + TRACE_CONTEXT_BITS)) - 1)
454
455#define TRACE_LIST_START TRACE_INTERNAL_BIT 446#define TRACE_LIST_START TRACE_INTERNAL_BIT
456#define TRACE_LIST_MAX ((1 << (TRACE_LIST_START + TRACE_CONTEXT_BITS)) - 1) 447#define TRACE_LIST_MAX ((1 << (TRACE_LIST_START + TRACE_CONTEXT_BITS)) - 1)
457 448
@@ -823,6 +814,9 @@ extern int ftrace_is_dead(void);
823int ftrace_create_function_files(struct trace_array *tr, 814int ftrace_create_function_files(struct trace_array *tr,
824 struct dentry *parent); 815 struct dentry *parent);
825void ftrace_destroy_function_files(struct trace_array *tr); 816void ftrace_destroy_function_files(struct trace_array *tr);
817void ftrace_init_global_array_ops(struct trace_array *tr);
818void ftrace_init_array_ops(struct trace_array *tr, ftrace_func_t func);
819void ftrace_reset_array_ops(struct trace_array *tr);
826#else 820#else
827static inline int ftrace_trace_task(struct task_struct *task) 821static inline int ftrace_trace_task(struct task_struct *task)
828{ 822{
@@ -836,6 +830,11 @@ ftrace_create_function_files(struct trace_array *tr,
836 return 0; 830 return 0;
837} 831}
838static inline void ftrace_destroy_function_files(struct trace_array *tr) { } 832static inline void ftrace_destroy_function_files(struct trace_array *tr) { }
833static inline __init void
834ftrace_init_global_array_ops(struct trace_array *tr) { }
835static inline void ftrace_reset_array_ops(struct trace_array *tr) { }
836/* ftace_func_t type is not defined, use macro instead of static inline */
837#define ftrace_init_array_ops(tr, func) do { } while (0)
839#endif /* CONFIG_FUNCTION_TRACER */ 838#endif /* CONFIG_FUNCTION_TRACER */
840 839
841#if defined(CONFIG_FUNCTION_TRACER) && defined(CONFIG_DYNAMIC_FTRACE) 840#if defined(CONFIG_FUNCTION_TRACER) && defined(CONFIG_DYNAMIC_FTRACE)