aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/acpi.h2
-rw-r--r--include/linux/amba/serial.h1
-rw-r--r--include/linux/blktrace_api.h45
-rw-r--r--include/linux/cpumask.h15
-rw-r--r--include/linux/dma-debug.h7
-rw-r--r--include/linux/dmar.h3
-rw-r--r--include/linux/ftrace.h17
-rw-r--r--include/linux/ftrace_event.h172
-rw-r--r--include/linux/futex.h6
-rw-r--r--include/linux/init_task.h1
-rw-r--r--include/linux/interrupt.h2
-rw-r--r--include/linux/irq.h58
-rw-r--r--include/linux/kmemtrace.h25
-rw-r--r--include/linux/mm.h9
-rw-r--r--include/linux/mmiotrace.h2
-rw-r--r--include/linux/module.h8
-rw-r--r--include/linux/ptrace.h10
-rw-r--r--include/linux/rculist.h30
-rw-r--r--include/linux/rcutree.h9
-rw-r--r--include/linux/ring_buffer.h66
-rw-r--r--include/linux/sched.h53
-rw-r--r--include/linux/slab_def.h2
-rw-r--r--include/linux/slub_def.h2
-rw-r--r--include/linux/spinlock_up.h1
-rw-r--r--include/linux/swiotlb.h3
-rw-r--r--include/linux/thread_info.h3
-rw-r--r--include/linux/trace_seq.h92
-rw-r--r--include/linux/tracehook.h11
-rw-r--r--include/linux/tracepoint.h8
-rw-r--r--include/linux/wait.h2
30 files changed, 556 insertions, 109 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 88be890ee3c7..51b4b0a5ce8c 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -119,7 +119,7 @@ extern int pci_mmcfg_config_num;
119extern int sbf_port; 119extern int sbf_port;
120extern unsigned long acpi_realmode_flags; 120extern unsigned long acpi_realmode_flags;
121 121
122int acpi_register_gsi (u32 gsi, int triggering, int polarity); 122int acpi_register_gsi (struct device *dev, u32 gsi, int triggering, int polarity);
123int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); 123int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
124 124
125#ifdef CONFIG_X86_IO_APIC 125#ifdef CONFIG_X86_IO_APIC
diff --git a/include/linux/amba/serial.h b/include/linux/amba/serial.h
index 48ee32a18ac5..64a982ea5d5f 100644
--- a/include/linux/amba/serial.h
+++ b/include/linux/amba/serial.h
@@ -159,6 +159,7 @@
159#define UART01x_FR_MODEM_ANY (UART01x_FR_DCD|UART01x_FR_DSR|UART01x_FR_CTS) 159#define UART01x_FR_MODEM_ANY (UART01x_FR_DCD|UART01x_FR_DSR|UART01x_FR_CTS)
160 160
161#ifndef __ASSEMBLY__ 161#ifndef __ASSEMBLY__
162struct amba_device; /* in uncompress this is included but amba/bus.h is not */
162struct amba_pl010_data { 163struct amba_pl010_data {
163 void (*set_mctrl)(struct amba_device *dev, void __iomem *base, unsigned int mctrl); 164 void (*set_mctrl)(struct amba_device *dev, void __iomem *base, unsigned int mctrl);
164}; 165};
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index d960889e92ef..7e4350ece0f8 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -116,9 +116,9 @@ struct blk_io_trace {
116 * The remap event 116 * The remap event
117 */ 117 */
118struct blk_io_trace_remap { 118struct blk_io_trace_remap {
119 __be32 device;
120 __be32 device_from; 119 __be32 device_from;
121 __be64 sector; 120 __be32 device_to;
121 __be64 sector_from;
122}; 122};
123 123
124enum { 124enum {
@@ -165,8 +165,9 @@ struct blk_trace {
165 165
166extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); 166extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *);
167extern void blk_trace_shutdown(struct request_queue *); 167extern void blk_trace_shutdown(struct request_queue *);
168extern int do_blk_trace_setup(struct request_queue *q, 168extern int do_blk_trace_setup(struct request_queue *q, char *name,
169 char *name, dev_t dev, struct blk_user_trace_setup *buts); 169 dev_t dev, struct block_device *bdev,
170 struct blk_user_trace_setup *buts);
170extern void __trace_note_message(struct blk_trace *, const char *fmt, ...); 171extern void __trace_note_message(struct blk_trace *, const char *fmt, ...);
171 172
172/** 173/**
@@ -193,22 +194,42 @@ extern void __trace_note_message(struct blk_trace *, const char *fmt, ...);
193extern void blk_add_driver_data(struct request_queue *q, struct request *rq, 194extern void blk_add_driver_data(struct request_queue *q, struct request *rq,
194 void *data, size_t len); 195 void *data, size_t len);
195extern int blk_trace_setup(struct request_queue *q, char *name, dev_t dev, 196extern int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
197 struct block_device *bdev,
196 char __user *arg); 198 char __user *arg);
197extern int blk_trace_startstop(struct request_queue *q, int start); 199extern int blk_trace_startstop(struct request_queue *q, int start);
198extern int blk_trace_remove(struct request_queue *q); 200extern int blk_trace_remove(struct request_queue *q);
201extern int blk_trace_init_sysfs(struct device *dev);
199 202
200extern struct attribute_group blk_trace_attr_group; 203extern struct attribute_group blk_trace_attr_group;
201 204
202#else /* !CONFIG_BLK_DEV_IO_TRACE */ 205#else /* !CONFIG_BLK_DEV_IO_TRACE */
203#define blk_trace_ioctl(bdev, cmd, arg) (-ENOTTY) 206# define blk_trace_ioctl(bdev, cmd, arg) (-ENOTTY)
204#define blk_trace_shutdown(q) do { } while (0) 207# define blk_trace_shutdown(q) do { } while (0)
205#define do_blk_trace_setup(q, name, dev, buts) (-ENOTTY) 208# define do_blk_trace_setup(q, name, dev, bdev, buts) (-ENOTTY)
206#define blk_add_driver_data(q, rq, data, len) do {} while (0) 209# define blk_add_driver_data(q, rq, data, len) do {} while (0)
207#define blk_trace_setup(q, name, dev, arg) (-ENOTTY) 210# define blk_trace_setup(q, name, dev, bdev, arg) (-ENOTTY)
208#define blk_trace_startstop(q, start) (-ENOTTY) 211# define blk_trace_startstop(q, start) (-ENOTTY)
209#define blk_trace_remove(q) (-ENOTTY) 212# define blk_trace_remove(q) (-ENOTTY)
210#define blk_add_trace_msg(q, fmt, ...) do { } while (0) 213# define blk_add_trace_msg(q, fmt, ...) do { } while (0)
214static inline int blk_trace_init_sysfs(struct device *dev)
215{
216 return 0;
217}
211 218
212#endif /* CONFIG_BLK_DEV_IO_TRACE */ 219#endif /* CONFIG_BLK_DEV_IO_TRACE */
220
221#if defined(CONFIG_EVENT_TRACING) && defined(CONFIG_BLOCK)
222
223static inline int blk_cmd_buf_len(struct request *rq)
224{
225 return blk_pc_request(rq) ? rq->cmd_len * 3 : 1;
226}
227
228extern void blk_dump_cmd(char *buf, struct request *rq);
229extern void blk_fill_rwbs(char *rwbs, u32 rw, int bytes);
230extern void blk_fill_rwbs_rq(char *rwbs, struct request *rq);
231
232#endif /* CONFIG_EVENT_TRACING && CONFIG_BLOCK */
233
213#endif /* __KERNEL__ */ 234#endif /* __KERNEL__ */
214#endif 235#endif
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index 9f315382610b..c5ac87ca7bc6 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -1022,6 +1022,8 @@ typedef struct cpumask *cpumask_var_t;
1022 1022
1023bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, int node); 1023bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, int node);
1024bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags); 1024bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags);
1025bool zalloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, int node);
1026bool zalloc_cpumask_var(cpumask_var_t *mask, gfp_t flags);
1025void alloc_bootmem_cpumask_var(cpumask_var_t *mask); 1027void alloc_bootmem_cpumask_var(cpumask_var_t *mask);
1026void free_cpumask_var(cpumask_var_t mask); 1028void free_cpumask_var(cpumask_var_t mask);
1027void free_bootmem_cpumask_var(cpumask_var_t mask); 1029void free_bootmem_cpumask_var(cpumask_var_t mask);
@@ -1040,6 +1042,19 @@ static inline bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags,
1040 return true; 1042 return true;
1041} 1043}
1042 1044
1045static inline bool zalloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
1046{
1047 cpumask_clear(*mask);
1048 return true;
1049}
1050
1051static inline bool zalloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags,
1052 int node)
1053{
1054 cpumask_clear(*mask);
1055 return true;
1056}
1057
1043static inline void alloc_bootmem_cpumask_var(cpumask_var_t *mask) 1058static inline void alloc_bootmem_cpumask_var(cpumask_var_t *mask)
1044{ 1059{
1045} 1060}
diff --git a/include/linux/dma-debug.h b/include/linux/dma-debug.h
index 28d53cb7b5a2..171ad8aedc83 100644
--- a/include/linux/dma-debug.h
+++ b/include/linux/dma-debug.h
@@ -32,6 +32,8 @@ extern void dma_debug_add_bus(struct bus_type *bus);
32 32
33extern void dma_debug_init(u32 num_entries); 33extern void dma_debug_init(u32 num_entries);
34 34
35extern int dma_debug_resize_entries(u32 num_entries);
36
35extern void debug_dma_map_page(struct device *dev, struct page *page, 37extern void debug_dma_map_page(struct device *dev, struct page *page,
36 size_t offset, size_t size, 38 size_t offset, size_t size,
37 int direction, dma_addr_t dma_addr, 39 int direction, dma_addr_t dma_addr,
@@ -91,6 +93,11 @@ static inline void dma_debug_init(u32 num_entries)
91{ 93{
92} 94}
93 95
96static inline int dma_debug_resize_entries(u32 num_entries)
97{
98 return 0;
99}
100
94static inline void debug_dma_map_page(struct device *dev, struct page *page, 101static inline void debug_dma_map_page(struct device *dev, struct page *page,
95 size_t offset, size_t size, 102 size_t offset, size_t size,
96 int direction, dma_addr_t dma_addr, 103 int direction, dma_addr_t dma_addr,
diff --git a/include/linux/dmar.h b/include/linux/dmar.h
index e397dc342cda..10ff5c498824 100644
--- a/include/linux/dmar.h
+++ b/include/linux/dmar.h
@@ -108,6 +108,7 @@ struct irte {
108}; 108};
109#ifdef CONFIG_INTR_REMAP 109#ifdef CONFIG_INTR_REMAP
110extern int intr_remapping_enabled; 110extern int intr_remapping_enabled;
111extern int intr_remapping_supported(void);
111extern int enable_intr_remapping(int); 112extern int enable_intr_remapping(int);
112extern void disable_intr_remapping(void); 113extern void disable_intr_remapping(void);
113extern int reenable_intr_remapping(int); 114extern int reenable_intr_remapping(int);
@@ -157,6 +158,8 @@ static inline struct intel_iommu *map_ioapic_to_ir(int apic)
157} 158}
158#define irq_remapped(irq) (0) 159#define irq_remapped(irq) (0)
159#define enable_intr_remapping(mode) (-1) 160#define enable_intr_remapping(mode) (-1)
161#define disable_intr_remapping() (0)
162#define reenable_intr_remapping(mode) (0)
160#define intr_remapping_enabled (0) 163#define intr_remapping_enabled (0)
161#endif 164#endif
162 165
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 8a0c2f221e6b..39b95c56587e 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -233,8 +233,6 @@ extern int ftrace_arch_read_dyn_info(char *buf, int size);
233 233
234extern int skip_trace(unsigned long ip); 234extern int skip_trace(unsigned long ip);
235 235
236extern void ftrace_release(void *start, unsigned long size);
237
238extern void ftrace_disable_daemon(void); 236extern void ftrace_disable_daemon(void);
239extern void ftrace_enable_daemon(void); 237extern void ftrace_enable_daemon(void);
240#else 238#else
@@ -325,13 +323,8 @@ static inline void __ftrace_enabled_restore(int enabled)
325 323
326#ifdef CONFIG_FTRACE_MCOUNT_RECORD 324#ifdef CONFIG_FTRACE_MCOUNT_RECORD
327extern void ftrace_init(void); 325extern void ftrace_init(void);
328extern void ftrace_init_module(struct module *mod,
329 unsigned long *start, unsigned long *end);
330#else 326#else
331static inline void ftrace_init(void) { } 327static inline void ftrace_init(void) { }
332static inline void
333ftrace_init_module(struct module *mod,
334 unsigned long *start, unsigned long *end) { }
335#endif 328#endif
336 329
337/* 330/*
@@ -368,6 +361,7 @@ struct ftrace_ret_stack {
368 unsigned long ret; 361 unsigned long ret;
369 unsigned long func; 362 unsigned long func;
370 unsigned long long calltime; 363 unsigned long long calltime;
364 unsigned long long subtime;
371}; 365};
372 366
373/* 367/*
@@ -379,8 +373,6 @@ extern void return_to_handler(void);
379 373
380extern int 374extern int
381ftrace_push_return_trace(unsigned long ret, unsigned long func, int *depth); 375ftrace_push_return_trace(unsigned long ret, unsigned long func, int *depth);
382extern void
383ftrace_pop_return_trace(struct ftrace_graph_ret *trace, unsigned long *ret);
384 376
385/* 377/*
386 * Sometimes we don't want to trace a function with the function 378 * Sometimes we don't want to trace a function with the function
@@ -496,8 +488,15 @@ static inline int test_tsk_trace_graph(struct task_struct *tsk)
496 488
497extern int ftrace_dump_on_oops; 489extern int ftrace_dump_on_oops;
498 490
491#ifdef CONFIG_PREEMPT
492#define INIT_TRACE_RECURSION .trace_recursion = 0,
493#endif
494
499#endif /* CONFIG_TRACING */ 495#endif /* CONFIG_TRACING */
500 496
497#ifndef INIT_TRACE_RECURSION
498#define INIT_TRACE_RECURSION
499#endif
501 500
502#ifdef CONFIG_HW_BRANCH_TRACER 501#ifdef CONFIG_HW_BRANCH_TRACER
503 502
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
new file mode 100644
index 000000000000..5c093ffc655b
--- /dev/null
+++ b/include/linux/ftrace_event.h
@@ -0,0 +1,172 @@
1#ifndef _LINUX_FTRACE_EVENT_H
2#define _LINUX_FTRACE_EVENT_H
3
4#include <linux/trace_seq.h>
5#include <linux/ring_buffer.h>
6#include <linux/percpu.h>
7
8struct trace_array;
9struct tracer;
10struct dentry;
11
12DECLARE_PER_CPU(struct trace_seq, ftrace_event_seq);
13
14struct trace_print_flags {
15 unsigned long mask;
16 const char *name;
17};
18
19const char *ftrace_print_flags_seq(struct trace_seq *p, const char *delim,
20 unsigned long flags,
21 const struct trace_print_flags *flag_array);
22
23const char *ftrace_print_symbols_seq(struct trace_seq *p, unsigned long val,
24 const struct trace_print_flags *symbol_array);
25
26/*
27 * The trace entry - the most basic unit of tracing. This is what
28 * is printed in the end as a single line in the trace output, such as:
29 *
30 * bash-15816 [01] 235.197585: idle_cpu <- irq_enter
31 */
32struct trace_entry {
33 unsigned short type;
34 unsigned char flags;
35 unsigned char preempt_count;
36 int pid;
37 int tgid;
38};
39
40#define FTRACE_MAX_EVENT \
41 ((1 << (sizeof(((struct trace_entry *)0)->type) * 8)) - 1)
42
43/*
44 * Trace iterator - used by printout routines who present trace
45 * results to users and which routines might sleep, etc:
46 */
47struct trace_iterator {
48 struct trace_array *tr;
49 struct tracer *trace;
50 void *private;
51 int cpu_file;
52 struct mutex mutex;
53 struct ring_buffer_iter *buffer_iter[NR_CPUS];
54 unsigned long iter_flags;
55
56 /* The below is zeroed out in pipe_read */
57 struct trace_seq seq;
58 struct trace_entry *ent;
59 int cpu;
60 u64 ts;
61
62 loff_t pos;
63 long idx;
64
65 cpumask_var_t started;
66};
67
68
69typedef enum print_line_t (*trace_print_func)(struct trace_iterator *iter,
70 int flags);
71struct trace_event {
72 struct hlist_node node;
73 struct list_head list;
74 int type;
75 trace_print_func trace;
76 trace_print_func raw;
77 trace_print_func hex;
78 trace_print_func binary;
79};
80
81extern int register_ftrace_event(struct trace_event *event);
82extern int unregister_ftrace_event(struct trace_event *event);
83
84/* Return values for print_line callback */
85enum print_line_t {
86 TRACE_TYPE_PARTIAL_LINE = 0, /* Retry after flushing the seq */
87 TRACE_TYPE_HANDLED = 1,
88 TRACE_TYPE_UNHANDLED = 2, /* Relay to other output functions */
89 TRACE_TYPE_NO_CONSUME = 3 /* Handled but ask to not consume */
90};
91
92
93struct ring_buffer_event *
94trace_current_buffer_lock_reserve(int type, unsigned long len,
95 unsigned long flags, int pc);
96void trace_current_buffer_unlock_commit(struct ring_buffer_event *event,
97 unsigned long flags, int pc);
98void trace_nowake_buffer_unlock_commit(struct ring_buffer_event *event,
99 unsigned long flags, int pc);
100void trace_current_buffer_discard_commit(struct ring_buffer_event *event);
101
102void tracing_record_cmdline(struct task_struct *tsk);
103
104struct ftrace_event_call {
105 struct list_head list;
106 char *name;
107 char *system;
108 struct dentry *dir;
109 struct trace_event *event;
110 int enabled;
111 int (*regfunc)(void);
112 void (*unregfunc)(void);
113 int id;
114 int (*raw_init)(void);
115 int (*show_format)(struct trace_seq *s);
116 int (*define_fields)(void);
117 struct list_head fields;
118 int filter_active;
119 void *filter;
120 void *mod;
121
122#ifdef CONFIG_EVENT_PROFILE
123 atomic_t profile_count;
124 int (*profile_enable)(struct ftrace_event_call *);
125 void (*profile_disable)(struct ftrace_event_call *);
126#endif
127};
128
129#define MAX_FILTER_PRED 32
130#define MAX_FILTER_STR_VAL 128
131
132extern int init_preds(struct ftrace_event_call *call);
133extern void destroy_preds(struct ftrace_event_call *call);
134extern int filter_match_preds(struct ftrace_event_call *call, void *rec);
135extern int filter_current_check_discard(struct ftrace_event_call *call,
136 void *rec,
137 struct ring_buffer_event *event);
138
139extern int trace_define_field(struct ftrace_event_call *call, char *type,
140 char *name, int offset, int size, int is_signed);
141
142#define is_signed_type(type) (((type)(-1)) < 0)
143
144int trace_set_clr_event(const char *system, const char *event, int set);
145
146/*
147 * The double __builtin_constant_p is because gcc will give us an error
148 * if we try to allocate the static variable to fmt if it is not a
149 * constant. Even with the outer if statement optimizing out.
150 */
151#define event_trace_printk(ip, fmt, args...) \
152do { \
153 __trace_printk_check_format(fmt, ##args); \
154 tracing_record_cmdline(current); \
155 if (__builtin_constant_p(fmt)) { \
156 static const char *trace_printk_fmt \
157 __attribute__((section("__trace_printk_fmt"))) = \
158 __builtin_constant_p(fmt) ? fmt : NULL; \
159 \
160 __trace_bprintk(ip, trace_printk_fmt, ##args); \
161 } else \
162 __trace_printk(ip, fmt, ##args); \
163} while (0)
164
165#define __common_field(type, item, is_signed) \
166 ret = trace_define_field(event_call, #type, "common_" #item, \
167 offsetof(typeof(field.ent), item), \
168 sizeof(field.ent.item), is_signed); \
169 if (ret) \
170 return ret;
171
172#endif /* _LINUX_FTRACE_EVENT_H */
diff --git a/include/linux/futex.h b/include/linux/futex.h
index 3bf5bb5a34f9..34956c8fdebf 100644
--- a/include/linux/futex.h
+++ b/include/linux/futex.h
@@ -23,6 +23,8 @@ union ktime;
23#define FUTEX_TRYLOCK_PI 8 23#define FUTEX_TRYLOCK_PI 8
24#define FUTEX_WAIT_BITSET 9 24#define FUTEX_WAIT_BITSET 9
25#define FUTEX_WAKE_BITSET 10 25#define FUTEX_WAKE_BITSET 10
26#define FUTEX_WAIT_REQUEUE_PI 11
27#define FUTEX_CMP_REQUEUE_PI 12
26 28
27#define FUTEX_PRIVATE_FLAG 128 29#define FUTEX_PRIVATE_FLAG 128
28#define FUTEX_CLOCK_REALTIME 256 30#define FUTEX_CLOCK_REALTIME 256
@@ -38,6 +40,10 @@ union ktime;
38#define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG) 40#define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG)
39#define FUTEX_WAIT_BITSET_PRIVATE (FUTEX_WAIT_BITS | FUTEX_PRIVATE_FLAG) 41#define FUTEX_WAIT_BITSET_PRIVATE (FUTEX_WAIT_BITS | FUTEX_PRIVATE_FLAG)
40#define FUTEX_WAKE_BITSET_PRIVATE (FUTEX_WAKE_BITS | FUTEX_PRIVATE_FLAG) 42#define FUTEX_WAKE_BITSET_PRIVATE (FUTEX_WAKE_BITS | FUTEX_PRIVATE_FLAG)
43#define FUTEX_WAIT_REQUEUE_PI_PRIVATE (FUTEX_WAIT_REQUEUE_PI | \
44 FUTEX_PRIVATE_FLAG)
45#define FUTEX_CMP_REQUEUE_PI_PRIVATE (FUTEX_CMP_REQUEUE_PI | \
46 FUTEX_PRIVATE_FLAG)
41 47
42/* 48/*
43 * Support for robust futexes: the kernel cleans up held futexes at 49 * Support for robust futexes: the kernel cleans up held futexes at
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 353c0ac7723a..b6b7cf23c2a0 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -184,6 +184,7 @@ extern struct cred init_cred;
184 INIT_TRACE_IRQFLAGS \ 184 INIT_TRACE_IRQFLAGS \
185 INIT_LOCKDEP \ 185 INIT_LOCKDEP \
186 INIT_FTRACE_GRAPH \ 186 INIT_FTRACE_GRAPH \
187 INIT_TRACE_RECURSION \
187} 188}
188 189
189 190
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 91bb76f44f14..ff374ceface0 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -566,6 +566,6 @@ struct irq_desc;
566extern int early_irq_init(void); 566extern int early_irq_init(void);
567extern int arch_probe_nr_irqs(void); 567extern int arch_probe_nr_irqs(void);
568extern int arch_early_irq_init(void); 568extern int arch_early_irq_init(void);
569extern int arch_init_chip_data(struct irq_desc *desc, int cpu); 569extern int arch_init_chip_data(struct irq_desc *desc, int node);
570 570
571#endif 571#endif
diff --git a/include/linux/irq.h b/include/linux/irq.h
index b7cbeed972e4..eedbb8e5e0cc 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -117,7 +117,7 @@ struct irq_chip {
117 void (*eoi)(unsigned int irq); 117 void (*eoi)(unsigned int irq);
118 118
119 void (*end)(unsigned int irq); 119 void (*end)(unsigned int irq);
120 void (*set_affinity)(unsigned int irq, 120 int (*set_affinity)(unsigned int irq,
121 const struct cpumask *dest); 121 const struct cpumask *dest);
122 int (*retrigger)(unsigned int irq); 122 int (*retrigger)(unsigned int irq);
123 int (*set_type)(unsigned int irq, unsigned int flow_type); 123 int (*set_type)(unsigned int irq, unsigned int flow_type);
@@ -187,7 +187,7 @@ struct irq_desc {
187 spinlock_t lock; 187 spinlock_t lock;
188#ifdef CONFIG_SMP 188#ifdef CONFIG_SMP
189 cpumask_var_t affinity; 189 cpumask_var_t affinity;
190 unsigned int cpu; 190 unsigned int node;
191#ifdef CONFIG_GENERIC_PENDING_IRQ 191#ifdef CONFIG_GENERIC_PENDING_IRQ
192 cpumask_var_t pending_mask; 192 cpumask_var_t pending_mask;
193#endif 193#endif
@@ -201,26 +201,23 @@ struct irq_desc {
201} ____cacheline_internodealigned_in_smp; 201} ____cacheline_internodealigned_in_smp;
202 202
203extern void arch_init_copy_chip_data(struct irq_desc *old_desc, 203extern void arch_init_copy_chip_data(struct irq_desc *old_desc,
204 struct irq_desc *desc, int cpu); 204 struct irq_desc *desc, int node);
205extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc); 205extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc);
206 206
207#ifndef CONFIG_SPARSE_IRQ 207#ifndef CONFIG_SPARSE_IRQ
208extern struct irq_desc irq_desc[NR_IRQS]; 208extern struct irq_desc irq_desc[NR_IRQS];
209#else /* CONFIG_SPARSE_IRQ */ 209#endif
210extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu);
211#endif /* CONFIG_SPARSE_IRQ */
212
213extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu);
214 210
215static inline struct irq_desc * 211#ifdef CONFIG_NUMA_IRQ_DESC
216irq_remap_to_desc(unsigned int irq, struct irq_desc *desc) 212extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int node);
217{
218#ifdef CONFIG_NUMA_MIGRATE_IRQ_DESC
219 return irq_to_desc(irq);
220#else 213#else
214static inline struct irq_desc *move_irq_desc(struct irq_desc *desc, int node)
215{
221 return desc; 216 return desc;
222#endif
223} 217}
218#endif
219
220extern struct irq_desc *irq_to_desc_alloc_node(unsigned int irq, int node);
224 221
225/* 222/*
226 * Migration helpers for obsolete names, they will go away: 223 * Migration helpers for obsolete names, they will go away:
@@ -386,7 +383,7 @@ extern void set_irq_noprobe(unsigned int irq);
386extern void set_irq_probe(unsigned int irq); 383extern void set_irq_probe(unsigned int irq);
387 384
388/* Handle dynamic irq creation and destruction */ 385/* Handle dynamic irq creation and destruction */
389extern unsigned int create_irq_nr(unsigned int irq_want); 386extern unsigned int create_irq_nr(unsigned int irq_want, int node);
390extern int create_irq(void); 387extern int create_irq(void);
391extern void destroy_irq(unsigned int irq); 388extern void destroy_irq(unsigned int irq);
392 389
@@ -424,47 +421,48 @@ extern int set_irq_msi(unsigned int irq, struct msi_desc *entry);
424 421
425#ifdef CONFIG_SMP 422#ifdef CONFIG_SMP
426/** 423/**
427 * init_alloc_desc_masks - allocate cpumasks for irq_desc 424 * alloc_desc_masks - allocate cpumasks for irq_desc
428 * @desc: pointer to irq_desc struct 425 * @desc: pointer to irq_desc struct
429 * @cpu: cpu which will be handling the cpumasks 426 * @cpu: cpu which will be handling the cpumasks
430 * @boot: true if need bootmem 427 * @boot: true if need bootmem
431 * 428 *
432 * Allocates affinity and pending_mask cpumask if required. 429 * Allocates affinity and pending_mask cpumask if required.
433 * Returns true if successful (or not required). 430 * Returns true if successful (or not required).
434 * Side effect: affinity has all bits set, pending_mask has all bits clear.
435 */ 431 */
436static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu, 432static inline bool alloc_desc_masks(struct irq_desc *desc, int node,
437 bool boot) 433 bool boot)
438{ 434{
439 int node; 435#ifdef CONFIG_CPUMASK_OFFSTACK
440
441 if (boot) { 436 if (boot) {
442 alloc_bootmem_cpumask_var(&desc->affinity); 437 alloc_bootmem_cpumask_var(&desc->affinity);
443 cpumask_setall(desc->affinity);
444 438
445#ifdef CONFIG_GENERIC_PENDING_IRQ 439#ifdef CONFIG_GENERIC_PENDING_IRQ
446 alloc_bootmem_cpumask_var(&desc->pending_mask); 440 alloc_bootmem_cpumask_var(&desc->pending_mask);
447 cpumask_clear(desc->pending_mask);
448#endif 441#endif
449 return true; 442 return true;
450 } 443 }
451 444
452 node = cpu_to_node(cpu);
453
454 if (!alloc_cpumask_var_node(&desc->affinity, GFP_ATOMIC, node)) 445 if (!alloc_cpumask_var_node(&desc->affinity, GFP_ATOMIC, node))
455 return false; 446 return false;
456 cpumask_setall(desc->affinity);
457 447
458#ifdef CONFIG_GENERIC_PENDING_IRQ 448#ifdef CONFIG_GENERIC_PENDING_IRQ
459 if (!alloc_cpumask_var_node(&desc->pending_mask, GFP_ATOMIC, node)) { 449 if (!alloc_cpumask_var_node(&desc->pending_mask, GFP_ATOMIC, node)) {
460 free_cpumask_var(desc->affinity); 450 free_cpumask_var(desc->affinity);
461 return false; 451 return false;
462 } 452 }
463 cpumask_clear(desc->pending_mask); 453#endif
464#endif 454#endif
465 return true; 455 return true;
466} 456}
467 457
458static inline void init_desc_masks(struct irq_desc *desc)
459{
460 cpumask_setall(desc->affinity);
461#ifdef CONFIG_GENERIC_PENDING_IRQ
462 cpumask_clear(desc->pending_mask);
463#endif
464}
465
468/** 466/**
469 * init_copy_desc_masks - copy cpumasks for irq_desc 467 * init_copy_desc_masks - copy cpumasks for irq_desc
470 * @old_desc: pointer to old irq_desc struct 468 * @old_desc: pointer to old irq_desc struct
@@ -478,7 +476,7 @@ static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu,
478static inline void init_copy_desc_masks(struct irq_desc *old_desc, 476static inline void init_copy_desc_masks(struct irq_desc *old_desc,
479 struct irq_desc *new_desc) 477 struct irq_desc *new_desc)
480{ 478{
481#ifdef CONFIG_CPUMASKS_OFFSTACK 479#ifdef CONFIG_CPUMASK_OFFSTACK
482 cpumask_copy(new_desc->affinity, old_desc->affinity); 480 cpumask_copy(new_desc->affinity, old_desc->affinity);
483 481
484#ifdef CONFIG_GENERIC_PENDING_IRQ 482#ifdef CONFIG_GENERIC_PENDING_IRQ
@@ -499,12 +497,16 @@ static inline void free_desc_masks(struct irq_desc *old_desc,
499 497
500#else /* !CONFIG_SMP */ 498#else /* !CONFIG_SMP */
501 499
502static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu, 500static inline bool alloc_desc_masks(struct irq_desc *desc, int node,
503 bool boot) 501 bool boot)
504{ 502{
505 return true; 503 return true;
506} 504}
507 505
506static inline void init_desc_masks(struct irq_desc *desc)
507{
508}
509
508static inline void init_copy_desc_masks(struct irq_desc *old_desc, 510static inline void init_copy_desc_masks(struct irq_desc *old_desc,
509 struct irq_desc *new_desc) 511 struct irq_desc *new_desc)
510{ 512{
diff --git a/include/linux/kmemtrace.h b/include/linux/kmemtrace.h
new file mode 100644
index 000000000000..b616d3930c3b
--- /dev/null
+++ b/include/linux/kmemtrace.h
@@ -0,0 +1,25 @@
1/*
2 * Copyright (C) 2008 Eduard - Gabriel Munteanu
3 *
4 * This file is released under GPL version 2.
5 */
6
7#ifndef _LINUX_KMEMTRACE_H
8#define _LINUX_KMEMTRACE_H
9
10#ifdef __KERNEL__
11
12#include <trace/events/kmem.h>
13
14#ifdef CONFIG_KMEMTRACE
15extern void kmemtrace_init(void);
16#else
17static inline void kmemtrace_init(void)
18{
19}
20#endif
21
22#endif /* __KERNEL__ */
23
24#endif /* _LINUX_KMEMTRACE_H */
25
diff --git a/include/linux/mm.h b/include/linux/mm.h
index bff1f0d475c7..9772d6cbfc82 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -19,6 +19,7 @@ struct anon_vma;
19struct file_ra_state; 19struct file_ra_state;
20struct user_struct; 20struct user_struct;
21struct writeback_control; 21struct writeback_control;
22struct rlimit;
22 23
23#ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ 24#ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */
24extern unsigned long max_mapnr; 25extern unsigned long max_mapnr;
@@ -1031,8 +1032,6 @@ extern void add_active_range(unsigned int nid, unsigned long start_pfn,
1031 unsigned long end_pfn); 1032 unsigned long end_pfn);
1032extern void remove_active_range(unsigned int nid, unsigned long start_pfn, 1033extern void remove_active_range(unsigned int nid, unsigned long start_pfn,
1033 unsigned long end_pfn); 1034 unsigned long end_pfn);
1034extern void push_node_boundaries(unsigned int nid, unsigned long start_pfn,
1035 unsigned long end_pfn);
1036extern void remove_all_active_ranges(void); 1035extern void remove_all_active_ranges(void);
1037extern unsigned long absent_pages_in_range(unsigned long start_pfn, 1036extern unsigned long absent_pages_in_range(unsigned long start_pfn,
1038 unsigned long end_pfn); 1037 unsigned long end_pfn);
@@ -1319,8 +1318,8 @@ int vmemmap_populate_basepages(struct page *start_page,
1319int vmemmap_populate(struct page *start_page, unsigned long pages, int node); 1318int vmemmap_populate(struct page *start_page, unsigned long pages, int node);
1320void vmemmap_populate_print_last(void); 1319void vmemmap_populate_print_last(void);
1321 1320
1322extern void *alloc_locked_buffer(size_t size); 1321extern int account_locked_memory(struct mm_struct *mm, struct rlimit *rlim,
1323extern void free_locked_buffer(void *buffer, size_t size); 1322 size_t size);
1324extern void release_locked_buffer(void *buffer, size_t size); 1323extern void refund_locked_memory(struct mm_struct *mm, size_t size);
1325#endif /* __KERNEL__ */ 1324#endif /* __KERNEL__ */
1326#endif /* _LINUX_MM_H */ 1325#endif /* _LINUX_MM_H */
diff --git a/include/linux/mmiotrace.h b/include/linux/mmiotrace.h
index 3d1b7bde1283..97491f78b08c 100644
--- a/include/linux/mmiotrace.h
+++ b/include/linux/mmiotrace.h
@@ -30,6 +30,8 @@ extern unsigned int kmmio_count;
30 30
31extern int register_kmmio_probe(struct kmmio_probe *p); 31extern int register_kmmio_probe(struct kmmio_probe *p);
32extern void unregister_kmmio_probe(struct kmmio_probe *p); 32extern void unregister_kmmio_probe(struct kmmio_probe *p);
33extern int kmmio_init(void);
34extern void kmmio_cleanup(void);
33 35
34#ifdef CONFIG_MMIOTRACE 36#ifdef CONFIG_MMIOTRACE
35/* kmmio is active by some kmmio_probes? */ 37/* kmmio is active by some kmmio_probes? */
diff --git a/include/linux/module.h b/include/linux/module.h
index 627ac082e2a6..a8f2c0aa4c32 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -337,6 +337,14 @@ struct module
337 const char **trace_bprintk_fmt_start; 337 const char **trace_bprintk_fmt_start;
338 unsigned int num_trace_bprintk_fmt; 338 unsigned int num_trace_bprintk_fmt;
339#endif 339#endif
340#ifdef CONFIG_EVENT_TRACING
341 struct ftrace_event_call *trace_events;
342 unsigned int num_trace_events;
343#endif
344#ifdef CONFIG_FTRACE_MCOUNT_RECORD
345 unsigned long *ftrace_callsites;
346 unsigned int num_ftrace_callsites;
347#endif
340 348
341#ifdef CONFIG_MODULE_UNLOAD 349#ifdef CONFIG_MODULE_UNLOAD
342 /* What modules depend on me? */ 350 /* What modules depend on me? */
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 67c15653fc23..59e133d39d50 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -95,7 +95,6 @@ extern void __ptrace_link(struct task_struct *child,
95 struct task_struct *new_parent); 95 struct task_struct *new_parent);
96extern void __ptrace_unlink(struct task_struct *child); 96extern void __ptrace_unlink(struct task_struct *child);
97extern void exit_ptrace(struct task_struct *tracer); 97extern void exit_ptrace(struct task_struct *tracer);
98extern void ptrace_fork(struct task_struct *task, unsigned long clone_flags);
99#define PTRACE_MODE_READ 1 98#define PTRACE_MODE_READ 1
100#define PTRACE_MODE_ATTACH 2 99#define PTRACE_MODE_ATTACH 2
101/* Returns 0 on success, -errno on denial. */ 100/* Returns 0 on success, -errno on denial. */
@@ -327,15 +326,6 @@ static inline void user_enable_block_step(struct task_struct *task)
327#define arch_ptrace_untrace(task) do { } while (0) 326#define arch_ptrace_untrace(task) do { } while (0)
328#endif 327#endif
329 328
330#ifndef arch_ptrace_fork
331/*
332 * Do machine-specific work to initialize a new task.
333 *
334 * This is called from copy_process().
335 */
336#define arch_ptrace_fork(child, clone_flags) do { } while (0)
337#endif
338
339extern int task_current_syscall(struct task_struct *target, long *callno, 329extern int task_current_syscall(struct task_struct *target, long *callno,
340 unsigned long args[6], unsigned int maxargs, 330 unsigned long args[6], unsigned int maxargs,
341 unsigned long *sp, unsigned long *pc); 331 unsigned long *sp, unsigned long *pc);
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index e649bd3f2c97..5710f43bbc9e 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -198,6 +198,32 @@ static inline void list_splice_init_rcu(struct list_head *list,
198 at->prev = last; 198 at->prev = last;
199} 199}
200 200
201/**
202 * list_entry_rcu - get the struct for this entry
203 * @ptr: the &struct list_head pointer.
204 * @type: the type of the struct this is embedded in.
205 * @member: the name of the list_struct within the struct.
206 *
207 * This primitive may safely run concurrently with the _rcu list-mutation
208 * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock().
209 */
210#define list_entry_rcu(ptr, type, member) \
211 container_of(rcu_dereference(ptr), type, member)
212
213/**
214 * list_first_entry_rcu - get the first element from a list
215 * @ptr: the list head to take the element from.
216 * @type: the type of the struct this is embedded in.
217 * @member: the name of the list_struct within the struct.
218 *
219 * Note, that list is expected to be not empty.
220 *
221 * This primitive may safely run concurrently with the _rcu list-mutation
222 * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock().
223 */
224#define list_first_entry_rcu(ptr, type, member) \
225 list_entry_rcu((ptr)->next, type, member)
226
201#define __list_for_each_rcu(pos, head) \ 227#define __list_for_each_rcu(pos, head) \
202 for (pos = rcu_dereference((head)->next); \ 228 for (pos = rcu_dereference((head)->next); \
203 pos != (head); \ 229 pos != (head); \
@@ -214,9 +240,9 @@ static inline void list_splice_init_rcu(struct list_head *list,
214 * as long as the traversal is guarded by rcu_read_lock(). 240 * as long as the traversal is guarded by rcu_read_lock().
215 */ 241 */
216#define list_for_each_entry_rcu(pos, head, member) \ 242#define list_for_each_entry_rcu(pos, head, member) \
217 for (pos = list_entry(rcu_dereference((head)->next), typeof(*pos), member); \ 243 for (pos = list_entry_rcu((head)->next, typeof(*pos), member); \
218 prefetch(pos->member.next), &pos->member != (head); \ 244 prefetch(pos->member.next), &pos->member != (head); \
219 pos = list_entry(rcu_dereference(pos->member.next), typeof(*pos), member)) 245 pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
220 246
221 247
222/** 248/**
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index 58b2aa5312b9..5a5153806c42 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -161,8 +161,15 @@ struct rcu_data {
161 unsigned long offline_fqs; /* Kicked due to being offline. */ 161 unsigned long offline_fqs; /* Kicked due to being offline. */
162 unsigned long resched_ipi; /* Sent a resched IPI. */ 162 unsigned long resched_ipi; /* Sent a resched IPI. */
163 163
164 /* 5) For future __rcu_pending statistics. */ 164 /* 5) __rcu_pending() statistics. */
165 long n_rcu_pending; /* rcu_pending() calls since boot. */ 165 long n_rcu_pending; /* rcu_pending() calls since boot. */
166 long n_rp_qs_pending;
167 long n_rp_cb_ready;
168 long n_rp_cpu_needs_gp;
169 long n_rp_gp_completed;
170 long n_rp_gp_started;
171 long n_rp_need_fqs;
172 long n_rp_need_nothing;
166 173
167 int cpu; 174 int cpu;
168}; 175};
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h
index e1b7b2173885..8670f1575fe1 100644
--- a/include/linux/ring_buffer.h
+++ b/include/linux/ring_buffer.h
@@ -11,7 +11,7 @@ struct ring_buffer_iter;
11 * Don't refer to this struct directly, use functions below. 11 * Don't refer to this struct directly, use functions below.
12 */ 12 */
13struct ring_buffer_event { 13struct ring_buffer_event {
14 u32 type:2, len:3, time_delta:27; 14 u32 type_len:5, time_delta:27;
15 u32 array[]; 15 u32 array[];
16}; 16};
17 17
@@ -24,7 +24,8 @@ struct ring_buffer_event {
24 * size is variable depending on how much 24 * size is variable depending on how much
25 * padding is needed 25 * padding is needed
26 * If time_delta is non zero: 26 * If time_delta is non zero:
27 * everything else same as RINGBUF_TYPE_DATA 27 * array[0] holds the actual length
28 * size = 4 + length (bytes)
28 * 29 *
29 * @RINGBUF_TYPE_TIME_EXTEND: Extend the time delta 30 * @RINGBUF_TYPE_TIME_EXTEND: Extend the time delta
30 * array[0] = time delta (28 .. 59) 31 * array[0] = time delta (28 .. 59)
@@ -35,22 +36,23 @@ struct ring_buffer_event {
35 * array[1..2] = tv_sec 36 * array[1..2] = tv_sec
36 * size = 16 bytes 37 * size = 16 bytes
37 * 38 *
38 * @RINGBUF_TYPE_DATA: Data record 39 * <= @RINGBUF_TYPE_DATA_TYPE_LEN_MAX:
39 * If len is zero: 40 * Data record
41 * If type_len is zero:
40 * array[0] holds the actual length 42 * array[0] holds the actual length
41 * array[1..(length+3)/4] holds data 43 * array[1..(length+3)/4] holds data
42 * size = 4 + 4 + length (bytes) 44 * size = 4 + length (bytes)
43 * else 45 * else
44 * length = len << 2 46 * length = type_len << 2
45 * array[0..(length+3)/4-1] holds data 47 * array[0..(length+3)/4-1] holds data
46 * size = 4 + length (bytes) 48 * size = 4 + length (bytes)
47 */ 49 */
48enum ring_buffer_type { 50enum ring_buffer_type {
51 RINGBUF_TYPE_DATA_TYPE_LEN_MAX = 28,
49 RINGBUF_TYPE_PADDING, 52 RINGBUF_TYPE_PADDING,
50 RINGBUF_TYPE_TIME_EXTEND, 53 RINGBUF_TYPE_TIME_EXTEND,
51 /* FIXME: RINGBUF_TYPE_TIME_STAMP not implemented */ 54 /* FIXME: RINGBUF_TYPE_TIME_STAMP not implemented */
52 RINGBUF_TYPE_TIME_STAMP, 55 RINGBUF_TYPE_TIME_STAMP,
53 RINGBUF_TYPE_DATA,
54}; 56};
55 57
56unsigned ring_buffer_event_length(struct ring_buffer_event *event); 58unsigned ring_buffer_event_length(struct ring_buffer_event *event);
@@ -68,13 +70,54 @@ ring_buffer_event_time_delta(struct ring_buffer_event *event)
68 return event->time_delta; 70 return event->time_delta;
69} 71}
70 72
73/*
74 * ring_buffer_event_discard can discard any event in the ring buffer.
75 * it is up to the caller to protect against a reader from
76 * consuming it or a writer from wrapping and replacing it.
77 *
78 * No external protection is needed if this is called before
79 * the event is commited. But in that case it would be better to
80 * use ring_buffer_discard_commit.
81 *
82 * Note, if an event that has not been committed is discarded
83 * with ring_buffer_event_discard, it must still be committed.
84 */
71void ring_buffer_event_discard(struct ring_buffer_event *event); 85void ring_buffer_event_discard(struct ring_buffer_event *event);
72 86
73/* 87/*
88 * ring_buffer_discard_commit will remove an event that has not
89 * ben committed yet. If this is used, then ring_buffer_unlock_commit
90 * must not be called on the discarded event. This function
91 * will try to remove the event from the ring buffer completely
92 * if another event has not been written after it.
93 *
94 * Example use:
95 *
96 * if (some_condition)
97 * ring_buffer_discard_commit(buffer, event);
98 * else
99 * ring_buffer_unlock_commit(buffer, event);
100 */
101void ring_buffer_discard_commit(struct ring_buffer *buffer,
102 struct ring_buffer_event *event);
103
104/*
74 * size is in bytes for each per CPU buffer. 105 * size is in bytes for each per CPU buffer.
75 */ 106 */
76struct ring_buffer * 107struct ring_buffer *
77ring_buffer_alloc(unsigned long size, unsigned flags); 108__ring_buffer_alloc(unsigned long size, unsigned flags, struct lock_class_key *key);
109
110/*
111 * Because the ring buffer is generic, if other users of the ring buffer get
112 * traced by ftrace, it can produce lockdep warnings. We need to keep each
113 * ring buffer's lock class separate.
114 */
115#define ring_buffer_alloc(size, flags) \
116({ \
117 static struct lock_class_key __key; \
118 __ring_buffer_alloc((size), (flags), &__key); \
119})
120
78void ring_buffer_free(struct ring_buffer *buffer); 121void ring_buffer_free(struct ring_buffer *buffer);
79 122
80int ring_buffer_resize(struct ring_buffer *buffer, unsigned long size); 123int ring_buffer_resize(struct ring_buffer *buffer, unsigned long size);
@@ -122,6 +165,8 @@ unsigned long ring_buffer_entries(struct ring_buffer *buffer);
122unsigned long ring_buffer_overruns(struct ring_buffer *buffer); 165unsigned long ring_buffer_overruns(struct ring_buffer *buffer);
123unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu); 166unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu);
124unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu); 167unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu);
168unsigned long ring_buffer_commit_overrun_cpu(struct ring_buffer *buffer, int cpu);
169unsigned long ring_buffer_nmi_dropped_cpu(struct ring_buffer *buffer, int cpu);
125 170
126u64 ring_buffer_time_stamp(struct ring_buffer *buffer, int cpu); 171u64 ring_buffer_time_stamp(struct ring_buffer *buffer, int cpu);
127void ring_buffer_normalize_time_stamp(struct ring_buffer *buffer, 172void ring_buffer_normalize_time_stamp(struct ring_buffer *buffer,
@@ -137,6 +182,11 @@ void ring_buffer_free_read_page(struct ring_buffer *buffer, void *data);
137int ring_buffer_read_page(struct ring_buffer *buffer, void **data_page, 182int ring_buffer_read_page(struct ring_buffer *buffer, void **data_page,
138 size_t len, int cpu, int full); 183 size_t len, int cpu, int full);
139 184
185struct trace_seq;
186
187int ring_buffer_print_entry_header(struct trace_seq *s);
188int ring_buffer_print_page_header(struct trace_seq *s);
189
140enum ring_buffer_flags { 190enum ring_buffer_flags {
141 RB_FL_OVERWRITE = 1 << 0, 191 RB_FL_OVERWRITE = 1 << 0,
142}; 192};
diff --git a/include/linux/sched.h b/include/linux/sched.h
index bc9326dcdde1..28c774ff3cc7 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -77,6 +77,7 @@ struct sched_param {
77#include <linux/proportions.h> 77#include <linux/proportions.h>
78#include <linux/seccomp.h> 78#include <linux/seccomp.h>
79#include <linux/rcupdate.h> 79#include <linux/rcupdate.h>
80#include <linux/rculist.h>
80#include <linux/rtmutex.h> 81#include <linux/rtmutex.h>
81 82
82#include <linux/time.h> 83#include <linux/time.h>
@@ -96,8 +97,8 @@ struct exec_domain;
96struct futex_pi_state; 97struct futex_pi_state;
97struct robust_list_head; 98struct robust_list_head;
98struct bio; 99struct bio;
99struct bts_tracer;
100struct fs_struct; 100struct fs_struct;
101struct bts_context;
101struct perf_counter_context; 102struct perf_counter_context;
102 103
103/* 104/*
@@ -117,6 +118,7 @@ struct perf_counter_context;
117 * 11 bit fractions. 118 * 11 bit fractions.
118 */ 119 */
119extern unsigned long avenrun[]; /* Load averages */ 120extern unsigned long avenrun[]; /* Load averages */
121extern void get_avenrun(unsigned long *loads, unsigned long offset, int shift);
120 122
121#define FSHIFT 11 /* nr of bits of precision */ 123#define FSHIFT 11 /* nr of bits of precision */
122#define FIXED_1 (1<<FSHIFT) /* 1.0 as fixed-point */ 124#define FIXED_1 (1<<FSHIFT) /* 1.0 as fixed-point */
@@ -136,8 +138,8 @@ DECLARE_PER_CPU(unsigned long, process_counts);
136extern int nr_processes(void); 138extern int nr_processes(void);
137extern unsigned long nr_running(void); 139extern unsigned long nr_running(void);
138extern unsigned long nr_uninterruptible(void); 140extern unsigned long nr_uninterruptible(void);
139extern unsigned long nr_active(void);
140extern unsigned long nr_iowait(void); 141extern unsigned long nr_iowait(void);
142extern void calc_global_load(void);
141extern u64 cpu_nr_migrations(int cpu); 143extern u64 cpu_nr_migrations(int cpu);
142 144
143extern unsigned long get_parent_ip(unsigned long addr); 145extern unsigned long get_parent_ip(unsigned long addr);
@@ -844,7 +846,17 @@ struct sched_group {
844 */ 846 */
845 u32 reciprocal_cpu_power; 847 u32 reciprocal_cpu_power;
846 848
847 unsigned long cpumask[]; 849 /*
850 * The CPUs this group covers.
851 *
852 * NOTE: this field is variable length. (Allocated dynamically
853 * by attaching extra space to the end of the structure,
854 * depending on how many CPUs the kernel has booted up with)
855 *
856 * It is also be embedded into static data structures at build
857 * time. (See 'struct static_sched_group' in kernel/sched.c)
858 */
859 unsigned long cpumask[0];
848}; 860};
849 861
850static inline struct cpumask *sched_group_cpus(struct sched_group *sg) 862static inline struct cpumask *sched_group_cpus(struct sched_group *sg)
@@ -930,8 +942,17 @@ struct sched_domain {
930 char *name; 942 char *name;
931#endif 943#endif
932 944
933 /* span of all CPUs in this domain */ 945 /*
934 unsigned long span[]; 946 * Span of all CPUs in this domain.
947 *
948 * NOTE: this field is variable length. (Allocated dynamically
949 * by attaching extra space to the end of the structure,
950 * depending on how many CPUs the kernel has booted up with)
951 *
952 * It is also be embedded into static data structures at build
953 * time. (See 'struct static_sched_domain' in kernel/sched.c)
954 */
955 unsigned long span[0];
935}; 956};
936 957
937static inline struct cpumask *sched_domain_span(struct sched_domain *sd) 958static inline struct cpumask *sched_domain_span(struct sched_domain *sd)
@@ -1216,18 +1237,11 @@ struct task_struct {
1216 struct list_head ptraced; 1237 struct list_head ptraced;
1217 struct list_head ptrace_entry; 1238 struct list_head ptrace_entry;
1218 1239
1219#ifdef CONFIG_X86_PTRACE_BTS
1220 /* 1240 /*
1221 * This is the tracer handle for the ptrace BTS extension. 1241 * This is the tracer handle for the ptrace BTS extension.
1222 * This field actually belongs to the ptracer task. 1242 * This field actually belongs to the ptracer task.
1223 */ 1243 */
1224 struct bts_tracer *bts; 1244 struct bts_context *bts;
1225 /*
1226 * The buffer to hold the BTS data.
1227 */
1228 void *bts_buffer;
1229 size_t bts_size;
1230#endif /* CONFIG_X86_PTRACE_BTS */
1231 1245
1232 /* PID/PID hash table linkage. */ 1246 /* PID/PID hash table linkage. */
1233 struct pid_link pids[PIDTYPE_MAX]; 1247 struct pid_link pids[PIDTYPE_MAX];
@@ -1440,7 +1454,9 @@ struct task_struct {
1440#ifdef CONFIG_TRACING 1454#ifdef CONFIG_TRACING
1441 /* state flags for use by tracers */ 1455 /* state flags for use by tracers */
1442 unsigned long trace; 1456 unsigned long trace;
1443#endif 1457 /* bitmask of trace recursion */
1458 unsigned long trace_recursion;
1459#endif /* CONFIG_TRACING */
1444}; 1460};
1445 1461
1446/* Future-safe accessor for struct task_struct's cpus_allowed. */ 1462/* Future-safe accessor for struct task_struct's cpus_allowed. */
@@ -2013,8 +2029,10 @@ extern void set_task_comm(struct task_struct *tsk, char *from);
2013extern char *get_task_comm(char *to, struct task_struct *tsk); 2029extern char *get_task_comm(char *to, struct task_struct *tsk);
2014 2030
2015#ifdef CONFIG_SMP 2031#ifdef CONFIG_SMP
2032extern void wait_task_context_switch(struct task_struct *p);
2016extern unsigned long wait_task_inactive(struct task_struct *, long match_state); 2033extern unsigned long wait_task_inactive(struct task_struct *, long match_state);
2017#else 2034#else
2035static inline void wait_task_context_switch(struct task_struct *p) {}
2018static inline unsigned long wait_task_inactive(struct task_struct *p, 2036static inline unsigned long wait_task_inactive(struct task_struct *p,
2019 long match_state) 2037 long match_state)
2020{ 2038{
@@ -2022,7 +2040,8 @@ static inline unsigned long wait_task_inactive(struct task_struct *p,
2022} 2040}
2023#endif 2041#endif
2024 2042
2025#define next_task(p) list_entry(rcu_dereference((p)->tasks.next), struct task_struct, tasks) 2043#define next_task(p) \
2044 list_entry_rcu((p)->tasks.next, struct task_struct, tasks)
2026 2045
2027#define for_each_process(p) \ 2046#define for_each_process(p) \
2028 for (p = &init_task ; (p = next_task(p)) != &init_task ; ) 2047 for (p = &init_task ; (p = next_task(p)) != &init_task ; )
@@ -2061,8 +2080,8 @@ int same_thread_group(struct task_struct *p1, struct task_struct *p2)
2061 2080
2062static inline struct task_struct *next_thread(const struct task_struct *p) 2081static inline struct task_struct *next_thread(const struct task_struct *p)
2063{ 2082{
2064 return list_entry(rcu_dereference(p->thread_group.next), 2083 return list_entry_rcu(p->thread_group.next,
2065 struct task_struct, thread_group); 2084 struct task_struct, thread_group);
2066} 2085}
2067 2086
2068static inline int thread_group_empty(struct task_struct *p) 2087static inline int thread_group_empty(struct task_struct *p)
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
index 5ac9b0bcaf9a..713f841ecaa9 100644
--- a/include/linux/slab_def.h
+++ b/include/linux/slab_def.h
@@ -14,7 +14,7 @@
14#include <asm/page.h> /* kmalloc_sizes.h needs PAGE_SIZE */ 14#include <asm/page.h> /* kmalloc_sizes.h needs PAGE_SIZE */
15#include <asm/cache.h> /* kmalloc_sizes.h needs L1_CACHE_BYTES */ 15#include <asm/cache.h> /* kmalloc_sizes.h needs L1_CACHE_BYTES */
16#include <linux/compiler.h> 16#include <linux/compiler.h>
17#include <trace/kmemtrace.h> 17#include <linux/kmemtrace.h>
18 18
19/* Size description struct for general caches. */ 19/* Size description struct for general caches. */
20struct cache_sizes { 20struct cache_sizes {
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 5046f90c1171..be5d40c43bd2 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -10,7 +10,7 @@
10#include <linux/gfp.h> 10#include <linux/gfp.h>
11#include <linux/workqueue.h> 11#include <linux/workqueue.h>
12#include <linux/kobject.h> 12#include <linux/kobject.h>
13#include <trace/kmemtrace.h> 13#include <linux/kmemtrace.h>
14 14
15enum stat_item { 15enum stat_item {
16 ALLOC_FASTPATH, /* Allocation from cpu slab */ 16 ALLOC_FASTPATH, /* Allocation from cpu slab */
diff --git a/include/linux/spinlock_up.h b/include/linux/spinlock_up.h
index 938234c4a996..d4841ed8215b 100644
--- a/include/linux/spinlock_up.h
+++ b/include/linux/spinlock_up.h
@@ -60,6 +60,7 @@ static inline void __raw_spin_unlock(raw_spinlock_t *lock)
60#define __raw_spin_is_locked(lock) ((void)(lock), 0) 60#define __raw_spin_is_locked(lock) ((void)(lock), 0)
61/* for sched.c and kernel_lock.c: */ 61/* for sched.c and kernel_lock.c: */
62# define __raw_spin_lock(lock) do { (void)(lock); } while (0) 62# define __raw_spin_lock(lock) do { (void)(lock); } while (0)
63# define __raw_spin_lock_flags(lock, flags) do { (void)(lock); } while (0)
63# define __raw_spin_unlock(lock) do { (void)(lock); } while (0) 64# define __raw_spin_unlock(lock) do { (void)(lock); } while (0)
64# define __raw_spin_trylock(lock) ({ (void)(lock); 1; }) 65# define __raw_spin_trylock(lock) ({ (void)(lock); 1; })
65#endif /* DEBUG_SPINLOCK */ 66#endif /* DEBUG_SPINLOCK */
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index ac9ff54f7cb3..cb1a6631b8f4 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -29,7 +29,8 @@ extern void *swiotlb_alloc(unsigned order, unsigned long nslabs);
29 29
30extern dma_addr_t swiotlb_phys_to_bus(struct device *hwdev, 30extern dma_addr_t swiotlb_phys_to_bus(struct device *hwdev,
31 phys_addr_t address); 31 phys_addr_t address);
32extern phys_addr_t swiotlb_bus_to_phys(dma_addr_t address); 32extern phys_addr_t swiotlb_bus_to_phys(struct device *hwdev,
33 dma_addr_t address);
33 34
34extern int swiotlb_arch_range_needs_mapping(phys_addr_t paddr, size_t size); 35extern int swiotlb_arch_range_needs_mapping(phys_addr_t paddr, size_t size);
35 36
diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h
index e6b820f8b56b..a8cc4e13434c 100644
--- a/include/linux/thread_info.h
+++ b/include/linux/thread_info.h
@@ -21,13 +21,14 @@ struct restart_block {
21 struct { 21 struct {
22 unsigned long arg0, arg1, arg2, arg3; 22 unsigned long arg0, arg1, arg2, arg3;
23 }; 23 };
24 /* For futex_wait */ 24 /* For futex_wait and futex_wait_requeue_pi */
25 struct { 25 struct {
26 u32 *uaddr; 26 u32 *uaddr;
27 u32 val; 27 u32 val;
28 u32 flags; 28 u32 flags;
29 u32 bitset; 29 u32 bitset;
30 u64 time; 30 u64 time;
31 u32 *uaddr2;
31 } futex; 32 } futex;
32 /* For nanosleep */ 33 /* For nanosleep */
33 struct { 34 struct {
diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h
new file mode 100644
index 000000000000..c68bccba2074
--- /dev/null
+++ b/include/linux/trace_seq.h
@@ -0,0 +1,92 @@
1#ifndef _LINUX_TRACE_SEQ_H
2#define _LINUX_TRACE_SEQ_H
3
4#include <linux/fs.h>
5
6/*
7 * Trace sequences are used to allow a function to call several other functions
8 * to create a string of data to use (up to a max of PAGE_SIZE.
9 */
10
11struct trace_seq {
12 unsigned char buffer[PAGE_SIZE];
13 unsigned int len;
14 unsigned int readpos;
15};
16
17static inline void
18trace_seq_init(struct trace_seq *s)
19{
20 s->len = 0;
21 s->readpos = 0;
22}
23
24/*
25 * Currently only defined when tracing is enabled.
26 */
27#ifdef CONFIG_TRACING
28extern int trace_seq_printf(struct trace_seq *s, const char *fmt, ...)
29 __attribute__ ((format (printf, 2, 3)));
30extern int trace_seq_vprintf(struct trace_seq *s, const char *fmt, va_list args)
31 __attribute__ ((format (printf, 2, 0)));
32extern int
33trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary);
34extern void trace_print_seq(struct seq_file *m, struct trace_seq *s);
35extern ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf,
36 size_t cnt);
37extern int trace_seq_puts(struct trace_seq *s, const char *str);
38extern int trace_seq_putc(struct trace_seq *s, unsigned char c);
39extern int trace_seq_putmem(struct trace_seq *s, const void *mem, size_t len);
40extern int trace_seq_putmem_hex(struct trace_seq *s, const void *mem,
41 size_t len);
42extern void *trace_seq_reserve(struct trace_seq *s, size_t len);
43extern int trace_seq_path(struct trace_seq *s, struct path *path);
44
45#else /* CONFIG_TRACING */
46static inline int trace_seq_printf(struct trace_seq *s, const char *fmt, ...)
47{
48 return 0;
49}
50static inline int
51trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary)
52{
53 return 0;
54}
55
56static inline void trace_print_seq(struct seq_file *m, struct trace_seq *s)
57{
58}
59static inline ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf,
60 size_t cnt)
61{
62 return 0;
63}
64static inline int trace_seq_puts(struct trace_seq *s, const char *str)
65{
66 return 0;
67}
68static inline int trace_seq_putc(struct trace_seq *s, unsigned char c)
69{
70 return 0;
71}
72static inline int
73trace_seq_putmem(struct trace_seq *s, const void *mem, size_t len)
74{
75 return 0;
76}
77static inline int trace_seq_putmem_hex(struct trace_seq *s, const void *mem,
78 size_t len)
79{
80 return 0;
81}
82static inline void *trace_seq_reserve(struct trace_seq *s, size_t len)
83{
84 return NULL;
85}
86static inline int trace_seq_path(struct trace_seq *s, struct path *path)
87{
88 return 0;
89}
90#endif /* CONFIG_TRACING */
91
92#endif /* _LINUX_TRACE_SEQ_H */
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
index c7aa154f4bfc..eb96603d92db 100644
--- a/include/linux/tracehook.h
+++ b/include/linux/tracehook.h
@@ -259,14 +259,12 @@ static inline void tracehook_finish_clone(struct task_struct *child,
259 259
260/** 260/**
261 * tracehook_report_clone - in parent, new child is about to start running 261 * tracehook_report_clone - in parent, new child is about to start running
262 * @trace: return value from tracehook_prepare_clone()
263 * @regs: parent's user register state 262 * @regs: parent's user register state
264 * @clone_flags: flags from parent's system call 263 * @clone_flags: flags from parent's system call
265 * @pid: new child's PID in the parent's namespace 264 * @pid: new child's PID in the parent's namespace
266 * @child: new child task 265 * @child: new child task
267 * 266 *
268 * Called after a child is set up, but before it has been started 267 * Called after a child is set up, but before it has been started running.
269 * running. @trace is the value returned by tracehook_prepare_clone().
270 * This is not a good place to block, because the child has not started 268 * This is not a good place to block, because the child has not started
271 * yet. Suspend the child here if desired, and then block in 269 * yet. Suspend the child here if desired, and then block in
272 * tracehook_report_clone_complete(). This must prevent the child from 270 * tracehook_report_clone_complete(). This must prevent the child from
@@ -276,13 +274,14 @@ static inline void tracehook_finish_clone(struct task_struct *child,
276 * 274 *
277 * Called with no locks held, but the child cannot run until this returns. 275 * Called with no locks held, but the child cannot run until this returns.
278 */ 276 */
279static inline void tracehook_report_clone(int trace, struct pt_regs *regs, 277static inline void tracehook_report_clone(struct pt_regs *regs,
280 unsigned long clone_flags, 278 unsigned long clone_flags,
281 pid_t pid, struct task_struct *child) 279 pid_t pid, struct task_struct *child)
282{ 280{
283 if (unlikely(trace) || unlikely(clone_flags & CLONE_PTRACE)) { 281 if (unlikely(task_ptrace(child))) {
284 /* 282 /*
285 * The child starts up with an immediate SIGSTOP. 283 * It doesn't matter who attached/attaching to this
284 * task, the pending SIGSTOP is right in any case.
286 */ 285 */
287 sigaddset(&child->pending.signal, SIGSTOP); 286 sigaddset(&child->pending.signal, SIGSTOP);
288 set_tsk_thread_flag(child, TIF_SIGPENDING); 287 set_tsk_thread_flag(child, TIF_SIGPENDING);
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index d35a7ee7611f..14df7e635d43 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -31,6 +31,8 @@ struct tracepoint {
31 * Keep in sync with vmlinux.lds.h. 31 * Keep in sync with vmlinux.lds.h.
32 */ 32 */
33 33
34#ifndef DECLARE_TRACE
35
34#define TP_PROTO(args...) args 36#define TP_PROTO(args...) args
35#define TP_ARGS(args...) args 37#define TP_ARGS(args...) args
36 38
@@ -114,6 +116,7 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin,
114 struct tracepoint *end) 116 struct tracepoint *end)
115{ } 117{ }
116#endif /* CONFIG_TRACEPOINTS */ 118#endif /* CONFIG_TRACEPOINTS */
119#endif /* DECLARE_TRACE */
117 120
118/* 121/*
119 * Connect a probe to a tracepoint. 122 * Connect a probe to a tracepoint.
@@ -154,10 +157,8 @@ static inline void tracepoint_synchronize_unregister(void)
154} 157}
155 158
156#define PARAMS(args...) args 159#define PARAMS(args...) args
157#define TRACE_FORMAT(name, proto, args, fmt) \
158 DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
159
160 160
161#ifndef TRACE_EVENT
161/* 162/*
162 * For use with the TRACE_EVENT macro: 163 * For use with the TRACE_EVENT macro:
163 * 164 *
@@ -262,5 +263,6 @@ static inline void tracepoint_synchronize_unregister(void)
262 263
263#define TRACE_EVENT(name, proto, args, struct, assign, print) \ 264#define TRACE_EVENT(name, proto, args, struct, assign, print) \
264 DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) 265 DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
266#endif
265 267
266#endif 268#endif
diff --git a/include/linux/wait.h b/include/linux/wait.h
index bc024632f365..6788e1a4d4ca 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -132,8 +132,6 @@ static inline void __remove_wait_queue(wait_queue_head_t *head,
132 list_del(&old->task_list); 132 list_del(&old->task_list);
133} 133}
134 134
135void __wake_up_common(wait_queue_head_t *q, unsigned int mode,
136 int nr_exclusive, int sync, void *key);
137void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key); 135void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key);
138void __wake_up_locked_key(wait_queue_head_t *q, unsigned int mode, void *key); 136void __wake_up_locked_key(wait_queue_head_t *q, unsigned int mode, void *key);
139void __wake_up_sync_key(wait_queue_head_t *q, unsigned int mode, int nr, 137void __wake_up_sync_key(wait_queue_head_t *q, unsigned int mode, int nr,