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>
This commit is contained in:
committed by
Steven Rostedt
parent
a798c10faf
commit
4104d326b6
@ -416,13 +416,7 @@ enum {
|
||||
TRACE_FTRACE_IRQ_BIT,
|
||||
TRACE_FTRACE_SIRQ_BIT,
|
||||
|
||||
/* GLOBAL_BITs must be greater than FTRACE_BITs */
|
||||
TRACE_GLOBAL_BIT,
|
||||
TRACE_GLOBAL_NMI_BIT,
|
||||
TRACE_GLOBAL_IRQ_BIT,
|
||||
TRACE_GLOBAL_SIRQ_BIT,
|
||||
|
||||
/* INTERNAL_BITs must be greater than GLOBAL_BITs */
|
||||
/* INTERNAL_BITs must be greater than FTRACE_BITs */
|
||||
TRACE_INTERNAL_BIT,
|
||||
TRACE_INTERNAL_NMI_BIT,
|
||||
TRACE_INTERNAL_IRQ_BIT,
|
||||
@ -449,9 +443,6 @@ enum {
|
||||
#define TRACE_FTRACE_START TRACE_FTRACE_BIT
|
||||
#define TRACE_FTRACE_MAX ((1 << (TRACE_FTRACE_START + TRACE_CONTEXT_BITS)) - 1)
|
||||
|
||||
#define TRACE_GLOBAL_START TRACE_GLOBAL_BIT
|
||||
#define TRACE_GLOBAL_MAX ((1 << (TRACE_GLOBAL_START + TRACE_CONTEXT_BITS)) - 1)
|
||||
|
||||
#define TRACE_LIST_START TRACE_INTERNAL_BIT
|
||||
#define TRACE_LIST_MAX ((1 << (TRACE_LIST_START + TRACE_CONTEXT_BITS)) - 1)
|
||||
|
||||
@ -823,6 +814,9 @@ extern int ftrace_is_dead(void);
|
||||
int ftrace_create_function_files(struct trace_array *tr,
|
||||
struct dentry *parent);
|
||||
void ftrace_destroy_function_files(struct trace_array *tr);
|
||||
void ftrace_init_global_array_ops(struct trace_array *tr);
|
||||
void ftrace_init_array_ops(struct trace_array *tr, ftrace_func_t func);
|
||||
void ftrace_reset_array_ops(struct trace_array *tr);
|
||||
#else
|
||||
static inline int ftrace_trace_task(struct task_struct *task)
|
||||
{
|
||||
@ -836,6 +830,11 @@ ftrace_create_function_files(struct trace_array *tr,
|
||||
return 0;
|
||||
}
|
||||
static inline void ftrace_destroy_function_files(struct trace_array *tr) { }
|
||||
static inline __init void
|
||||
ftrace_init_global_array_ops(struct trace_array *tr) { }
|
||||
static inline void ftrace_reset_array_ops(struct trace_array *tr) { }
|
||||
/* ftace_func_t type is not defined, use macro instead of static inline */
|
||||
#define ftrace_init_array_ops(tr, func) do { } while (0)
|
||||
#endif /* CONFIG_FUNCTION_TRACER */
|
||||
|
||||
#if defined(CONFIG_FUNCTION_TRACER) && defined(CONFIG_DYNAMIC_FTRACE)
|
||||
|
Reference in New Issue
Block a user