diff options
Diffstat (limited to 'include/linux/ftrace.h')
-rw-r--r-- | include/linux/ftrace.h | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 5c990e891d6a..730876187344 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -389,6 +389,7 @@ enum { | |||
389 | FTRACE_UPDATE_TRACE_FUNC = (1 << 2), | 389 | FTRACE_UPDATE_TRACE_FUNC = (1 << 2), |
390 | FTRACE_START_FUNC_RET = (1 << 3), | 390 | FTRACE_START_FUNC_RET = (1 << 3), |
391 | FTRACE_STOP_FUNC_RET = (1 << 4), | 391 | FTRACE_STOP_FUNC_RET = (1 << 4), |
392 | FTRACE_MAY_SLEEP = (1 << 5), | ||
392 | }; | 393 | }; |
393 | 394 | ||
394 | /* | 395 | /* |
@@ -752,6 +753,11 @@ typedef int (*trace_func_graph_ent_t)(struct ftrace_graph_ent *); /* entry */ | |||
752 | 753 | ||
753 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | 754 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
754 | 755 | ||
756 | struct fgraph_ops { | ||
757 | trace_func_graph_ent_t entryfunc; | ||
758 | trace_func_graph_ret_t retfunc; | ||
759 | }; | ||
760 | |||
755 | /* | 761 | /* |
756 | * Stack of return addresses for functions | 762 | * Stack of return addresses for functions |
757 | * of a thread. | 763 | * of a thread. |
@@ -783,6 +789,9 @@ extern int | |||
783 | function_graph_enter(unsigned long ret, unsigned long func, | 789 | function_graph_enter(unsigned long ret, unsigned long func, |
784 | unsigned long frame_pointer, unsigned long *retp); | 790 | unsigned long frame_pointer, unsigned long *retp); |
785 | 791 | ||
792 | struct ftrace_ret_stack * | ||
793 | ftrace_graph_get_ret_stack(struct task_struct *task, int idx); | ||
794 | |||
786 | unsigned long ftrace_graph_ret_addr(struct task_struct *task, int *idx, | 795 | unsigned long ftrace_graph_ret_addr(struct task_struct *task, int *idx, |
787 | unsigned long ret, unsigned long *retp); | 796 | unsigned long ret, unsigned long *retp); |
788 | 797 | ||
@@ -793,11 +802,11 @@ unsigned long ftrace_graph_ret_addr(struct task_struct *task, int *idx, | |||
793 | */ | 802 | */ |
794 | #define __notrace_funcgraph notrace | 803 | #define __notrace_funcgraph notrace |
795 | 804 | ||
796 | #define FTRACE_NOTRACE_DEPTH 65536 | ||
797 | #define FTRACE_RETFUNC_DEPTH 50 | 805 | #define FTRACE_RETFUNC_DEPTH 50 |
798 | #define FTRACE_RETSTACK_ALLOC_SIZE 32 | 806 | #define FTRACE_RETSTACK_ALLOC_SIZE 32 |
799 | extern int register_ftrace_graph(trace_func_graph_ret_t retfunc, | 807 | |
800 | trace_func_graph_ent_t entryfunc); | 808 | extern int register_ftrace_graph(struct fgraph_ops *ops); |
809 | extern void unregister_ftrace_graph(struct fgraph_ops *ops); | ||
801 | 810 | ||
802 | extern bool ftrace_graph_is_dead(void); | 811 | extern bool ftrace_graph_is_dead(void); |
803 | extern void ftrace_graph_stop(void); | 812 | extern void ftrace_graph_stop(void); |
@@ -806,17 +815,10 @@ extern void ftrace_graph_stop(void); | |||
806 | extern trace_func_graph_ret_t ftrace_graph_return; | 815 | extern trace_func_graph_ret_t ftrace_graph_return; |
807 | extern trace_func_graph_ent_t ftrace_graph_entry; | 816 | extern trace_func_graph_ent_t ftrace_graph_entry; |
808 | 817 | ||
809 | extern void unregister_ftrace_graph(void); | ||
810 | |||
811 | extern void ftrace_graph_init_task(struct task_struct *t); | 818 | extern void ftrace_graph_init_task(struct task_struct *t); |
812 | extern void ftrace_graph_exit_task(struct task_struct *t); | 819 | extern void ftrace_graph_exit_task(struct task_struct *t); |
813 | extern void ftrace_graph_init_idle_task(struct task_struct *t, int cpu); | 820 | extern void ftrace_graph_init_idle_task(struct task_struct *t, int cpu); |
814 | 821 | ||
815 | static inline int task_curr_ret_stack(struct task_struct *t) | ||
816 | { | ||
817 | return t->curr_ret_stack; | ||
818 | } | ||
819 | |||
820 | static inline void pause_graph_tracing(void) | 822 | static inline void pause_graph_tracing(void) |
821 | { | 823 | { |
822 | atomic_inc(¤t->tracing_graph_pause); | 824 | atomic_inc(¤t->tracing_graph_pause); |
@@ -834,17 +836,9 @@ static inline void ftrace_graph_init_task(struct task_struct *t) { } | |||
834 | static inline void ftrace_graph_exit_task(struct task_struct *t) { } | 836 | static inline void ftrace_graph_exit_task(struct task_struct *t) { } |
835 | static inline void ftrace_graph_init_idle_task(struct task_struct *t, int cpu) { } | 837 | static inline void ftrace_graph_init_idle_task(struct task_struct *t, int cpu) { } |
836 | 838 | ||
837 | static inline int register_ftrace_graph(trace_func_graph_ret_t retfunc, | 839 | /* Define as macros as fgraph_ops may not be defined */ |
838 | trace_func_graph_ent_t entryfunc) | 840 | #define register_ftrace_graph(ops) ({ -1; }) |
839 | { | 841 | #define unregister_ftrace_graph(ops) do { } while (0) |
840 | return -1; | ||
841 | } | ||
842 | static inline void unregister_ftrace_graph(void) { } | ||
843 | |||
844 | static inline int task_curr_ret_stack(struct task_struct *tsk) | ||
845 | { | ||
846 | return -1; | ||
847 | } | ||
848 | 842 | ||
849 | static inline unsigned long | 843 | static inline unsigned long |
850 | ftrace_graph_ret_addr(struct task_struct *task, int *idx, unsigned long ret, | 844 | ftrace_graph_ret_addr(struct task_struct *task, int *idx, unsigned long ret, |