aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-12-12 06:43:05 -0500
committerIngo Molnar <mingo@elte.hu>2008-12-12 06:43:05 -0500
commit81444a799550214f549caf579cf65a0ca55e70b7 (patch)
tree3288dac0740be2e1e7d1af4ee51d792a6e91edf3 /include
parenta64d31baed104be25305e9c71585d3ea4ee9a418 (diff)
parentda485e0cb16726797e99a595a399b9fc721b91bc (diff)
Merge branch 'tracing/fastboot' into cpus4096
Diffstat (limited to 'include')
-rw-r--r--include/linux/blkdev.h9
-rw-r--r--include/linux/blktrace_api.h172
-rw-r--r--include/linux/ftrace.h160
-rw-r--r--include/linux/ftrace_irq.h2
-rw-r--r--include/linux/ide.h8
-rw-r--r--include/linux/marker.h6
-rw-r--r--include/linux/netfilter/x_tables.h2
-rw-r--r--include/linux/pid.h4
-rw-r--r--include/linux/ring_buffer.h15
-rw-r--r--include/linux/sched.h21
-rw-r--r--include/linux/security.h12
-rw-r--r--include/linux/tty.h2
-rw-r--r--include/net/af_unix.h1
-rw-r--r--include/net/request_sock.h1
-rw-r--r--include/net/timewait_sock.h1
-rw-r--r--include/scsi/scsi_transport_fc.h2
-rw-r--r--include/trace/block.h76
-rw-r--r--include/trace/boot.h8
18 files changed, 294 insertions, 208 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index a135256b272c..6dcd30d806cd 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -786,6 +786,8 @@ static inline void blk_run_address_space(struct address_space *mapping)
786 blk_run_backing_dev(mapping->backing_dev_info, NULL); 786 blk_run_backing_dev(mapping->backing_dev_info, NULL);
787} 787}
788 788
789extern void blkdev_dequeue_request(struct request *req);
790
789/* 791/*
790 * blk_end_request() and friends. 792 * blk_end_request() and friends.
791 * __blk_end_request() and end_request() must be called with 793 * __blk_end_request() and end_request() must be called with
@@ -820,11 +822,6 @@ extern void blk_update_request(struct request *rq, int error,
820extern unsigned int blk_rq_bytes(struct request *rq); 822extern unsigned int blk_rq_bytes(struct request *rq);
821extern unsigned int blk_rq_cur_bytes(struct request *rq); 823extern unsigned int blk_rq_cur_bytes(struct request *rq);
822 824
823static inline void blkdev_dequeue_request(struct request *req)
824{
825 elv_dequeue_request(req->q, req);
826}
827
828/* 825/*
829 * Access functions for manipulating queue properties 826 * Access functions for manipulating queue properties
830 */ 827 */
@@ -921,6 +918,8 @@ extern void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter);
921 918
922#define MAX_SEGMENT_SIZE 65536 919#define MAX_SEGMENT_SIZE 65536
923 920
921#define BLK_SEG_BOUNDARY_MASK 0xFFFFFFFFUL
922
924#define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist) 923#define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist)
925 924
926static inline int queue_hardsect_size(struct request_queue *q) 925static inline int queue_hardsect_size(struct request_queue *q)
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index bdf505d33e77..1dba3493d520 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -160,7 +160,6 @@ struct blk_trace {
160 160
161extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); 161extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *);
162extern void blk_trace_shutdown(struct request_queue *); 162extern void blk_trace_shutdown(struct request_queue *);
163extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *);
164extern int do_blk_trace_setup(struct request_queue *q, 163extern int do_blk_trace_setup(struct request_queue *q,
165 char *name, dev_t dev, struct blk_user_trace_setup *buts); 164 char *name, dev_t dev, struct blk_user_trace_setup *buts);
166extern void __trace_note_message(struct blk_trace *, const char *fmt, ...); 165extern void __trace_note_message(struct blk_trace *, const char *fmt, ...);
@@ -186,168 +185,8 @@ extern void __trace_note_message(struct blk_trace *, const char *fmt, ...);
186 } while (0) 185 } while (0)
187#define BLK_TN_MAX_MSG 128 186#define BLK_TN_MAX_MSG 128
188 187
189/** 188extern void blk_add_driver_data(struct request_queue *q, struct request *rq,
190 * blk_add_trace_rq - Add a trace for a request oriented action 189 void *data, size_t len);
191 * @q: queue the io is for
192 * @rq: the source request
193 * @what: the action
194 *
195 * Description:
196 * Records an action against a request. Will log the bio offset + size.
197 *
198 **/
199static inline void blk_add_trace_rq(struct request_queue *q, struct request *rq,
200 u32 what)
201{
202 struct blk_trace *bt = q->blk_trace;
203 int rw = rq->cmd_flags & 0x03;
204
205 if (likely(!bt))
206 return;
207
208 if (blk_discard_rq(rq))
209 rw |= (1 << BIO_RW_DISCARD);
210
211 if (blk_pc_request(rq)) {
212 what |= BLK_TC_ACT(BLK_TC_PC);
213 __blk_add_trace(bt, 0, rq->data_len, rw, what, rq->errors, sizeof(rq->cmd), rq->cmd);
214 } else {
215 what |= BLK_TC_ACT(BLK_TC_FS);
216 __blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9, rw, what, rq->errors, 0, NULL);
217 }
218}
219
220/**
221 * blk_add_trace_bio - Add a trace for a bio oriented action
222 * @q: queue the io is for
223 * @bio: the source bio
224 * @what: the action
225 *
226 * Description:
227 * Records an action against a bio. Will log the bio offset + size.
228 *
229 **/
230static inline void blk_add_trace_bio(struct request_queue *q, struct bio *bio,
231 u32 what)
232{
233 struct blk_trace *bt = q->blk_trace;
234
235 if (likely(!bt))
236 return;
237
238 __blk_add_trace(bt, bio->bi_sector, bio->bi_size, bio->bi_rw, what, !bio_flagged(bio, BIO_UPTODATE), 0, NULL);
239}
240
241/**
242 * blk_add_trace_generic - Add a trace for a generic action
243 * @q: queue the io is for
244 * @bio: the source bio
245 * @rw: the data direction
246 * @what: the action
247 *
248 * Description:
249 * Records a simple trace
250 *
251 **/
252static inline void blk_add_trace_generic(struct request_queue *q,
253 struct bio *bio, int rw, u32 what)
254{
255 struct blk_trace *bt = q->blk_trace;
256
257 if (likely(!bt))
258 return;
259
260 if (bio)
261 blk_add_trace_bio(q, bio, what);
262 else
263 __blk_add_trace(bt, 0, 0, rw, what, 0, 0, NULL);
264}
265
266/**
267 * blk_add_trace_pdu_int - Add a trace for a bio with an integer payload
268 * @q: queue the io is for
269 * @what: the action
270 * @bio: the source bio
271 * @pdu: the integer payload
272 *
273 * Description:
274 * Adds a trace with some integer payload. This might be an unplug
275 * option given as the action, with the depth at unplug time given
276 * as the payload
277 *
278 **/
279static inline void blk_add_trace_pdu_int(struct request_queue *q, u32 what,
280 struct bio *bio, unsigned int pdu)
281{
282 struct blk_trace *bt = q->blk_trace;
283 __be64 rpdu = cpu_to_be64(pdu);
284
285 if (likely(!bt))
286 return;
287
288 if (bio)
289 __blk_add_trace(bt, bio->bi_sector, bio->bi_size, bio->bi_rw, what, !bio_flagged(bio, BIO_UPTODATE), sizeof(rpdu), &rpdu);
290 else
291 __blk_add_trace(bt, 0, 0, 0, what, 0, sizeof(rpdu), &rpdu);
292}
293
294/**
295 * blk_add_trace_remap - Add a trace for a remap operation
296 * @q: queue the io is for
297 * @bio: the source bio
298 * @dev: target device
299 * @from: source sector
300 * @to: target sector
301 *
302 * Description:
303 * Device mapper or raid target sometimes need to split a bio because
304 * it spans a stripe (or similar). Add a trace for that action.
305 *
306 **/
307static inline void blk_add_trace_remap(struct request_queue *q, struct bio *bio,
308 dev_t dev, sector_t from, sector_t to)
309{
310 struct blk_trace *bt = q->blk_trace;
311 struct blk_io_trace_remap r;
312
313 if (likely(!bt))
314 return;
315
316 r.device = cpu_to_be32(dev);
317 r.device_from = cpu_to_be32(bio->bi_bdev->bd_dev);
318 r.sector = cpu_to_be64(to);
319
320 __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r);
321}
322
323/**
324 * blk_add_driver_data - Add binary message with driver-specific data
325 * @q: queue the io is for
326 * @rq: io request
327 * @data: driver-specific data
328 * @len: length of driver-specific data
329 *
330 * Description:
331 * Some drivers might want to write driver-specific data per request.
332 *
333 **/
334static inline void blk_add_driver_data(struct request_queue *q,
335 struct request *rq,
336 void *data, size_t len)
337{
338 struct blk_trace *bt = q->blk_trace;
339
340 if (likely(!bt))
341 return;
342
343 if (blk_pc_request(rq))
344 __blk_add_trace(bt, 0, rq->data_len, 0, BLK_TA_DRV_DATA,
345 rq->errors, len, data);
346 else
347 __blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9,
348 0, BLK_TA_DRV_DATA, rq->errors, len, data);
349}
350
351extern int blk_trace_setup(struct request_queue *q, char *name, dev_t dev, 190extern int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
352 char __user *arg); 191 char __user *arg);
353extern int blk_trace_startstop(struct request_queue *q, int start); 192extern int blk_trace_startstop(struct request_queue *q, int start);
@@ -356,13 +195,8 @@ extern int blk_trace_remove(struct request_queue *q);
356#else /* !CONFIG_BLK_DEV_IO_TRACE */ 195#else /* !CONFIG_BLK_DEV_IO_TRACE */
357#define blk_trace_ioctl(bdev, cmd, arg) (-ENOTTY) 196#define blk_trace_ioctl(bdev, cmd, arg) (-ENOTTY)
358#define blk_trace_shutdown(q) do { } while (0) 197#define blk_trace_shutdown(q) do { } while (0)
359#define blk_add_trace_rq(q, rq, what) do { } while (0)
360#define blk_add_trace_bio(q, rq, what) do { } while (0)
361#define blk_add_trace_generic(q, rq, rw, what) do { } while (0)
362#define blk_add_trace_pdu_int(q, what, bio, pdu) do { } while (0)
363#define blk_add_trace_remap(q, bio, dev, f, t) do {} while (0)
364#define blk_add_driver_data(q, rq, data, len) do {} while (0)
365#define do_blk_trace_setup(q, name, dev, buts) (-ENOTTY) 198#define do_blk_trace_setup(q, name, dev, buts) (-ENOTTY)
199#define blk_add_driver_data(q, rq, data, len) do {} while (0)
366#define blk_trace_setup(q, name, dev, arg) (-ENOTTY) 200#define blk_trace_setup(q, name, dev, arg) (-ENOTTY)
367#define blk_trace_startstop(q, start) (-ENOTTY) 201#define blk_trace_startstop(q, start) (-ENOTTY)
368#define blk_trace_remove(q) (-ENOTTY) 202#define blk_trace_remove(q) (-ENOTTY)
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 7854d87b97b2..11cac81eed08 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -7,6 +7,8 @@
7#include <linux/init.h> 7#include <linux/init.h>
8#include <linux/types.h> 8#include <linux/types.h>
9#include <linux/kallsyms.h> 9#include <linux/kallsyms.h>
10#include <linux/bitops.h>
11#include <linux/sched.h>
10 12
11#ifdef CONFIG_FUNCTION_TRACER 13#ifdef CONFIG_FUNCTION_TRACER
12 14
@@ -115,8 +117,13 @@ extern int ftrace_update_ftrace_func(ftrace_func_t func);
115extern void ftrace_caller(void); 117extern void ftrace_caller(void);
116extern void ftrace_call(void); 118extern void ftrace_call(void);
117extern void mcount_call(void); 119extern void mcount_call(void);
118#ifdef CONFIG_FUNCTION_RET_TRACER 120#ifdef CONFIG_FUNCTION_GRAPH_TRACER
119extern void ftrace_return_caller(void); 121extern void ftrace_graph_caller(void);
122extern int ftrace_enable_ftrace_graph_caller(void);
123extern int ftrace_disable_ftrace_graph_caller(void);
124#else
125static inline int ftrace_enable_ftrace_graph_caller(void) { return 0; }
126static inline int ftrace_disable_ftrace_graph_caller(void) { return 0; }
120#endif 127#endif
121 128
122/** 129/**
@@ -311,35 +318,158 @@ ftrace_init_module(struct module *mod,
311 unsigned long *start, unsigned long *end) { } 318 unsigned long *start, unsigned long *end) { }
312#endif 319#endif
313 320
321enum {
322 POWER_NONE = 0,
323 POWER_CSTATE = 1,
324 POWER_PSTATE = 2,
325};
326
327struct power_trace {
328#ifdef CONFIG_POWER_TRACER
329 ktime_t stamp;
330 ktime_t end;
331 int type;
332 int state;
333#endif
334};
335
336#ifdef CONFIG_POWER_TRACER
337extern void trace_power_start(struct power_trace *it, unsigned int type,
338 unsigned int state);
339extern void trace_power_mark(struct power_trace *it, unsigned int type,
340 unsigned int state);
341extern void trace_power_end(struct power_trace *it);
342#else
343static inline void trace_power_start(struct power_trace *it, unsigned int type,
344 unsigned int state) { }
345static inline void trace_power_mark(struct power_trace *it, unsigned int type,
346 unsigned int state) { }
347static inline void trace_power_end(struct power_trace *it) { }
348#endif
349
350
351/*
352 * Structure that defines an entry function trace.
353 */
354struct ftrace_graph_ent {
355 unsigned long func; /* Current function */
356 int depth;
357};
314 358
315/* 359/*
316 * Structure that defines a return function trace. 360 * Structure that defines a return function trace.
317 */ 361 */
318struct ftrace_retfunc { 362struct ftrace_graph_ret {
319 unsigned long ret; /* Return address */
320 unsigned long func; /* Current function */ 363 unsigned long func; /* Current function */
321 unsigned long long calltime; 364 unsigned long long calltime;
322 unsigned long long rettime; 365 unsigned long long rettime;
323 /* Number of functions that overran the depth limit for current task */ 366 /* Number of functions that overran the depth limit for current task */
324 unsigned long overrun; 367 unsigned long overrun;
368 int depth;
325}; 369};
326 370
327#ifdef CONFIG_FUNCTION_RET_TRACER 371#ifdef CONFIG_FUNCTION_GRAPH_TRACER
372
373/*
374 * Sometimes we don't want to trace a function with the function
375 * graph tracer but we want them to keep traced by the usual function
376 * tracer if the function graph tracer is not configured.
377 */
378#define __notrace_funcgraph notrace
379
328#define FTRACE_RETFUNC_DEPTH 50 380#define FTRACE_RETFUNC_DEPTH 50
329#define FTRACE_RETSTACK_ALLOC_SIZE 32 381#define FTRACE_RETSTACK_ALLOC_SIZE 32
330/* Type of a callback handler of tracing return function */ 382/* Type of the callback handlers for tracing function graph*/
331typedef void (*trace_function_return_t)(struct ftrace_retfunc *); 383typedef void (*trace_func_graph_ret_t)(struct ftrace_graph_ret *); /* return */
384typedef int (*trace_func_graph_ent_t)(struct ftrace_graph_ent *); /* entry */
385
386extern int register_ftrace_graph(trace_func_graph_ret_t retfunc,
387 trace_func_graph_ent_t entryfunc);
388
389extern void ftrace_graph_stop(void);
390
391/* The current handlers in use */
392extern trace_func_graph_ret_t ftrace_graph_return;
393extern trace_func_graph_ent_t ftrace_graph_entry;
394
395extern void unregister_ftrace_graph(void);
396
397extern void ftrace_graph_init_task(struct task_struct *t);
398extern void ftrace_graph_exit_task(struct task_struct *t);
332 399
333extern int register_ftrace_return(trace_function_return_t func); 400static inline int task_curr_ret_stack(struct task_struct *t)
334/* The current handler in use */ 401{
335extern trace_function_return_t ftrace_function_return; 402 return t->curr_ret_stack;
336extern void unregister_ftrace_return(void); 403}
404
405static inline void pause_graph_tracing(void)
406{
407 atomic_inc(&current->tracing_graph_pause);
408}
337 409
338extern void ftrace_retfunc_init_task(struct task_struct *t); 410static inline void unpause_graph_tracing(void)
339extern void ftrace_retfunc_exit_task(struct task_struct *t); 411{
412 atomic_dec(&current->tracing_graph_pause);
413}
340#else 414#else
341static inline void ftrace_retfunc_init_task(struct task_struct *t) { } 415
342static inline void ftrace_retfunc_exit_task(struct task_struct *t) { } 416#define __notrace_funcgraph
417
418static inline void ftrace_graph_init_task(struct task_struct *t) { }
419static inline void ftrace_graph_exit_task(struct task_struct *t) { }
420
421static inline int task_curr_ret_stack(struct task_struct *tsk)
422{
423 return -1;
424}
425
426static inline void pause_graph_tracing(void) { }
427static inline void unpause_graph_tracing(void) { }
343#endif 428#endif
344 429
430#ifdef CONFIG_TRACING
431#include <linux/sched.h>
432
433/* flags for current->trace */
434enum {
435 TSK_TRACE_FL_TRACE_BIT = 0,
436 TSK_TRACE_FL_GRAPH_BIT = 1,
437};
438enum {
439 TSK_TRACE_FL_TRACE = 1 << TSK_TRACE_FL_TRACE_BIT,
440 TSK_TRACE_FL_GRAPH = 1 << TSK_TRACE_FL_GRAPH_BIT,
441};
442
443static inline void set_tsk_trace_trace(struct task_struct *tsk)
444{
445 set_bit(TSK_TRACE_FL_TRACE_BIT, &tsk->trace);
446}
447
448static inline void clear_tsk_trace_trace(struct task_struct *tsk)
449{
450 clear_bit(TSK_TRACE_FL_TRACE_BIT, &tsk->trace);
451}
452
453static inline int test_tsk_trace_trace(struct task_struct *tsk)
454{
455 return tsk->trace & TSK_TRACE_FL_TRACE;
456}
457
458static inline void set_tsk_trace_graph(struct task_struct *tsk)
459{
460 set_bit(TSK_TRACE_FL_GRAPH_BIT, &tsk->trace);
461}
462
463static inline void clear_tsk_trace_graph(struct task_struct *tsk)
464{
465 clear_bit(TSK_TRACE_FL_GRAPH_BIT, &tsk->trace);
466}
467
468static inline int test_tsk_trace_graph(struct task_struct *tsk)
469{
470 return tsk->trace & TSK_TRACE_FL_GRAPH;
471}
472
473#endif /* CONFIG_TRACING */
474
345#endif /* _LINUX_FTRACE_H */ 475#endif /* _LINUX_FTRACE_H */
diff --git a/include/linux/ftrace_irq.h b/include/linux/ftrace_irq.h
index 0b4df55d7a74..366a054d0b05 100644
--- a/include/linux/ftrace_irq.h
+++ b/include/linux/ftrace_irq.h
@@ -2,7 +2,7 @@
2#define _LINUX_FTRACE_IRQ_H 2#define _LINUX_FTRACE_IRQ_H
3 3
4 4
5#if defined(CONFIG_DYNAMIC_FTRACE) || defined(CONFIG_FUNCTION_RET_TRACER) 5#if defined(CONFIG_DYNAMIC_FTRACE) || defined(CONFIG_FUNCTION_GRAPH_TRACER)
6extern void ftrace_nmi_enter(void); 6extern void ftrace_nmi_enter(void);
7extern void ftrace_nmi_exit(void); 7extern void ftrace_nmi_exit(void);
8#else 8#else
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 54525be4b5f8..010fb26a1579 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1296,6 +1296,13 @@ extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *o
1296#define ide_pci_register_driver(d) pci_register_driver(d) 1296#define ide_pci_register_driver(d) pci_register_driver(d)
1297#endif 1297#endif
1298 1298
1299static inline int ide_pci_is_in_compatibility_mode(struct pci_dev *dev)
1300{
1301 if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE && (dev->class & 5) != 5)
1302 return 1;
1303 return 0;
1304}
1305
1299void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, 1306void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int,
1300 hw_regs_t *, hw_regs_t **); 1307 hw_regs_t *, hw_regs_t **);
1301void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); 1308void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *);
@@ -1375,6 +1382,7 @@ enum {
1375 IDE_HFLAG_IO_32BIT = (1 << 24), 1382 IDE_HFLAG_IO_32BIT = (1 << 24),
1376 /* unmask IRQs */ 1383 /* unmask IRQs */
1377 IDE_HFLAG_UNMASK_IRQS = (1 << 25), 1384 IDE_HFLAG_UNMASK_IRQS = (1 << 25),
1385 IDE_HFLAG_BROKEN_ALTSTATUS = (1 << 26),
1378 /* serialize ports if DMA is possible (for sl82c105) */ 1386 /* serialize ports if DMA is possible (for sl82c105) */
1379 IDE_HFLAG_SERIALIZE_DMA = (1 << 27), 1387 IDE_HFLAG_SERIALIZE_DMA = (1 << 27),
1380 /* force host out of "simplex" mode */ 1388 /* force host out of "simplex" mode */
diff --git a/include/linux/marker.h b/include/linux/marker.h
index 34c14bc957f5..b85e74ca782f 100644
--- a/include/linux/marker.h
+++ b/include/linux/marker.h
@@ -211,8 +211,10 @@ extern void *marker_get_private_data(const char *name, marker_probe_func *probe,
211 211
212/* 212/*
213 * marker_synchronize_unregister must be called between the last marker probe 213 * marker_synchronize_unregister must be called between the last marker probe
214 * unregistration and the end of module exit to make sure there is no caller 214 * unregistration and the first one of
215 * executing a probe when it is freed. 215 * - the end of module exit function
216 * - the free of any resource used by the probes
217 * to ensure the code and data are valid for any possibly running probes.
216 */ 218 */
217#define marker_synchronize_unregister() synchronize_sched() 219#define marker_synchronize_unregister() synchronize_sched()
218 220
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index be41b609c88f..e52ce475d19f 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -251,7 +251,7 @@ struct xt_target_param {
251 */ 251 */
252struct xt_tgchk_param { 252struct xt_tgchk_param {
253 const char *table; 253 const char *table;
254 void *entryinfo; 254 const void *entryinfo;
255 const struct xt_target *target; 255 const struct xt_target *target;
256 void *targinfo; 256 void *targinfo;
257 unsigned int hook_mask; 257 unsigned int hook_mask;
diff --git a/include/linux/pid.h b/include/linux/pid.h
index d7e98ff8021e..bb206c56d1f0 100644
--- a/include/linux/pid.h
+++ b/include/linux/pid.h
@@ -147,9 +147,9 @@ pid_t pid_vnr(struct pid *pid);
147#define do_each_pid_task(pid, type, task) \ 147#define do_each_pid_task(pid, type, task) \
148 do { \ 148 do { \
149 struct hlist_node *pos___; \ 149 struct hlist_node *pos___; \
150 if (pid != NULL) \ 150 if ((pid) != NULL) \
151 hlist_for_each_entry_rcu((task), pos___, \ 151 hlist_for_each_entry_rcu((task), pos___, \
152 &pid->tasks[type], pids[type].node) { 152 &(pid)->tasks[type], pids[type].node) {
153 153
154 /* 154 /*
155 * Both old and new leaders may be attached to 155 * Both old and new leaders may be attached to
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h
index 3bb87a753fa3..d363467c8f13 100644
--- a/include/linux/ring_buffer.h
+++ b/include/linux/ring_buffer.h
@@ -28,17 +28,19 @@ struct ring_buffer_event {
28 * size = 8 bytes 28 * size = 8 bytes
29 * 29 *
30 * @RINGBUF_TYPE_TIME_STAMP: Sync time stamp with external clock 30 * @RINGBUF_TYPE_TIME_STAMP: Sync time stamp with external clock
31 * array[0] = tv_nsec 31 * array[0] = tv_nsec
32 * array[1] = tv_sec 32 * array[1..2] = tv_sec
33 * size = 16 bytes 33 * size = 16 bytes
34 * 34 *
35 * @RINGBUF_TYPE_DATA: Data record 35 * @RINGBUF_TYPE_DATA: Data record
36 * If len is zero: 36 * If len is zero:
37 * array[0] holds the actual length 37 * array[0] holds the actual length
38 * array[1..(length+3)/4-1] holds data 38 * array[1..(length+3)/4] holds data
39 * size = 4 + 4 + length (bytes)
39 * else 40 * else
40 * length = len << 2 41 * length = len << 2
41 * array[0..(length+3)/4] holds data 42 * array[0..(length+3)/4-1] holds data
43 * size = 4 + length (bytes)
42 */ 44 */
43enum ring_buffer_type { 45enum ring_buffer_type {
44 RINGBUF_TYPE_PADDING, 46 RINGBUF_TYPE_PADDING,
@@ -124,6 +126,11 @@ void tracing_on(void);
124void tracing_off(void); 126void tracing_off(void);
125void tracing_off_permanent(void); 127void tracing_off_permanent(void);
126 128
129void *ring_buffer_alloc_read_page(struct ring_buffer *buffer);
130void ring_buffer_free_read_page(struct ring_buffer *buffer, void *data);
131int ring_buffer_read_page(struct ring_buffer *buffer,
132 void **data_page, int cpu, int full);
133
127enum ring_buffer_flags { 134enum ring_buffer_flags {
128 RB_FL_OVERWRITE = 1 << 0, 135 RB_FL_OVERWRITE = 1 << 0,
129}; 136};
diff --git a/include/linux/sched.h b/include/linux/sched.h
index bf953932e676..423830b6e6e9 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -96,6 +96,7 @@ struct exec_domain;
96struct futex_pi_state; 96struct futex_pi_state;
97struct robust_list_head; 97struct robust_list_head;
98struct bio; 98struct bio;
99struct bts_tracer;
99 100
100/* 101/*
101 * List of flags we want to share for kernel threads, 102 * List of flags we want to share for kernel threads,
@@ -1176,6 +1177,18 @@ struct task_struct {
1176 struct list_head ptraced; 1177 struct list_head ptraced;
1177 struct list_head ptrace_entry; 1178 struct list_head ptrace_entry;
1178 1179
1180#ifdef CONFIG_X86_PTRACE_BTS
1181 /*
1182 * This is the tracer handle for the ptrace BTS extension.
1183 * This field actually belongs to the ptracer task.
1184 */
1185 struct bts_tracer *bts;
1186 /*
1187 * The buffer to hold the BTS data.
1188 */
1189 void *bts_buffer;
1190#endif /* CONFIG_X86_PTRACE_BTS */
1191
1179 /* PID/PID hash table linkage. */ 1192 /* PID/PID hash table linkage. */
1180 struct pid_link pids[PIDTYPE_MAX]; 1193 struct pid_link pids[PIDTYPE_MAX];
1181 struct list_head thread_group; 1194 struct list_head thread_group;
@@ -1367,7 +1380,7 @@ struct task_struct {
1367 unsigned long default_timer_slack_ns; 1380 unsigned long default_timer_slack_ns;
1368 1381
1369 struct list_head *scm_work_list; 1382 struct list_head *scm_work_list;
1370#ifdef CONFIG_FUNCTION_RET_TRACER 1383#ifdef CONFIG_FUNCTION_GRAPH_TRACER
1371 /* Index of current stored adress in ret_stack */ 1384 /* Index of current stored adress in ret_stack */
1372 int curr_ret_stack; 1385 int curr_ret_stack;
1373 /* Stack of return addresses for return function tracing */ 1386 /* Stack of return addresses for return function tracing */
@@ -1377,6 +1390,12 @@ struct task_struct {
1377 * because of depth overrun. 1390 * because of depth overrun.
1378 */ 1391 */
1379 atomic_t trace_overrun; 1392 atomic_t trace_overrun;
1393 /* Pause for the tracing */
1394 atomic_t tracing_graph_pause;
1395#endif
1396#ifdef CONFIG_TRACING
1397 /* state flags for use by tracers */
1398 unsigned long trace;
1380#endif 1399#endif
1381}; 1400};
1382 1401
diff --git a/include/linux/security.h b/include/linux/security.h
index c13f1cec9abb..e3d4ecda2673 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1818,17 +1818,21 @@ static inline int security_settime(struct timespec *ts, struct timezone *tz)
1818 1818
1819static inline int security_vm_enough_memory(long pages) 1819static inline int security_vm_enough_memory(long pages)
1820{ 1820{
1821 WARN_ON(current->mm == NULL);
1821 return cap_vm_enough_memory(current->mm, pages); 1822 return cap_vm_enough_memory(current->mm, pages);
1822} 1823}
1823 1824
1824static inline int security_vm_enough_memory_kern(long pages) 1825static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages)
1825{ 1826{
1826 return cap_vm_enough_memory(current->mm, pages); 1827 WARN_ON(mm == NULL);
1828 return cap_vm_enough_memory(mm, pages);
1827} 1829}
1828 1830
1829static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages) 1831static inline int security_vm_enough_memory_kern(long pages)
1830{ 1832{
1831 return cap_vm_enough_memory(mm, pages); 1833 /* If current->mm is a kernel thread then we will pass NULL,
1834 for this specific case that is fine */
1835 return cap_vm_enough_memory(current->mm, pages);
1832} 1836}
1833 1837
1834static inline int security_bprm_alloc(struct linux_binprm *bprm) 1838static inline int security_bprm_alloc(struct linux_binprm *bprm)
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 3b8121d4e36f..eaec37c9d83d 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -325,7 +325,7 @@ extern struct class *tty_class;
325 * go away 325 * go away
326 */ 326 */
327 327
328extern inline struct tty_struct *tty_kref_get(struct tty_struct *tty) 328static inline struct tty_struct *tty_kref_get(struct tty_struct *tty)
329{ 329{
330 if (tty) 330 if (tty)
331 kref_get(&tty->kref); 331 kref_get(&tty->kref);
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index c29ff1da8a18..1614d78c60ed 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -9,6 +9,7 @@
9extern void unix_inflight(struct file *fp); 9extern void unix_inflight(struct file *fp);
10extern void unix_notinflight(struct file *fp); 10extern void unix_notinflight(struct file *fp);
11extern void unix_gc(void); 11extern void unix_gc(void);
12extern void wait_for_unix_gc(void);
12 13
13#define UNIX_HASH_SIZE 256 14#define UNIX_HASH_SIZE 256
14 15
diff --git a/include/net/request_sock.h b/include/net/request_sock.h
index cac811e51f6d..c7190846e128 100644
--- a/include/net/request_sock.h
+++ b/include/net/request_sock.h
@@ -31,6 +31,7 @@ struct request_sock_ops {
31 int family; 31 int family;
32 int obj_size; 32 int obj_size;
33 struct kmem_cache *slab; 33 struct kmem_cache *slab;
34 char *slab_name;
34 int (*rtx_syn_ack)(struct sock *sk, 35 int (*rtx_syn_ack)(struct sock *sk,
35 struct request_sock *req); 36 struct request_sock *req);
36 void (*send_ack)(struct sock *sk, struct sk_buff *skb, 37 void (*send_ack)(struct sock *sk, struct sk_buff *skb,
diff --git a/include/net/timewait_sock.h b/include/net/timewait_sock.h
index 1e1ee3253fd8..97c3b14da55d 100644
--- a/include/net/timewait_sock.h
+++ b/include/net/timewait_sock.h
@@ -16,6 +16,7 @@
16 16
17struct timewait_sock_ops { 17struct timewait_sock_ops {
18 struct kmem_cache *twsk_slab; 18 struct kmem_cache *twsk_slab;
19 char *twsk_slab_name;
19 unsigned int twsk_obj_size; 20 unsigned int twsk_obj_size;
20 int (*twsk_unique)(struct sock *sk, 21 int (*twsk_unique)(struct sock *sk,
21 struct sock *sktw, void *twp); 22 struct sock *sktw, void *twp);
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
index 49d8913c4f86..6e04e6fe79c7 100644
--- a/include/scsi/scsi_transport_fc.h
+++ b/include/scsi/scsi_transport_fc.h
@@ -357,7 +357,7 @@ struct fc_rport { /* aka fc_starget_attrs */
357/* bit field values for struct fc_rport "flags" field: */ 357/* bit field values for struct fc_rport "flags" field: */
358#define FC_RPORT_DEVLOSS_PENDING 0x01 358#define FC_RPORT_DEVLOSS_PENDING 0x01
359#define FC_RPORT_SCAN_PENDING 0x02 359#define FC_RPORT_SCAN_PENDING 0x02
360#define FC_RPORT_FAST_FAIL_TIMEDOUT 0x03 360#define FC_RPORT_FAST_FAIL_TIMEDOUT 0x04
361 361
362#define dev_to_rport(d) \ 362#define dev_to_rport(d) \
363 container_of(d, struct fc_rport, dev) 363 container_of(d, struct fc_rport, dev)
diff --git a/include/trace/block.h b/include/trace/block.h
new file mode 100644
index 000000000000..25c6a1fd5b77
--- /dev/null
+++ b/include/trace/block.h
@@ -0,0 +1,76 @@
1#ifndef _TRACE_BLOCK_H
2#define _TRACE_BLOCK_H
3
4#include <linux/blkdev.h>
5#include <linux/tracepoint.h>
6
7DECLARE_TRACE(block_rq_abort,
8 TPPROTO(struct request_queue *q, struct request *rq),
9 TPARGS(q, rq));
10
11DECLARE_TRACE(block_rq_insert,
12 TPPROTO(struct request_queue *q, struct request *rq),
13 TPARGS(q, rq));
14
15DECLARE_TRACE(block_rq_issue,
16 TPPROTO(struct request_queue *q, struct request *rq),
17 TPARGS(q, rq));
18
19DECLARE_TRACE(block_rq_requeue,
20 TPPROTO(struct request_queue *q, struct request *rq),
21 TPARGS(q, rq));
22
23DECLARE_TRACE(block_rq_complete,
24 TPPROTO(struct request_queue *q, struct request *rq),
25 TPARGS(q, rq));
26
27DECLARE_TRACE(block_bio_bounce,
28 TPPROTO(struct request_queue *q, struct bio *bio),
29 TPARGS(q, bio));
30
31DECLARE_TRACE(block_bio_complete,
32 TPPROTO(struct request_queue *q, struct bio *bio),
33 TPARGS(q, bio));
34
35DECLARE_TRACE(block_bio_backmerge,
36 TPPROTO(struct request_queue *q, struct bio *bio),
37 TPARGS(q, bio));
38
39DECLARE_TRACE(block_bio_frontmerge,
40 TPPROTO(struct request_queue *q, struct bio *bio),
41 TPARGS(q, bio));
42
43DECLARE_TRACE(block_bio_queue,
44 TPPROTO(struct request_queue *q, struct bio *bio),
45 TPARGS(q, bio));
46
47DECLARE_TRACE(block_getrq,
48 TPPROTO(struct request_queue *q, struct bio *bio, int rw),
49 TPARGS(q, bio, rw));
50
51DECLARE_TRACE(block_sleeprq,
52 TPPROTO(struct request_queue *q, struct bio *bio, int rw),
53 TPARGS(q, bio, rw));
54
55DECLARE_TRACE(block_plug,
56 TPPROTO(struct request_queue *q),
57 TPARGS(q));
58
59DECLARE_TRACE(block_unplug_timer,
60 TPPROTO(struct request_queue *q),
61 TPARGS(q));
62
63DECLARE_TRACE(block_unplug_io,
64 TPPROTO(struct request_queue *q),
65 TPARGS(q));
66
67DECLARE_TRACE(block_split,
68 TPPROTO(struct request_queue *q, struct bio *bio, unsigned int pdu),
69 TPARGS(q, bio, pdu));
70
71DECLARE_TRACE(block_remap,
72 TPPROTO(struct request_queue *q, struct bio *bio, dev_t dev,
73 sector_t from, sector_t to),
74 TPARGS(q, bio, dev, from, to));
75
76#endif
diff --git a/include/trace/boot.h b/include/trace/boot.h
index 6b54537eab02..088ea089e31d 100644
--- a/include/trace/boot.h
+++ b/include/trace/boot.h
@@ -1,6 +1,10 @@
1#ifndef _LINUX_TRACE_BOOT_H 1#ifndef _LINUX_TRACE_BOOT_H
2#define _LINUX_TRACE_BOOT_H 2#define _LINUX_TRACE_BOOT_H
3 3
4#include <linux/module.h>
5#include <linux/kallsyms.h>
6#include <linux/init.h>
7
4/* 8/*
5 * Structure which defines the trace of an initcall 9 * Structure which defines the trace of an initcall
6 * while it is called. 10 * while it is called.
@@ -9,7 +13,7 @@
9 */ 13 */
10struct boot_trace_call { 14struct boot_trace_call {
11 pid_t caller; 15 pid_t caller;
12 char func[KSYM_NAME_LEN]; 16 char func[KSYM_SYMBOL_LEN];
13}; 17};
14 18
15/* 19/*
@@ -17,7 +21,7 @@ struct boot_trace_call {
17 * while it returns. 21 * while it returns.
18 */ 22 */
19struct boot_trace_ret { 23struct boot_trace_ret {
20 char func[KSYM_NAME_LEN]; 24 char func[KSYM_SYMBOL_LEN];
21 int result; 25 int result;
22 unsigned long long duration; /* nsecs */ 26 unsigned long long duration; /* nsecs */
23}; 27};