diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-28 12:52:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-28 12:52:25 -0400 |
commit | e946217e4fdaa67681bbabfa8e6b18641921f750 (patch) | |
tree | 057ad6cb5869e20db7b93f154319560b55cbc725 /include | |
parent | a1865769254dd4eefbc1e857d17bc2a77d5f8580 (diff) | |
parent | 60063a66236c15f5613f91390631e06718689782 (diff) |
Merge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (31 commits)
ftrace: fix current_tracer error return
tracing: fix a build error on alpha
ftrace: use a real variable for ftrace_nop in x86
tracing/ftrace: make boot tracer select the sched_switch tracer
tracepoint: check if the probe has been registered
asm-generic: define DIE_OOPS in asm-generic
trace: fix printk warning for u64
ftrace: warning in kernel/trace/ftrace.c
ftrace: fix build failure
ftrace, powerpc, sparc64, x86: remove notrace from arch ftrace file
ftrace: remove ftrace hash
ftrace: remove mcount set
ftrace: remove daemon
ftrace: disable dynamic ftrace for all archs that use daemon
ftrace: add ftrace warn on to disable ftrace
ftrace: only have ftrace_kill atomic
ftrace: use probe_kernel
ftrace: comment arch ftrace code
ftrace: return error on failed modified text.
ftrace: dynamic ftrace process only text section
...
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-generic/kdebug.h | 1 | ||||
-rw-r--r-- | include/linux/ftrace.h | 48 |
2 files changed, 33 insertions, 16 deletions
diff --git a/include/asm-generic/kdebug.h b/include/asm-generic/kdebug.h index 2b799c90b2d4..11e57b6a85fc 100644 --- a/include/asm-generic/kdebug.h +++ b/include/asm-generic/kdebug.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | enum die_val { | 4 | enum die_val { |
5 | DIE_UNUSED, | 5 | DIE_UNUSED, |
6 | DIE_OOPS=1 | ||
6 | }; | 7 | }; |
7 | 8 | ||
8 | #endif /* _ASM_GENERIC_KDEBUG_H */ | 9 | #endif /* _ASM_GENERIC_KDEBUG_H */ |
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index a3d46151be19..703eb53cfa2b 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -8,7 +8,7 @@ | |||
8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
9 | #include <linux/kallsyms.h> | 9 | #include <linux/kallsyms.h> |
10 | 10 | ||
11 | #ifdef CONFIG_FTRACE | 11 | #ifdef CONFIG_FUNCTION_TRACER |
12 | 12 | ||
13 | extern int ftrace_enabled; | 13 | extern int ftrace_enabled; |
14 | extern int | 14 | extern int |
@@ -36,16 +36,14 @@ void clear_ftrace_function(void); | |||
36 | 36 | ||
37 | extern void ftrace_stub(unsigned long a0, unsigned long a1); | 37 | extern void ftrace_stub(unsigned long a0, unsigned long a1); |
38 | 38 | ||
39 | #else /* !CONFIG_FTRACE */ | 39 | #else /* !CONFIG_FUNCTION_TRACER */ |
40 | # define register_ftrace_function(ops) do { } while (0) | 40 | # define register_ftrace_function(ops) do { } while (0) |
41 | # define unregister_ftrace_function(ops) do { } while (0) | 41 | # define unregister_ftrace_function(ops) do { } while (0) |
42 | # define clear_ftrace_function(ops) do { } while (0) | 42 | # define clear_ftrace_function(ops) do { } while (0) |
43 | static inline void ftrace_kill_atomic(void) { } | 43 | static inline void ftrace_kill(void) { } |
44 | #endif /* CONFIG_FTRACE */ | 44 | #endif /* CONFIG_FUNCTION_TRACER */ |
45 | 45 | ||
46 | #ifdef CONFIG_DYNAMIC_FTRACE | 46 | #ifdef CONFIG_DYNAMIC_FTRACE |
47 | # define FTRACE_HASHBITS 10 | ||
48 | # define FTRACE_HASHSIZE (1<<FTRACE_HASHBITS) | ||
49 | 47 | ||
50 | enum { | 48 | enum { |
51 | FTRACE_FL_FREE = (1 << 0), | 49 | FTRACE_FL_FREE = (1 << 0), |
@@ -58,9 +56,9 @@ enum { | |||
58 | }; | 56 | }; |
59 | 57 | ||
60 | struct dyn_ftrace { | 58 | struct dyn_ftrace { |
61 | struct hlist_node node; | 59 | struct list_head list; |
62 | unsigned long ip; /* address of mcount call-site */ | 60 | unsigned long ip; /* address of mcount call-site */ |
63 | unsigned long flags; | 61 | unsigned long flags; |
64 | }; | 62 | }; |
65 | 63 | ||
66 | int ftrace_force_update(void); | 64 | int ftrace_force_update(void); |
@@ -71,14 +69,33 @@ extern int ftrace_ip_converted(unsigned long ip); | |||
71 | extern unsigned char *ftrace_nop_replace(void); | 69 | extern unsigned char *ftrace_nop_replace(void); |
72 | extern unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr); | 70 | extern unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr); |
73 | extern int ftrace_dyn_arch_init(void *data); | 71 | extern int ftrace_dyn_arch_init(void *data); |
74 | extern int ftrace_mcount_set(unsigned long *data); | ||
75 | extern int ftrace_modify_code(unsigned long ip, unsigned char *old_code, | ||
76 | unsigned char *new_code); | ||
77 | extern int ftrace_update_ftrace_func(ftrace_func_t func); | 72 | extern int ftrace_update_ftrace_func(ftrace_func_t func); |
78 | extern void ftrace_caller(void); | 73 | extern void ftrace_caller(void); |
79 | extern void ftrace_call(void); | 74 | extern void ftrace_call(void); |
80 | extern void mcount_call(void); | 75 | extern void mcount_call(void); |
81 | 76 | ||
77 | /** | ||
78 | * ftrace_modify_code - modify code segment | ||
79 | * @ip: the address of the code segment | ||
80 | * @old_code: the contents of what is expected to be there | ||
81 | * @new_code: the code to patch in | ||
82 | * | ||
83 | * This is a very sensitive operation and great care needs | ||
84 | * to be taken by the arch. The operation should carefully | ||
85 | * read the location, check to see if what is read is indeed | ||
86 | * what we expect it to be, and then on success of the compare, | ||
87 | * it should write to the location. | ||
88 | * | ||
89 | * Return must be: | ||
90 | * 0 on success | ||
91 | * -EFAULT on error reading the location | ||
92 | * -EINVAL on a failed compare of the contents | ||
93 | * -EPERM on error writing to the location | ||
94 | * Any other value will be considered a failure. | ||
95 | */ | ||
96 | extern int ftrace_modify_code(unsigned long ip, unsigned char *old_code, | ||
97 | unsigned char *new_code); | ||
98 | |||
82 | extern int skip_trace(unsigned long ip); | 99 | extern int skip_trace(unsigned long ip); |
83 | 100 | ||
84 | extern void ftrace_release(void *start, unsigned long size); | 101 | extern void ftrace_release(void *start, unsigned long size); |
@@ -97,11 +114,10 @@ static inline void ftrace_release(void *start, unsigned long size) { } | |||
97 | 114 | ||
98 | /* totally disable ftrace - can not re-enable after this */ | 115 | /* totally disable ftrace - can not re-enable after this */ |
99 | void ftrace_kill(void); | 116 | void ftrace_kill(void); |
100 | void ftrace_kill_atomic(void); | ||
101 | 117 | ||
102 | static inline void tracer_disable(void) | 118 | static inline void tracer_disable(void) |
103 | { | 119 | { |
104 | #ifdef CONFIG_FTRACE | 120 | #ifdef CONFIG_FUNCTION_TRACER |
105 | ftrace_enabled = 0; | 121 | ftrace_enabled = 0; |
106 | #endif | 122 | #endif |
107 | } | 123 | } |
@@ -113,7 +129,7 @@ static inline void tracer_disable(void) | |||
113 | */ | 129 | */ |
114 | static inline int __ftrace_enabled_save(void) | 130 | static inline int __ftrace_enabled_save(void) |
115 | { | 131 | { |
116 | #ifdef CONFIG_FTRACE | 132 | #ifdef CONFIG_FUNCTION_TRACER |
117 | int saved_ftrace_enabled = ftrace_enabled; | 133 | int saved_ftrace_enabled = ftrace_enabled; |
118 | ftrace_enabled = 0; | 134 | ftrace_enabled = 0; |
119 | return saved_ftrace_enabled; | 135 | return saved_ftrace_enabled; |
@@ -124,7 +140,7 @@ static inline int __ftrace_enabled_save(void) | |||
124 | 140 | ||
125 | static inline void __ftrace_enabled_restore(int enabled) | 141 | static inline void __ftrace_enabled_restore(int enabled) |
126 | { | 142 | { |
127 | #ifdef CONFIG_FTRACE | 143 | #ifdef CONFIG_FUNCTION_TRACER |
128 | ftrace_enabled = enabled; | 144 | ftrace_enabled = enabled; |
129 | #endif | 145 | #endif |
130 | } | 146 | } |