diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-07-14 10:11:52 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-14 10:11:52 -0400 |
commit | 5806b81ac1c0c52665b91723fd4146a4f86e386b (patch) | |
tree | 24ea8763bf308ce1407c1de91dc8de4d2655e1c1 /include/linux | |
parent | d14c8a680ccfdeb5e7b9be4d61162c2b373bd1e8 (diff) | |
parent | 6712e299b7dc78aa4971b85e803435ee6d49a9dd (diff) |
Merge branch 'auto-ftrace-next' into tracing/for-linus
Conflicts:
arch/x86/kernel/entry_32.S
arch/x86/kernel/process_32.c
arch/x86/kernel/process_64.c
arch/x86/lib/Makefile
include/asm-x86/irqflags.h
kernel/Makefile
kernel/sched.c
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/ftrace.h | 144 | ||||
-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/mmiotrace.h | 85 | ||||
-rw-r--r-- | include/linux/preempt.h | 34 | ||||
-rw-r--r-- | include/linux/sched.h | 16 | ||||
-rw-r--r-- | include/linux/writeback.h | 2 |
9 files changed, 326 insertions, 14 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h new file mode 100644 index 000000000000..f368d041e02d --- /dev/null +++ b/include/linux/ftrace.h | |||
@@ -0,0 +1,144 @@ | |||
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 | void ftrace_kill_atomic(void); | ||
93 | |||
94 | static inline void tracer_disable(void) | ||
95 | { | ||
96 | #ifdef CONFIG_FTRACE | ||
97 | ftrace_enabled = 0; | ||
98 | #endif | ||
99 | } | ||
100 | |||
101 | #ifdef CONFIG_FRAME_POINTER | ||
102 | /* TODO: need to fix this for ARM */ | ||
103 | # define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0)) | ||
104 | # define CALLER_ADDR1 ((unsigned long)__builtin_return_address(1)) | ||
105 | # define CALLER_ADDR2 ((unsigned long)__builtin_return_address(2)) | ||
106 | # define CALLER_ADDR3 ((unsigned long)__builtin_return_address(3)) | ||
107 | # define CALLER_ADDR4 ((unsigned long)__builtin_return_address(4)) | ||
108 | # define CALLER_ADDR5 ((unsigned long)__builtin_return_address(5)) | ||
109 | # define CALLER_ADDR6 ((unsigned long)__builtin_return_address(6)) | ||
110 | #else | ||
111 | # define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0)) | ||
112 | # define CALLER_ADDR1 0UL | ||
113 | # define CALLER_ADDR2 0UL | ||
114 | # define CALLER_ADDR3 0UL | ||
115 | # define CALLER_ADDR4 0UL | ||
116 | # define CALLER_ADDR5 0UL | ||
117 | # define CALLER_ADDR6 0UL | ||
118 | #endif | ||
119 | |||
120 | #ifdef CONFIG_IRQSOFF_TRACER | ||
121 | extern void time_hardirqs_on(unsigned long a0, unsigned long a1); | ||
122 | extern void time_hardirqs_off(unsigned long a0, unsigned long a1); | ||
123 | #else | ||
124 | # define time_hardirqs_on(a0, a1) do { } while (0) | ||
125 | # define time_hardirqs_off(a0, a1) do { } while (0) | ||
126 | #endif | ||
127 | |||
128 | #ifdef CONFIG_PREEMPT_TRACER | ||
129 | extern void trace_preempt_on(unsigned long a0, unsigned long a1); | ||
130 | extern void trace_preempt_off(unsigned long a0, unsigned long a1); | ||
131 | #else | ||
132 | # define trace_preempt_on(a0, a1) do { } while (0) | ||
133 | # define trace_preempt_off(a0, a1) do { } while (0) | ||
134 | #endif | ||
135 | |||
136 | #ifdef CONFIG_TRACING | ||
137 | extern void | ||
138 | ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3); | ||
139 | #else | ||
140 | static inline void | ||
141 | ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { } | ||
142 | #endif | ||
143 | |||
144 | #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 9fd1f859021b..56ba37394656 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h | |||
@@ -4,6 +4,8 @@ | |||
4 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
5 | #include <asm/linkage.h> | 5 | #include <asm/linkage.h> |
6 | 6 | ||
7 | #define notrace __attribute__((no_instrument_function)) | ||
8 | |||
7 | #ifdef __cplusplus | 9 | #ifdef __cplusplus |
8 | #define CPP_ASMLINKAGE extern "C" | 10 | #define CPP_ASMLINKAGE extern "C" |
9 | #else | 11 | #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/mmiotrace.h b/include/linux/mmiotrace.h new file mode 100644 index 000000000000..61d19e1b7a0b --- /dev/null +++ b/include/linux/mmiotrace.h | |||
@@ -0,0 +1,85 @@ | |||
1 | #ifndef MMIOTRACE_H | ||
2 | #define MMIOTRACE_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <linux/list.h> | ||
6 | |||
7 | struct kmmio_probe; | ||
8 | struct pt_regs; | ||
9 | |||
10 | typedef void (*kmmio_pre_handler_t)(struct kmmio_probe *, | ||
11 | struct pt_regs *, unsigned long addr); | ||
12 | typedef void (*kmmio_post_handler_t)(struct kmmio_probe *, | ||
13 | unsigned long condition, struct pt_regs *); | ||
14 | |||
15 | struct kmmio_probe { | ||
16 | struct list_head list; /* kmmio internal list */ | ||
17 | unsigned long addr; /* start location of the probe point */ | ||
18 | unsigned long len; /* length of the probe region */ | ||
19 | kmmio_pre_handler_t pre_handler; /* Called before addr is executed. */ | ||
20 | kmmio_post_handler_t post_handler; /* Called after addr is executed */ | ||
21 | void *private; | ||
22 | }; | ||
23 | |||
24 | /* kmmio is active by some kmmio_probes? */ | ||
25 | static inline int is_kmmio_active(void) | ||
26 | { | ||
27 | extern unsigned int kmmio_count; | ||
28 | return kmmio_count; | ||
29 | } | ||
30 | |||
31 | extern int register_kmmio_probe(struct kmmio_probe *p); | ||
32 | extern void unregister_kmmio_probe(struct kmmio_probe *p); | ||
33 | |||
34 | /* Called from page fault handler. */ | ||
35 | extern int kmmio_handler(struct pt_regs *regs, unsigned long addr); | ||
36 | |||
37 | /* Called from ioremap.c */ | ||
38 | #ifdef CONFIG_MMIOTRACE | ||
39 | extern void mmiotrace_ioremap(resource_size_t offset, unsigned long size, | ||
40 | void __iomem *addr); | ||
41 | extern void mmiotrace_iounmap(volatile void __iomem *addr); | ||
42 | #else | ||
43 | static inline void mmiotrace_ioremap(resource_size_t offset, | ||
44 | unsigned long size, void __iomem *addr) | ||
45 | { | ||
46 | } | ||
47 | |||
48 | static inline void mmiotrace_iounmap(volatile void __iomem *addr) | ||
49 | { | ||
50 | } | ||
51 | #endif /* CONFIG_MMIOTRACE_HOOKS */ | ||
52 | |||
53 | enum mm_io_opcode { | ||
54 | MMIO_READ = 0x1, /* struct mmiotrace_rw */ | ||
55 | MMIO_WRITE = 0x2, /* struct mmiotrace_rw */ | ||
56 | MMIO_PROBE = 0x3, /* struct mmiotrace_map */ | ||
57 | MMIO_UNPROBE = 0x4, /* struct mmiotrace_map */ | ||
58 | MMIO_MARKER = 0x5, /* raw char data */ | ||
59 | MMIO_UNKNOWN_OP = 0x6, /* struct mmiotrace_rw */ | ||
60 | }; | ||
61 | |||
62 | struct mmiotrace_rw { | ||
63 | resource_size_t phys; /* PCI address of register */ | ||
64 | unsigned long value; | ||
65 | unsigned long pc; /* optional program counter */ | ||
66 | int map_id; | ||
67 | unsigned char opcode; /* one of MMIO_{READ,WRITE,UNKNOWN_OP} */ | ||
68 | unsigned char width; /* size of register access in bytes */ | ||
69 | }; | ||
70 | |||
71 | struct mmiotrace_map { | ||
72 | resource_size_t phys; /* base address in PCI space */ | ||
73 | unsigned long virt; /* base virtual address */ | ||
74 | unsigned long len; /* mapping size */ | ||
75 | int map_id; | ||
76 | unsigned char opcode; /* MMIO_PROBE or MMIO_UNPROBE */ | ||
77 | }; | ||
78 | |||
79 | /* in kernel/trace/trace_mmiotrace.c */ | ||
80 | extern void enable_mmiotrace(void); | ||
81 | extern void disable_mmiotrace(void); | ||
82 | extern void mmio_trace_rw(struct mmiotrace_rw *rw); | ||
83 | extern void mmio_trace_mapping(struct mmiotrace_map *map); | ||
84 | |||
85 | #endif /* MMIOTRACE_H */ | ||
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 f6cd60f2de63..5d1af10b90c3 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -245,6 +245,8 @@ extern asmlinkage void schedule_tail(struct task_struct *prev); | |||
245 | extern void init_idle(struct task_struct *idle, int cpu); | 245 | extern void init_idle(struct task_struct *idle, int cpu); |
246 | extern void init_idle_bootup_task(struct task_struct *idle); | 246 | extern void init_idle_bootup_task(struct task_struct *idle); |
247 | 247 | ||
248 | extern int runqueue_is_locked(void); | ||
249 | |||
248 | extern cpumask_t nohz_cpu_mask; | 250 | extern cpumask_t nohz_cpu_mask; |
249 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) | 251 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) |
250 | extern int select_nohz_load_balancer(int cpu); | 252 | extern int select_nohz_load_balancer(int cpu); |
@@ -2132,6 +2134,18 @@ static inline void arch_pick_mmap_layout(struct mm_struct *mm) | |||
2132 | } | 2134 | } |
2133 | #endif | 2135 | #endif |
2134 | 2136 | ||
2137 | #ifdef CONFIG_TRACING | ||
2138 | extern void | ||
2139 | __trace_special(void *__tr, void *__data, | ||
2140 | unsigned long arg1, unsigned long arg2, unsigned long arg3); | ||
2141 | #else | ||
2142 | static inline void | ||
2143 | __trace_special(void *__tr, void *__data, | ||
2144 | unsigned long arg1, unsigned long arg2, unsigned long arg3) | ||
2145 | { | ||
2146 | } | ||
2147 | #endif | ||
2148 | |||
2135 | extern long sched_setaffinity(pid_t pid, const cpumask_t *new_mask); | 2149 | extern long sched_setaffinity(pid_t pid, const cpumask_t *new_mask); |
2136 | extern long sched_getaffinity(pid_t pid, cpumask_t *mask); | 2150 | extern long sched_getaffinity(pid_t pid, cpumask_t *mask); |
2137 | 2151 | ||
@@ -2226,6 +2240,8 @@ static inline void mm_init_owner(struct mm_struct *mm, struct task_struct *p) | |||
2226 | } | 2240 | } |
2227 | #endif /* CONFIG_MM_OWNER */ | 2241 | #endif /* CONFIG_MM_OWNER */ |
2228 | 2242 | ||
2243 | #define TASK_STATE_TO_CHAR_STR "RSDTtZX" | ||
2244 | |||
2229 | #endif /* __KERNEL__ */ | 2245 | #endif /* __KERNEL__ */ |
2230 | 2246 | ||
2231 | #endif | 2247 | #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); |