diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-arm/ftrace.h | 14 | ||||
-rw-r--r-- | include/asm-arm/kprobes.h | 1 | ||||
-rw-r--r-- | include/asm-powerpc/ftrace.h | 14 | ||||
-rw-r--r-- | include/asm-powerpc/hw_irq.h | 10 | ||||
-rw-r--r-- | include/asm-sparc64/ftrace.h | 14 | ||||
-rw-r--r-- | include/asm-x86/alternative.h | 2 | ||||
-rw-r--r-- | include/asm-x86/ftrace.h | 14 | ||||
-rw-r--r-- | include/asm-x86/irqflags.h | 24 | ||||
-rw-r--r-- | include/asm-x86/kdebug.h | 9 | ||||
-rw-r--r-- | include/asm-x86/vsyscall.h | 3 | ||||
-rw-r--r-- | include/linux/ftrace.h | 143 | ||||
-rw-r--r-- | include/linux/irqflags.h | 13 | ||||
-rw-r--r-- | include/linux/kprobes.h | 4 | ||||
-rw-r--r-- | include/linux/linkage.h | 2 | ||||
-rw-r--r-- | include/linux/marker.h | 40 | ||||
-rw-r--r-- | include/linux/preempt.h | 34 | ||||
-rw-r--r-- | include/linux/sched.h | 16 | ||||
-rw-r--r-- | include/linux/writeback.h | 2 |
18 files changed, 322 insertions, 37 deletions
diff --git a/include/asm-arm/ftrace.h b/include/asm-arm/ftrace.h new file mode 100644 index 000000000000..584ef9a8e5a5 --- /dev/null +++ b/include/asm-arm/ftrace.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef _ASM_ARM_FTRACE | ||
2 | #define _ASM_ARM_FTRACE | ||
3 | |||
4 | #ifdef CONFIG_FTRACE | ||
5 | #define MCOUNT_ADDR ((long)(mcount)) | ||
6 | #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */ | ||
7 | |||
8 | #ifndef __ASSEMBLY__ | ||
9 | extern void mcount(void); | ||
10 | #endif | ||
11 | |||
12 | #endif | ||
13 | |||
14 | #endif /* _ASM_ARM_FTRACE */ | ||
diff --git a/include/asm-arm/kprobes.h b/include/asm-arm/kprobes.h index c042194d3ab5..b1a37876942d 100644 --- a/include/asm-arm/kprobes.h +++ b/include/asm-arm/kprobes.h | |||
@@ -59,6 +59,7 @@ struct kprobe_ctlblk { | |||
59 | }; | 59 | }; |
60 | 60 | ||
61 | void arch_remove_kprobe(struct kprobe *); | 61 | void arch_remove_kprobe(struct kprobe *); |
62 | void kretprobe_trampoline(void); | ||
62 | 63 | ||
63 | int kprobe_trap_handler(struct pt_regs *regs, unsigned int instr); | 64 | int kprobe_trap_handler(struct pt_regs *regs, unsigned int instr); |
64 | int kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr); | 65 | int kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr); |
diff --git a/include/asm-powerpc/ftrace.h b/include/asm-powerpc/ftrace.h new file mode 100644 index 000000000000..de921326cca8 --- /dev/null +++ b/include/asm-powerpc/ftrace.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef _ASM_POWERPC_FTRACE | ||
2 | #define _ASM_POWERPC_FTRACE | ||
3 | |||
4 | #ifdef CONFIG_FTRACE | ||
5 | #define MCOUNT_ADDR ((long)(_mcount)) | ||
6 | #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */ | ||
7 | |||
8 | #ifndef __ASSEMBLY__ | ||
9 | extern void _mcount(void); | ||
10 | #endif | ||
11 | |||
12 | #endif | ||
13 | |||
14 | #endif /* _ASM_POWERPC_FTRACE */ | ||
diff --git a/include/asm-powerpc/hw_irq.h b/include/asm-powerpc/hw_irq.h index ad8c9f7fd0e3..f75a5fc64d2e 100644 --- a/include/asm-powerpc/hw_irq.h +++ b/include/asm-powerpc/hw_irq.h | |||
@@ -59,6 +59,11 @@ extern void iseries_handle_interrupts(void); | |||
59 | get_paca()->hard_enabled = 0; \ | 59 | get_paca()->hard_enabled = 0; \ |
60 | } while(0) | 60 | } while(0) |
61 | 61 | ||
62 | static inline int irqs_disabled_flags(unsigned long flags) | ||
63 | { | ||
64 | return flags == 0; | ||
65 | } | ||
66 | |||
62 | #else | 67 | #else |
63 | 68 | ||
64 | #if defined(CONFIG_BOOKE) | 69 | #if defined(CONFIG_BOOKE) |
@@ -113,6 +118,11 @@ static inline void local_irq_save_ptr(unsigned long *flags) | |||
113 | #define hard_irq_enable() local_irq_enable() | 118 | #define hard_irq_enable() local_irq_enable() |
114 | #define hard_irq_disable() local_irq_disable() | 119 | #define hard_irq_disable() local_irq_disable() |
115 | 120 | ||
121 | static inline int irqs_disabled_flags(unsigned long flags) | ||
122 | { | ||
123 | return (flags & MSR_EE) == 0; | ||
124 | } | ||
125 | |||
116 | #endif /* CONFIG_PPC64 */ | 126 | #endif /* CONFIG_PPC64 */ |
117 | 127 | ||
118 | /* | 128 | /* |
diff --git a/include/asm-sparc64/ftrace.h b/include/asm-sparc64/ftrace.h new file mode 100644 index 000000000000..d27716cd38c1 --- /dev/null +++ b/include/asm-sparc64/ftrace.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef _ASM_SPARC64_FTRACE | ||
2 | #define _ASM_SPARC64_FTRACE | ||
3 | |||
4 | #ifdef CONFIG_MCOUNT | ||
5 | #define MCOUNT_ADDR ((long)(_mcount)) | ||
6 | #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */ | ||
7 | |||
8 | #ifndef __ASSEMBLY__ | ||
9 | extern void _mcount(void); | ||
10 | #endif | ||
11 | |||
12 | #endif | ||
13 | |||
14 | #endif /* _ASM_SPARC64_FTRACE */ | ||
diff --git a/include/asm-x86/alternative.h b/include/asm-x86/alternative.h index 1f6a9ca10126..f6aa18eadf71 100644 --- a/include/asm-x86/alternative.h +++ b/include/asm-x86/alternative.h | |||
@@ -72,6 +72,8 @@ static inline void alternatives_smp_module_del(struct module *mod) {} | |||
72 | static inline void alternatives_smp_switch(int smp) {} | 72 | static inline void alternatives_smp_switch(int smp) {} |
73 | #endif /* CONFIG_SMP */ | 73 | #endif /* CONFIG_SMP */ |
74 | 74 | ||
75 | const unsigned char *const *find_nop_table(void); | ||
76 | |||
75 | /* | 77 | /* |
76 | * Alternative instructions for different CPU types or capabilities. | 78 | * Alternative instructions for different CPU types or capabilities. |
77 | * | 79 | * |
diff --git a/include/asm-x86/ftrace.h b/include/asm-x86/ftrace.h new file mode 100644 index 000000000000..c184441133f2 --- /dev/null +++ b/include/asm-x86/ftrace.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef _ASM_X86_FTRACE | ||
2 | #define _ASM_SPARC64_FTRACE | ||
3 | |||
4 | #ifdef CONFIG_FTRACE | ||
5 | #define MCOUNT_ADDR ((long)(mcount)) | ||
6 | #define MCOUNT_INSN_SIZE 5 /* sizeof mcount call */ | ||
7 | |||
8 | #ifndef __ASSEMBLY__ | ||
9 | extern void mcount(void); | ||
10 | #endif | ||
11 | |||
12 | #endif /* CONFIG_FTRACE */ | ||
13 | |||
14 | #endif /* _ASM_X86_FTRACE */ | ||
diff --git a/include/asm-x86/irqflags.h b/include/asm-x86/irqflags.h index c242527f970e..24d71b1eb189 100644 --- a/include/asm-x86/irqflags.h +++ b/include/asm-x86/irqflags.h | |||
@@ -179,8 +179,6 @@ static inline void trace_hardirqs_fixup(void) | |||
179 | * have a reliable stack. x86_64 only. | 179 | * have a reliable stack. x86_64 only. |
180 | */ | 180 | */ |
181 | #define SWAPGS_UNSAFE_STACK swapgs | 181 | #define SWAPGS_UNSAFE_STACK swapgs |
182 | #define ARCH_TRACE_IRQS_ON call trace_hardirqs_on_thunk | ||
183 | #define ARCH_TRACE_IRQS_OFF call trace_hardirqs_off_thunk | ||
184 | #define ARCH_LOCKDEP_SYS_EXIT call lockdep_sys_exit_thunk | 182 | #define ARCH_LOCKDEP_SYS_EXIT call lockdep_sys_exit_thunk |
185 | #define ARCH_LOCKDEP_SYS_EXIT_IRQ \ | 183 | #define ARCH_LOCKDEP_SYS_EXIT_IRQ \ |
186 | TRACE_IRQS_ON; \ | 184 | TRACE_IRQS_ON; \ |
@@ -192,24 +190,6 @@ static inline void trace_hardirqs_fixup(void) | |||
192 | TRACE_IRQS_OFF; | 190 | TRACE_IRQS_OFF; |
193 | 191 | ||
194 | #else | 192 | #else |
195 | #define ARCH_TRACE_IRQS_ON \ | ||
196 | pushl %eax; \ | ||
197 | pushl %ecx; \ | ||
198 | pushl %edx; \ | ||
199 | call trace_hardirqs_on; \ | ||
200 | popl %edx; \ | ||
201 | popl %ecx; \ | ||
202 | popl %eax; | ||
203 | |||
204 | #define ARCH_TRACE_IRQS_OFF \ | ||
205 | pushl %eax; \ | ||
206 | pushl %ecx; \ | ||
207 | pushl %edx; \ | ||
208 | call trace_hardirqs_off; \ | ||
209 | popl %edx; \ | ||
210 | popl %ecx; \ | ||
211 | popl %eax; | ||
212 | |||
213 | #define ARCH_LOCKDEP_SYS_EXIT \ | 193 | #define ARCH_LOCKDEP_SYS_EXIT \ |
214 | pushl %eax; \ | 194 | pushl %eax; \ |
215 | pushl %ecx; \ | 195 | pushl %ecx; \ |
@@ -223,8 +203,8 @@ static inline void trace_hardirqs_fixup(void) | |||
223 | #endif | 203 | #endif |
224 | 204 | ||
225 | #ifdef CONFIG_TRACE_IRQFLAGS | 205 | #ifdef CONFIG_TRACE_IRQFLAGS |
226 | # define TRACE_IRQS_ON ARCH_TRACE_IRQS_ON | 206 | # define TRACE_IRQS_ON call trace_hardirqs_on_thunk; |
227 | # define TRACE_IRQS_OFF ARCH_TRACE_IRQS_OFF | 207 | # define TRACE_IRQS_OFF call trace_hardirqs_off_thunk; |
228 | #else | 208 | #else |
229 | # define TRACE_IRQS_ON | 209 | # define TRACE_IRQS_ON |
230 | # define TRACE_IRQS_OFF | 210 | # define TRACE_IRQS_OFF |
diff --git a/include/asm-x86/kdebug.h b/include/asm-x86/kdebug.h index 96651bb59ba1..a80f2d6cc737 100644 --- a/include/asm-x86/kdebug.h +++ b/include/asm-x86/kdebug.h | |||
@@ -35,4 +35,13 @@ extern void show_regs(struct pt_regs *regs); | |||
35 | extern unsigned long oops_begin(void); | 35 | extern unsigned long oops_begin(void); |
36 | extern void oops_end(unsigned long, struct pt_regs *, int signr); | 36 | extern void oops_end(unsigned long, struct pt_regs *, int signr); |
37 | 37 | ||
38 | struct pf_handler { | ||
39 | struct hlist_node hlist; | ||
40 | int (*handler)(struct pt_regs *regs, unsigned long error_code, | ||
41 | unsigned long address); | ||
42 | }; | ||
43 | |||
44 | extern void register_page_fault_handler(struct pf_handler *new_pfh); | ||
45 | extern void unregister_page_fault_handler(struct pf_handler *old_pfh); | ||
46 | |||
38 | #endif | 47 | #endif |
diff --git a/include/asm-x86/vsyscall.h b/include/asm-x86/vsyscall.h index 17b3700949bf..6b66ff905af0 100644 --- a/include/asm-x86/vsyscall.h +++ b/include/asm-x86/vsyscall.h | |||
@@ -24,7 +24,8 @@ enum vsyscall_num { | |||
24 | ((unused, __section__ (".vsyscall_gtod_data"),aligned(16))) | 24 | ((unused, __section__ (".vsyscall_gtod_data"),aligned(16))) |
25 | #define __section_vsyscall_clock __attribute__ \ | 25 | #define __section_vsyscall_clock __attribute__ \ |
26 | ((unused, __section__ (".vsyscall_clock"),aligned(16))) | 26 | ((unused, __section__ (".vsyscall_clock"),aligned(16))) |
27 | #define __vsyscall_fn __attribute__ ((unused,__section__(".vsyscall_fn"))) | 27 | #define __vsyscall_fn \ |
28 | __attribute__ ((unused, __section__(".vsyscall_fn"))) notrace | ||
28 | 29 | ||
29 | #define VGETCPU_RDTSCP 1 | 30 | #define VGETCPU_RDTSCP 1 |
30 | #define VGETCPU_LSL 2 | 31 | #define VGETCPU_LSL 2 |
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h new file mode 100644 index 000000000000..3121b95443d9 --- /dev/null +++ b/include/linux/ftrace.h | |||
@@ -0,0 +1,143 @@ | |||
1 | #ifndef _LINUX_FTRACE_H | ||
2 | #define _LINUX_FTRACE_H | ||
3 | |||
4 | #ifdef CONFIG_FTRACE | ||
5 | |||
6 | #include <linux/linkage.h> | ||
7 | #include <linux/fs.h> | ||
8 | |||
9 | extern int ftrace_enabled; | ||
10 | extern int | ||
11 | ftrace_enable_sysctl(struct ctl_table *table, int write, | ||
12 | struct file *filp, void __user *buffer, size_t *lenp, | ||
13 | loff_t *ppos); | ||
14 | |||
15 | typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip); | ||
16 | |||
17 | struct ftrace_ops { | ||
18 | ftrace_func_t func; | ||
19 | struct ftrace_ops *next; | ||
20 | }; | ||
21 | |||
22 | /* | ||
23 | * The ftrace_ops must be a static and should also | ||
24 | * be read_mostly. These functions do modify read_mostly variables | ||
25 | * so use them sparely. Never free an ftrace_op or modify the | ||
26 | * next pointer after it has been registered. Even after unregistering | ||
27 | * it, the next pointer may still be used internally. | ||
28 | */ | ||
29 | int register_ftrace_function(struct ftrace_ops *ops); | ||
30 | int unregister_ftrace_function(struct ftrace_ops *ops); | ||
31 | void clear_ftrace_function(void); | ||
32 | |||
33 | extern void ftrace_stub(unsigned long a0, unsigned long a1); | ||
34 | |||
35 | #else /* !CONFIG_FTRACE */ | ||
36 | # define register_ftrace_function(ops) do { } while (0) | ||
37 | # define unregister_ftrace_function(ops) do { } while (0) | ||
38 | # define clear_ftrace_function(ops) do { } while (0) | ||
39 | #endif /* CONFIG_FTRACE */ | ||
40 | |||
41 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
42 | # define FTRACE_HASHBITS 10 | ||
43 | # define FTRACE_HASHSIZE (1<<FTRACE_HASHBITS) | ||
44 | |||
45 | enum { | ||
46 | FTRACE_FL_FREE = (1 << 0), | ||
47 | FTRACE_FL_FAILED = (1 << 1), | ||
48 | FTRACE_FL_FILTER = (1 << 2), | ||
49 | FTRACE_FL_ENABLED = (1 << 3), | ||
50 | FTRACE_FL_NOTRACE = (1 << 4), | ||
51 | FTRACE_FL_CONVERTED = (1 << 5), | ||
52 | FTRACE_FL_FROZEN = (1 << 6), | ||
53 | }; | ||
54 | |||
55 | struct dyn_ftrace { | ||
56 | struct hlist_node node; | ||
57 | unsigned long ip; /* address of mcount call-site */ | ||
58 | unsigned long flags; | ||
59 | }; | ||
60 | |||
61 | int ftrace_force_update(void); | ||
62 | void ftrace_set_filter(unsigned char *buf, int len, int reset); | ||
63 | |||
64 | /* defined in arch */ | ||
65 | extern int ftrace_ip_converted(unsigned long ip); | ||
66 | extern unsigned char *ftrace_nop_replace(void); | ||
67 | extern unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr); | ||
68 | extern int ftrace_dyn_arch_init(void *data); | ||
69 | extern int ftrace_mcount_set(unsigned long *data); | ||
70 | extern int ftrace_modify_code(unsigned long ip, unsigned char *old_code, | ||
71 | unsigned char *new_code); | ||
72 | extern int ftrace_update_ftrace_func(ftrace_func_t func); | ||
73 | extern void ftrace_caller(void); | ||
74 | extern void ftrace_call(void); | ||
75 | extern void mcount_call(void); | ||
76 | |||
77 | extern int skip_trace(unsigned long ip); | ||
78 | |||
79 | void ftrace_disable_daemon(void); | ||
80 | void ftrace_enable_daemon(void); | ||
81 | |||
82 | #else | ||
83 | # define skip_trace(ip) ({ 0; }) | ||
84 | # define ftrace_force_update() ({ 0; }) | ||
85 | # define ftrace_set_filter(buf, len, reset) do { } while (0) | ||
86 | # define ftrace_disable_daemon() do { } while (0) | ||
87 | # define ftrace_enable_daemon() do { } while (0) | ||
88 | #endif /* CONFIG_DYNAMIC_FTRACE */ | ||
89 | |||
90 | /* totally disable ftrace - can not re-enable after this */ | ||
91 | void ftrace_kill(void); | ||
92 | |||
93 | static inline void tracer_disable(void) | ||
94 | { | ||
95 | #ifdef CONFIG_FTRACE | ||
96 | ftrace_enabled = 0; | ||
97 | #endif | ||
98 | } | ||
99 | |||
100 | #ifdef CONFIG_FRAME_POINTER | ||
101 | /* TODO: need to fix this for ARM */ | ||
102 | # define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0)) | ||
103 | # define CALLER_ADDR1 ((unsigned long)__builtin_return_address(1)) | ||
104 | # define CALLER_ADDR2 ((unsigned long)__builtin_return_address(2)) | ||
105 | # define CALLER_ADDR3 ((unsigned long)__builtin_return_address(3)) | ||
106 | # define CALLER_ADDR4 ((unsigned long)__builtin_return_address(4)) | ||
107 | # define CALLER_ADDR5 ((unsigned long)__builtin_return_address(5)) | ||
108 | # define CALLER_ADDR6 ((unsigned long)__builtin_return_address(6)) | ||
109 | #else | ||
110 | # define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0)) | ||
111 | # define CALLER_ADDR1 0UL | ||
112 | # define CALLER_ADDR2 0UL | ||
113 | # define CALLER_ADDR3 0UL | ||
114 | # define CALLER_ADDR4 0UL | ||
115 | # define CALLER_ADDR5 0UL | ||
116 | # define CALLER_ADDR6 0UL | ||
117 | #endif | ||
118 | |||
119 | #ifdef CONFIG_IRQSOFF_TRACER | ||
120 | extern void time_hardirqs_on(unsigned long a0, unsigned long a1); | ||
121 | extern void time_hardirqs_off(unsigned long a0, unsigned long a1); | ||
122 | #else | ||
123 | # define time_hardirqs_on(a0, a1) do { } while (0) | ||
124 | # define time_hardirqs_off(a0, a1) do { } while (0) | ||
125 | #endif | ||
126 | |||
127 | #ifdef CONFIG_PREEMPT_TRACER | ||
128 | extern void trace_preempt_on(unsigned long a0, unsigned long a1); | ||
129 | extern void trace_preempt_off(unsigned long a0, unsigned long a1); | ||
130 | #else | ||
131 | # define trace_preempt_on(a0, a1) do { } while (0) | ||
132 | # define trace_preempt_off(a0, a1) do { } while (0) | ||
133 | #endif | ||
134 | |||
135 | #ifdef CONFIG_TRACING | ||
136 | extern void | ||
137 | ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3); | ||
138 | #else | ||
139 | static inline void | ||
140 | ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { } | ||
141 | #endif | ||
142 | |||
143 | #endif /* _LINUX_FTRACE_H */ | ||
diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h index e600c4e9b8c5..2b1c2e58566e 100644 --- a/include/linux/irqflags.h +++ b/include/linux/irqflags.h | |||
@@ -12,10 +12,10 @@ | |||
12 | #define _LINUX_TRACE_IRQFLAGS_H | 12 | #define _LINUX_TRACE_IRQFLAGS_H |
13 | 13 | ||
14 | #ifdef CONFIG_TRACE_IRQFLAGS | 14 | #ifdef CONFIG_TRACE_IRQFLAGS |
15 | extern void trace_hardirqs_on(void); | ||
16 | extern void trace_hardirqs_off(void); | ||
17 | extern void trace_softirqs_on(unsigned long ip); | 15 | extern void trace_softirqs_on(unsigned long ip); |
18 | extern void trace_softirqs_off(unsigned long ip); | 16 | extern void trace_softirqs_off(unsigned long ip); |
17 | extern void trace_hardirqs_on(void); | ||
18 | extern void trace_hardirqs_off(void); | ||
19 | # define trace_hardirq_context(p) ((p)->hardirq_context) | 19 | # define trace_hardirq_context(p) ((p)->hardirq_context) |
20 | # define trace_softirq_context(p) ((p)->softirq_context) | 20 | # define trace_softirq_context(p) ((p)->softirq_context) |
21 | # define trace_hardirqs_enabled(p) ((p)->hardirqs_enabled) | 21 | # define trace_hardirqs_enabled(p) ((p)->hardirqs_enabled) |
@@ -41,6 +41,15 @@ | |||
41 | # define INIT_TRACE_IRQFLAGS | 41 | # define INIT_TRACE_IRQFLAGS |
42 | #endif | 42 | #endif |
43 | 43 | ||
44 | #if defined(CONFIG_IRQSOFF_TRACER) || \ | ||
45 | defined(CONFIG_PREEMPT_TRACER) | ||
46 | extern void stop_critical_timings(void); | ||
47 | extern void start_critical_timings(void); | ||
48 | #else | ||
49 | # define stop_critical_timings() do { } while (0) | ||
50 | # define start_critical_timings() do { } while (0) | ||
51 | #endif | ||
52 | |||
44 | #ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT | 53 | #ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT |
45 | 54 | ||
46 | #include <asm/irqflags.h> | 55 | #include <asm/irqflags.h> |
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 1036631ff4fa..04a3556bdea6 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
@@ -259,6 +259,10 @@ void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head); | |||
259 | struct jprobe; | 259 | struct jprobe; |
260 | struct kretprobe; | 260 | struct kretprobe; |
261 | 261 | ||
262 | static inline struct kprobe *get_kprobe(void *addr) | ||
263 | { | ||
264 | return NULL; | ||
265 | } | ||
262 | static inline struct kprobe *kprobe_running(void) | 266 | static inline struct kprobe *kprobe_running(void) |
263 | { | 267 | { |
264 | return NULL; | 268 | return NULL; |
diff --git a/include/linux/linkage.h b/include/linux/linkage.h index 2119610b24f8..14f329c64ba8 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h | |||
@@ -3,6 +3,8 @@ | |||
3 | 3 | ||
4 | #include <asm/linkage.h> | 4 | #include <asm/linkage.h> |
5 | 5 | ||
6 | #define notrace __attribute__((no_instrument_function)) | ||
7 | |||
6 | #ifdef __cplusplus | 8 | #ifdef __cplusplus |
7 | #define CPP_ASMLINKAGE extern "C" | 9 | #define CPP_ASMLINKAGE extern "C" |
8 | #else | 10 | #else |
diff --git a/include/linux/marker.h b/include/linux/marker.h index 430f6adf9762..1290653f9241 100644 --- a/include/linux/marker.h +++ b/include/linux/marker.h | |||
@@ -44,8 +44,8 @@ struct marker { | |||
44 | */ | 44 | */ |
45 | char state; /* Marker state. */ | 45 | char state; /* Marker state. */ |
46 | char ptype; /* probe type : 0 : single, 1 : multi */ | 46 | char ptype; /* probe type : 0 : single, 1 : multi */ |
47 | void (*call)(const struct marker *mdata, /* Probe wrapper */ | 47 | /* Probe wrapper */ |
48 | void *call_private, const char *fmt, ...); | 48 | void (*call)(const struct marker *mdata, void *call_private, ...); |
49 | struct marker_probe_closure single; | 49 | struct marker_probe_closure single; |
50 | struct marker_probe_closure *multi; | 50 | struct marker_probe_closure *multi; |
51 | } __attribute__((aligned(8))); | 51 | } __attribute__((aligned(8))); |
@@ -58,8 +58,12 @@ struct marker { | |||
58 | * Make sure the alignment of the structure in the __markers section will | 58 | * Make sure the alignment of the structure in the __markers section will |
59 | * not add unwanted padding between the beginning of the section and the | 59 | * not add unwanted padding between the beginning of the section and the |
60 | * structure. Force alignment to the same alignment as the section start. | 60 | * structure. Force alignment to the same alignment as the section start. |
61 | * | ||
62 | * The "generic" argument controls which marker enabling mechanism must be used. | ||
63 | * If generic is true, a variable read is used. | ||
64 | * If generic is false, immediate values are used. | ||
61 | */ | 65 | */ |
62 | #define __trace_mark(name, call_private, format, args...) \ | 66 | #define __trace_mark(generic, name, call_private, format, args...) \ |
63 | do { \ | 67 | do { \ |
64 | static const char __mstrtab_##name[] \ | 68 | static const char __mstrtab_##name[] \ |
65 | __attribute__((section("__markers_strings"))) \ | 69 | __attribute__((section("__markers_strings"))) \ |
@@ -72,15 +76,14 @@ struct marker { | |||
72 | __mark_check_format(format, ## args); \ | 76 | __mark_check_format(format, ## args); \ |
73 | if (unlikely(__mark_##name.state)) { \ | 77 | if (unlikely(__mark_##name.state)) { \ |
74 | (*__mark_##name.call) \ | 78 | (*__mark_##name.call) \ |
75 | (&__mark_##name, call_private, \ | 79 | (&__mark_##name, call_private, ## args);\ |
76 | format, ## args); \ | ||
77 | } \ | 80 | } \ |
78 | } while (0) | 81 | } while (0) |
79 | 82 | ||
80 | extern void marker_update_probe_range(struct marker *begin, | 83 | extern void marker_update_probe_range(struct marker *begin, |
81 | struct marker *end); | 84 | struct marker *end); |
82 | #else /* !CONFIG_MARKERS */ | 85 | #else /* !CONFIG_MARKERS */ |
83 | #define __trace_mark(name, call_private, format, args...) \ | 86 | #define __trace_mark(generic, name, call_private, format, args...) \ |
84 | __mark_check_format(format, ## args) | 87 | __mark_check_format(format, ## args) |
85 | static inline void marker_update_probe_range(struct marker *begin, | 88 | static inline void marker_update_probe_range(struct marker *begin, |
86 | struct marker *end) | 89 | struct marker *end) |
@@ -88,15 +91,30 @@ static inline void marker_update_probe_range(struct marker *begin, | |||
88 | #endif /* CONFIG_MARKERS */ | 91 | #endif /* CONFIG_MARKERS */ |
89 | 92 | ||
90 | /** | 93 | /** |
91 | * trace_mark - Marker | 94 | * trace_mark - Marker using code patching |
92 | * @name: marker name, not quoted. | 95 | * @name: marker name, not quoted. |
93 | * @format: format string | 96 | * @format: format string |
94 | * @args...: variable argument list | 97 | * @args...: variable argument list |
95 | * | 98 | * |
96 | * Places a marker. | 99 | * Places a marker using optimized code patching technique (imv_read()) |
100 | * to be enabled when immediate values are present. | ||
97 | */ | 101 | */ |
98 | #define trace_mark(name, format, args...) \ | 102 | #define trace_mark(name, format, args...) \ |
99 | __trace_mark(name, NULL, format, ## args) | 103 | __trace_mark(0, name, NULL, format, ## args) |
104 | |||
105 | /** | ||
106 | * _trace_mark - Marker using variable read | ||
107 | * @name: marker name, not quoted. | ||
108 | * @format: format string | ||
109 | * @args...: variable argument list | ||
110 | * | ||
111 | * Places a marker using a standard memory read (_imv_read()) to be | ||
112 | * enabled. Should be used for markers in code paths where instruction | ||
113 | * modification based enabling is not welcome. (__init and __exit functions, | ||
114 | * lockdep, some traps, printk). | ||
115 | */ | ||
116 | #define _trace_mark(name, format, args...) \ | ||
117 | __trace_mark(1, name, NULL, format, ## args) | ||
100 | 118 | ||
101 | /** | 119 | /** |
102 | * MARK_NOARGS - Format string for a marker with no argument. | 120 | * MARK_NOARGS - Format string for a marker with no argument. |
@@ -117,9 +135,9 @@ static inline void __printf(1, 2) ___mark_check_format(const char *fmt, ...) | |||
117 | extern marker_probe_func __mark_empty_function; | 135 | extern marker_probe_func __mark_empty_function; |
118 | 136 | ||
119 | extern void marker_probe_cb(const struct marker *mdata, | 137 | extern void marker_probe_cb(const struct marker *mdata, |
120 | void *call_private, const char *fmt, ...); | 138 | void *call_private, ...); |
121 | extern void marker_probe_cb_noarg(const struct marker *mdata, | 139 | extern void marker_probe_cb_noarg(const struct marker *mdata, |
122 | void *call_private, const char *fmt, ...); | 140 | void *call_private, ...); |
123 | 141 | ||
124 | /* | 142 | /* |
125 | * Connect a probe to a marker. | 143 | * Connect a probe to a marker. |
diff --git a/include/linux/preempt.h b/include/linux/preempt.h index 23f0c54175cd..72b1a10a59b6 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h | |||
@@ -10,7 +10,7 @@ | |||
10 | #include <linux/linkage.h> | 10 | #include <linux/linkage.h> |
11 | #include <linux/list.h> | 11 | #include <linux/list.h> |
12 | 12 | ||
13 | #ifdef CONFIG_DEBUG_PREEMPT | 13 | #if defined(CONFIG_DEBUG_PREEMPT) || defined(CONFIG_PREEMPT_TRACER) |
14 | extern void add_preempt_count(int val); | 14 | extern void add_preempt_count(int val); |
15 | extern void sub_preempt_count(int val); | 15 | extern void sub_preempt_count(int val); |
16 | #else | 16 | #else |
@@ -52,6 +52,34 @@ do { \ | |||
52 | preempt_check_resched(); \ | 52 | preempt_check_resched(); \ |
53 | } while (0) | 53 | } while (0) |
54 | 54 | ||
55 | /* For debugging and tracer internals only! */ | ||
56 | #define add_preempt_count_notrace(val) \ | ||
57 | do { preempt_count() += (val); } while (0) | ||
58 | #define sub_preempt_count_notrace(val) \ | ||
59 | do { preempt_count() -= (val); } while (0) | ||
60 | #define inc_preempt_count_notrace() add_preempt_count_notrace(1) | ||
61 | #define dec_preempt_count_notrace() sub_preempt_count_notrace(1) | ||
62 | |||
63 | #define preempt_disable_notrace() \ | ||
64 | do { \ | ||
65 | inc_preempt_count_notrace(); \ | ||
66 | barrier(); \ | ||
67 | } while (0) | ||
68 | |||
69 | #define preempt_enable_no_resched_notrace() \ | ||
70 | do { \ | ||
71 | barrier(); \ | ||
72 | dec_preempt_count_notrace(); \ | ||
73 | } while (0) | ||
74 | |||
75 | /* preempt_check_resched is OK to trace */ | ||
76 | #define preempt_enable_notrace() \ | ||
77 | do { \ | ||
78 | preempt_enable_no_resched_notrace(); \ | ||
79 | barrier(); \ | ||
80 | preempt_check_resched(); \ | ||
81 | } while (0) | ||
82 | |||
55 | #else | 83 | #else |
56 | 84 | ||
57 | #define preempt_disable() do { } while (0) | 85 | #define preempt_disable() do { } while (0) |
@@ -59,6 +87,10 @@ do { \ | |||
59 | #define preempt_enable() do { } while (0) | 87 | #define preempt_enable() do { } while (0) |
60 | #define preempt_check_resched() do { } while (0) | 88 | #define preempt_check_resched() do { } while (0) |
61 | 89 | ||
90 | #define preempt_disable_notrace() do { } while (0) | ||
91 | #define preempt_enable_no_resched_notrace() do { } while (0) | ||
92 | #define preempt_enable_notrace() do { } while (0) | ||
93 | |||
62 | #endif | 94 | #endif |
63 | 95 | ||
64 | #ifdef CONFIG_PREEMPT_NOTIFIERS | 96 | #ifdef CONFIG_PREEMPT_NOTIFIERS |
diff --git a/include/linux/sched.h b/include/linux/sched.h index c5d3f847ca8d..aa609858aef0 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -246,6 +246,8 @@ extern asmlinkage void schedule_tail(struct task_struct *prev); | |||
246 | extern void init_idle(struct task_struct *idle, int cpu); | 246 | extern void init_idle(struct task_struct *idle, int cpu); |
247 | extern void init_idle_bootup_task(struct task_struct *idle); | 247 | extern void init_idle_bootup_task(struct task_struct *idle); |
248 | 248 | ||
249 | extern int runqueue_is_locked(void); | ||
250 | |||
249 | extern cpumask_t nohz_cpu_mask; | 251 | extern cpumask_t nohz_cpu_mask; |
250 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) | 252 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) |
251 | extern int select_nohz_load_balancer(int cpu); | 253 | extern int select_nohz_load_balancer(int cpu); |
@@ -2131,6 +2133,18 @@ static inline void arch_pick_mmap_layout(struct mm_struct *mm) | |||
2131 | } | 2133 | } |
2132 | #endif | 2134 | #endif |
2133 | 2135 | ||
2136 | #ifdef CONFIG_TRACING | ||
2137 | extern void | ||
2138 | __trace_special(void *__tr, void *__data, | ||
2139 | unsigned long arg1, unsigned long arg2, unsigned long arg3); | ||
2140 | #else | ||
2141 | static inline void | ||
2142 | __trace_special(void *__tr, void *__data, | ||
2143 | unsigned long arg1, unsigned long arg2, unsigned long arg3) | ||
2144 | { | ||
2145 | } | ||
2146 | #endif | ||
2147 | |||
2134 | extern long sched_setaffinity(pid_t pid, const cpumask_t *new_mask); | 2148 | extern long sched_setaffinity(pid_t pid, const cpumask_t *new_mask); |
2135 | extern long sched_getaffinity(pid_t pid, cpumask_t *mask); | 2149 | extern long sched_getaffinity(pid_t pid, cpumask_t *mask); |
2136 | 2150 | ||
@@ -2225,6 +2239,8 @@ static inline void mm_init_owner(struct mm_struct *mm, struct task_struct *p) | |||
2225 | } | 2239 | } |
2226 | #endif /* CONFIG_MM_OWNER */ | 2240 | #endif /* CONFIG_MM_OWNER */ |
2227 | 2241 | ||
2242 | #define TASK_STATE_TO_CHAR_STR "RSDTtZX" | ||
2243 | |||
2228 | #endif /* __KERNEL__ */ | 2244 | #endif /* __KERNEL__ */ |
2229 | 2245 | ||
2230 | #endif | 2246 | #endif |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index f462439cc288..bd91987c065f 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -105,6 +105,8 @@ extern int vm_highmem_is_dirtyable; | |||
105 | extern int block_dump; | 105 | extern int block_dump; |
106 | extern int laptop_mode; | 106 | extern int laptop_mode; |
107 | 107 | ||
108 | extern unsigned long determine_dirtyable_memory(void); | ||
109 | |||
108 | extern int dirty_ratio_handler(struct ctl_table *table, int write, | 110 | extern int dirty_ratio_handler(struct ctl_table *table, int write, |
109 | struct file *filp, void __user *buffer, size_t *lenp, | 111 | struct file *filp, void __user *buffer, size_t *lenp, |
110 | loff_t *ppos); | 112 | loff_t *ppos); |