aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-05-17 22:26:53 -0400
committerSteven Rostedt <rostedt@goodmis.org>2010-05-18 00:35:23 -0400
commitf0218b3e9974f06014b61be8987159f4a20e011e (patch)
tree29a593c4d71ab18cb0c450a34e79bf6bea66877e /include
parent1eaa4787a774c4896518c81f24e8bccaa2244924 (diff)
parent9d192e118a094087494997ea1c8a2faf39af38c5 (diff)
Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip into trace/tip/tracing/core-6
Conflicts: include/trace/ftrace.h kernel/trace/trace_kprobe.c Acked-by: Masami Hiramatsu <mhiramat@redhat.com> Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/ftrace.h12
-rw-r--r--include/linux/hw_breakpoint.h25
-rw-r--r--include/linux/i2c.h2
-rw-r--r--include/linux/mm.h4
-rw-r--r--include/linux/perf_event.h83
-rw-r--r--include/linux/ptrace.h12
-rw-r--r--include/linux/sched.h9
-rw-r--r--include/linux/usb.h18
-rw-r--r--include/net/sctp/structs.h1
-rw-r--r--include/net/sock.h2
-rw-r--r--include/trace/events/lock.h55
-rw-r--r--include/trace/ftrace.h13
12 files changed, 142 insertions, 94 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index e0ae83bbd9cc..41e46330d9be 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -519,18 +519,6 @@ extern enum ftrace_dump_mode ftrace_dump_on_oops;
519#define INIT_TRACE_RECURSION 519#define INIT_TRACE_RECURSION
520#endif 520#endif
521 521
522#ifdef CONFIG_HW_BRANCH_TRACER
523
524void trace_hw_branch(u64 from, u64 to);
525void trace_hw_branch_oops(void);
526
527#else /* CONFIG_HW_BRANCH_TRACER */
528
529static inline void trace_hw_branch(u64 from, u64 to) {}
530static inline void trace_hw_branch_oops(void) {}
531
532#endif /* CONFIG_HW_BRANCH_TRACER */
533
534#ifdef CONFIG_FTRACE_SYSCALLS 522#ifdef CONFIG_FTRACE_SYSCALLS
535 523
536unsigned long arch_syscall_addr(int nr); 524unsigned long arch_syscall_addr(int nr);
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h
index c70d27af03f9..a2d6ea49ec56 100644
--- a/include/linux/hw_breakpoint.h
+++ b/include/linux/hw_breakpoint.h
@@ -9,9 +9,22 @@ enum {
9}; 9};
10 10
11enum { 11enum {
12 HW_BREAKPOINT_R = 1, 12 HW_BREAKPOINT_EMPTY = 0,
13 HW_BREAKPOINT_W = 2, 13 HW_BREAKPOINT_R = 1,
14 HW_BREAKPOINT_X = 4, 14 HW_BREAKPOINT_W = 2,
15 HW_BREAKPOINT_RW = HW_BREAKPOINT_R | HW_BREAKPOINT_W,
16 HW_BREAKPOINT_X = 4,
17 HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X,
18};
19
20enum bp_type_idx {
21 TYPE_INST = 0,
22#ifdef CONFIG_HAVE_MIXED_BREAKPOINTS_REGS
23 TYPE_DATA = 0,
24#else
25 TYPE_DATA = 1,
26#endif
27 TYPE_MAX
15}; 28};
16 29
17#ifdef __KERNEL__ 30#ifdef __KERNEL__
@@ -34,6 +47,12 @@ static inline void hw_breakpoint_init(struct perf_event_attr *attr)
34 attr->sample_period = 1; 47 attr->sample_period = 1;
35} 48}
36 49
50static inline void ptrace_breakpoint_init(struct perf_event_attr *attr)
51{
52 hw_breakpoint_init(attr);
53 attr->exclude_kernel = 1;
54}
55
37static inline unsigned long hw_breakpoint_addr(struct perf_event *bp) 56static inline unsigned long hw_breakpoint_addr(struct perf_event *bp)
38{ 57{
39 return bp->attr.bp_addr; 58 return bp->attr.bp_addr;
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 0a5da639b327..6ed1d59bfb1e 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -355,6 +355,8 @@ struct i2c_adapter {
355 int nr; 355 int nr;
356 char name[48]; 356 char name[48];
357 struct completion dev_released; 357 struct completion dev_released;
358
359 struct list_head userspace_clients;
358}; 360};
359#define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev) 361#define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev)
360 362
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 462acaf36f3a..fb19bb92b809 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -19,7 +19,6 @@ 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;
23 22
24#ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ 23#ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */
25extern unsigned long max_mapnr; 24extern unsigned long max_mapnr;
@@ -1449,9 +1448,6 @@ int vmemmap_populate_basepages(struct page *start_page,
1449int vmemmap_populate(struct page *start_page, unsigned long pages, int node); 1448int vmemmap_populate(struct page *start_page, unsigned long pages, int node);
1450void vmemmap_populate_print_last(void); 1449void vmemmap_populate_print_last(void);
1451 1450
1452extern int account_locked_memory(struct mm_struct *mm, struct rlimit *rlim,
1453 size_t size);
1454extern void refund_locked_memory(struct mm_struct *mm, size_t size);
1455 1451
1456enum mf_flags { 1452enum mf_flags {
1457 MF_COUNT_INCREASED = 1 << 0, 1453 MF_COUNT_INCREASED = 1 << 0,
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index c8e375440403..3fd5c82e0e18 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -203,8 +203,19 @@ struct perf_event_attr {
203 enable_on_exec : 1, /* next exec enables */ 203 enable_on_exec : 1, /* next exec enables */
204 task : 1, /* trace fork/exit */ 204 task : 1, /* trace fork/exit */
205 watermark : 1, /* wakeup_watermark */ 205 watermark : 1, /* wakeup_watermark */
206 206 /*
207 __reserved_1 : 49; 207 * precise_ip:
208 *
209 * 0 - SAMPLE_IP can have arbitrary skid
210 * 1 - SAMPLE_IP must have constant skid
211 * 2 - SAMPLE_IP requested to have 0 skid
212 * 3 - SAMPLE_IP must have 0 skid
213 *
214 * See also PERF_RECORD_MISC_EXACT_IP
215 */
216 precise_ip : 2, /* skid constraint */
217
218 __reserved_1 : 47;
208 219
209 union { 220 union {
210 __u32 wakeup_events; /* wakeup every n events */ 221 __u32 wakeup_events; /* wakeup every n events */
@@ -287,11 +298,24 @@ struct perf_event_mmap_page {
287 __u64 data_tail; /* user-space written tail */ 298 __u64 data_tail; /* user-space written tail */
288}; 299};
289 300
290#define PERF_RECORD_MISC_CPUMODE_MASK (3 << 0) 301#define PERF_RECORD_MISC_CPUMODE_MASK (7 << 0)
291#define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0) 302#define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0)
292#define PERF_RECORD_MISC_KERNEL (1 << 0) 303#define PERF_RECORD_MISC_KERNEL (1 << 0)
293#define PERF_RECORD_MISC_USER (2 << 0) 304#define PERF_RECORD_MISC_USER (2 << 0)
294#define PERF_RECORD_MISC_HYPERVISOR (3 << 0) 305#define PERF_RECORD_MISC_HYPERVISOR (3 << 0)
306#define PERF_RECORD_MISC_GUEST_KERNEL (4 << 0)
307#define PERF_RECORD_MISC_GUEST_USER (5 << 0)
308
309/*
310 * Indicates that the content of PERF_SAMPLE_IP points to
311 * the actual instruction that triggered the event. See also
312 * perf_event_attr::precise_ip.
313 */
314#define PERF_RECORD_MISC_EXACT_IP (1 << 14)
315/*
316 * Reserve the last bit to indicate some extended misc field
317 */
318#define PERF_RECORD_MISC_EXT_RESERVED (1 << 15)
295 319
296struct perf_event_header { 320struct perf_event_header {
297 __u32 type; 321 __u32 type;
@@ -439,6 +463,12 @@ enum perf_callchain_context {
439# include <asm/perf_event.h> 463# include <asm/perf_event.h>
440#endif 464#endif
441 465
466struct perf_guest_info_callbacks {
467 int (*is_in_guest) (void);
468 int (*is_user_mode) (void);
469 unsigned long (*get_guest_ip) (void);
470};
471
442#ifdef CONFIG_HAVE_HW_BREAKPOINT 472#ifdef CONFIG_HAVE_HW_BREAKPOINT
443#include <asm/hw_breakpoint.h> 473#include <asm/hw_breakpoint.h>
444#endif 474#endif
@@ -468,6 +498,17 @@ struct perf_raw_record {
468 void *data; 498 void *data;
469}; 499};
470 500
501struct perf_branch_entry {
502 __u64 from;
503 __u64 to;
504 __u64 flags;
505};
506
507struct perf_branch_stack {
508 __u64 nr;
509 struct perf_branch_entry entries[0];
510};
511
471struct task_struct; 512struct task_struct;
472 513
473/** 514/**
@@ -506,6 +547,8 @@ struct hw_perf_event {
506 547
507struct perf_event; 548struct perf_event;
508 549
550#define PERF_EVENT_TXN_STARTED 1
551
509/** 552/**
510 * struct pmu - generic performance monitoring unit 553 * struct pmu - generic performance monitoring unit
511 */ 554 */
@@ -516,6 +559,16 @@ struct pmu {
516 void (*stop) (struct perf_event *event); 559 void (*stop) (struct perf_event *event);
517 void (*read) (struct perf_event *event); 560 void (*read) (struct perf_event *event);
518 void (*unthrottle) (struct perf_event *event); 561 void (*unthrottle) (struct perf_event *event);
562
563 /*
564 * group events scheduling is treated as a transaction,
565 * add group events as a whole and perform one schedulability test.
566 * If test fails, roll back the whole group
567 */
568
569 void (*start_txn) (const struct pmu *pmu);
570 void (*cancel_txn) (const struct pmu *pmu);
571 int (*commit_txn) (const struct pmu *pmu);
519}; 572};
520 573
521/** 574/**
@@ -571,6 +624,14 @@ enum perf_group_flag {
571 PERF_GROUP_SOFTWARE = 0x1, 624 PERF_GROUP_SOFTWARE = 0x1,
572}; 625};
573 626
627#define SWEVENT_HLIST_BITS 8
628#define SWEVENT_HLIST_SIZE (1 << SWEVENT_HLIST_BITS)
629
630struct swevent_hlist {
631 struct hlist_head heads[SWEVENT_HLIST_SIZE];
632 struct rcu_head rcu_head;
633};
634
574/** 635/**
575 * struct perf_event - performance event kernel representation: 636 * struct perf_event - performance event kernel representation:
576 */ 637 */
@@ -579,6 +640,7 @@ struct perf_event {
579 struct list_head group_entry; 640 struct list_head group_entry;
580 struct list_head event_entry; 641 struct list_head event_entry;
581 struct list_head sibling_list; 642 struct list_head sibling_list;
643 struct hlist_node hlist_entry;
582 int nr_siblings; 644 int nr_siblings;
583 int group_flags; 645 int group_flags;
584 struct perf_event *group_leader; 646 struct perf_event *group_leader;
@@ -726,6 +788,9 @@ struct perf_cpu_context {
726 int active_oncpu; 788 int active_oncpu;
727 int max_pertask; 789 int max_pertask;
728 int exclusive; 790 int exclusive;
791 struct swevent_hlist *swevent_hlist;
792 struct mutex hlist_mutex;
793 int hlist_refcount;
729 794
730 /* 795 /*
731 * Recursion avoidance: 796 * Recursion avoidance:
@@ -769,9 +834,6 @@ extern void perf_disable(void);
769extern void perf_enable(void); 834extern void perf_enable(void);
770extern int perf_event_task_disable(void); 835extern int perf_event_task_disable(void);
771extern int perf_event_task_enable(void); 836extern int perf_event_task_enable(void);
772extern int hw_perf_group_sched_in(struct perf_event *group_leader,
773 struct perf_cpu_context *cpuctx,
774 struct perf_event_context *ctx);
775extern void perf_event_update_userpage(struct perf_event *event); 837extern void perf_event_update_userpage(struct perf_event *event);
776extern int perf_event_release_kernel(struct perf_event *event); 838extern int perf_event_release_kernel(struct perf_event *event);
777extern struct perf_event * 839extern struct perf_event *
@@ -902,6 +964,10 @@ static inline void perf_event_mmap(struct vm_area_struct *vma)
902 __perf_event_mmap(vma); 964 __perf_event_mmap(vma);
903} 965}
904 966
967extern struct perf_guest_info_callbacks *perf_guest_cbs;
968extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks);
969extern int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks);
970
905extern void perf_event_comm(struct task_struct *tsk); 971extern void perf_event_comm(struct task_struct *tsk);
906extern void perf_event_fork(struct task_struct *tsk); 972extern void perf_event_fork(struct task_struct *tsk);
907 973
@@ -971,6 +1037,11 @@ perf_sw_event(u32 event_id, u64 nr, int nmi,
971static inline void 1037static inline void
972perf_bp_event(struct perf_event *event, void *data) { } 1038perf_bp_event(struct perf_event *event, void *data) { }
973 1039
1040static inline int perf_register_guest_info_callbacks
1041(struct perf_guest_info_callbacks *callbacks) { return 0; }
1042static inline int perf_unregister_guest_info_callbacks
1043(struct perf_guest_info_callbacks *callbacks) { return 0; }
1044
974static inline void perf_event_mmap(struct vm_area_struct *vma) { } 1045static inline void perf_event_mmap(struct vm_area_struct *vma) { }
975static inline void perf_event_comm(struct task_struct *tsk) { } 1046static inline void perf_event_comm(struct task_struct *tsk) { }
976static inline void perf_event_fork(struct task_struct *tsk) { } 1047static inline void perf_event_fork(struct task_struct *tsk) { }
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index e1fb60729979..4272521e29e9 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -345,18 +345,6 @@ static inline void user_single_step_siginfo(struct task_struct *tsk,
345#define arch_ptrace_stop(code, info) do { } while (0) 345#define arch_ptrace_stop(code, info) do { } while (0)
346#endif 346#endif
347 347
348#ifndef arch_ptrace_untrace
349/*
350 * Do machine-specific work before untracing child.
351 *
352 * This is called for a normal detach as well as from ptrace_exit()
353 * when the tracing task dies.
354 *
355 * Called with write_lock(&tasklist_lock) held.
356 */
357#define arch_ptrace_untrace(task) do { } while (0)
358#endif
359
360extern int task_current_syscall(struct task_struct *target, long *callno, 348extern int task_current_syscall(struct task_struct *target, long *callno,
361 unsigned long args[6], unsigned int maxargs, 349 unsigned long args[6], unsigned int maxargs,
362 unsigned long *sp, unsigned long *pc); 350 unsigned long *sp, unsigned long *pc);
diff --git a/include/linux/sched.h b/include/linux/sched.h
index dfea40574b2a..2a5b146fbaf9 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -99,7 +99,6 @@ struct futex_pi_state;
99struct robust_list_head; 99struct robust_list_head;
100struct bio_list; 100struct bio_list;
101struct fs_struct; 101struct fs_struct;
102struct bts_context;
103struct perf_event_context; 102struct perf_event_context;
104 103
105/* 104/*
@@ -1275,12 +1274,6 @@ struct task_struct {
1275 struct list_head ptraced; 1274 struct list_head ptraced;
1276 struct list_head ptrace_entry; 1275 struct list_head ptrace_entry;
1277 1276
1278 /*
1279 * This is the tracer handle for the ptrace BTS extension.
1280 * This field actually belongs to the ptracer task.
1281 */
1282 struct bts_context *bts;
1283
1284 /* PID/PID hash table linkage. */ 1277 /* PID/PID hash table linkage. */
1285 struct pid_link pids[PIDTYPE_MAX]; 1278 struct pid_link pids[PIDTYPE_MAX];
1286 struct list_head thread_group; 1279 struct list_head thread_group;
@@ -2127,10 +2120,8 @@ extern void set_task_comm(struct task_struct *tsk, char *from);
2127extern char *get_task_comm(char *to, struct task_struct *tsk); 2120extern char *get_task_comm(char *to, struct task_struct *tsk);
2128 2121
2129#ifdef CONFIG_SMP 2122#ifdef CONFIG_SMP
2130extern void wait_task_context_switch(struct task_struct *p);
2131extern unsigned long wait_task_inactive(struct task_struct *, long match_state); 2123extern unsigned long wait_task_inactive(struct task_struct *, long match_state);
2132#else 2124#else
2133static inline void wait_task_context_switch(struct task_struct *p) {}
2134static inline unsigned long wait_task_inactive(struct task_struct *p, 2125static inline unsigned long wait_task_inactive(struct task_struct *p,
2135 long match_state) 2126 long match_state)
2136{ 2127{
diff --git a/include/linux/usb.h b/include/linux/usb.h
index ce1323c4e47c..739f1fd1cc15 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -1085,7 +1085,7 @@ typedef void (*usb_complete_t)(struct urb *);
1085 * Alternatively, drivers may pass the URB_NO_xxx_DMA_MAP transfer flags, 1085 * Alternatively, drivers may pass the URB_NO_xxx_DMA_MAP transfer flags,
1086 * which tell the host controller driver that no such mapping is needed since 1086 * which tell the host controller driver that no such mapping is needed since
1087 * the device driver is DMA-aware. For example, a device driver might 1087 * the device driver is DMA-aware. For example, a device driver might
1088 * allocate a DMA buffer with usb_buffer_alloc() or call usb_buffer_map(). 1088 * allocate a DMA buffer with usb_alloc_coherent() or call usb_buffer_map().
1089 * When these transfer flags are provided, host controller drivers will 1089 * When these transfer flags are provided, host controller drivers will
1090 * attempt to use the dma addresses found in the transfer_dma and/or 1090 * attempt to use the dma addresses found in the transfer_dma and/or
1091 * setup_dma fields rather than determining a dma address themselves. 1091 * setup_dma fields rather than determining a dma address themselves.
@@ -1366,11 +1366,23 @@ static inline int usb_urb_dir_out(struct urb *urb)
1366 return (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_OUT; 1366 return (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_OUT;
1367} 1367}
1368 1368
1369void *usb_buffer_alloc(struct usb_device *dev, size_t size, 1369void *usb_alloc_coherent(struct usb_device *dev, size_t size,
1370 gfp_t mem_flags, dma_addr_t *dma); 1370 gfp_t mem_flags, dma_addr_t *dma);
1371void usb_buffer_free(struct usb_device *dev, size_t size, 1371void usb_free_coherent(struct usb_device *dev, size_t size,
1372 void *addr, dma_addr_t dma); 1372 void *addr, dma_addr_t dma);
1373 1373
1374/* Compatible macros while we switch over */
1375static inline void *usb_buffer_alloc(struct usb_device *dev, size_t size,
1376 gfp_t mem_flags, dma_addr_t *dma)
1377{
1378 return usb_alloc_coherent(dev, size, mem_flags, dma);
1379}
1380static inline void usb_buffer_free(struct usb_device *dev, size_t size,
1381 void *addr, dma_addr_t dma)
1382{
1383 return usb_free_coherent(dev, size, addr, dma);
1384}
1385
1374#if 0 1386#if 0
1375struct urb *usb_buffer_map(struct urb *urb); 1387struct urb *usb_buffer_map(struct urb *urb);
1376void usb_buffer_dmasync(struct urb *urb); 1388void usb_buffer_dmasync(struct urb *urb);
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index ff3017744711..597f8e27aaf6 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -778,6 +778,7 @@ int sctp_user_addto_chunk(struct sctp_chunk *chunk, int off, int len,
778 struct iovec *data); 778 struct iovec *data);
779void sctp_chunk_free(struct sctp_chunk *); 779void sctp_chunk_free(struct sctp_chunk *);
780void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data); 780void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data);
781void *sctp_addto_chunk_fixed(struct sctp_chunk *, int len, const void *data);
781struct sctp_chunk *sctp_chunkify(struct sk_buff *, 782struct sctp_chunk *sctp_chunkify(struct sk_buff *,
782 const struct sctp_association *, 783 const struct sctp_association *,
783 struct sock *); 784 struct sock *);
diff --git a/include/net/sock.h b/include/net/sock.h
index b4603cd54fcd..1ad6435f252e 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -74,7 +74,7 @@
74 printk(KERN_DEBUG msg); } while (0) 74 printk(KERN_DEBUG msg); } while (0)
75#else 75#else
76/* Validate arguments and do nothing */ 76/* Validate arguments and do nothing */
77static void inline int __attribute__ ((format (printf, 2, 3))) 77static inline void __attribute__ ((format (printf, 2, 3)))
78SOCK_DEBUG(struct sock *sk, const char *msg, ...) 78SOCK_DEBUG(struct sock *sk, const char *msg, ...)
79{ 79{
80} 80}
diff --git a/include/trace/events/lock.h b/include/trace/events/lock.h
index 5c1dcfc16c60..2821b86de63b 100644
--- a/include/trace/events/lock.h
+++ b/include/trace/events/lock.h
@@ -35,15 +35,15 @@ TRACE_EVENT(lock_acquire,
35 __get_str(name)) 35 __get_str(name))
36); 36);
37 37
38TRACE_EVENT(lock_release, 38DECLARE_EVENT_CLASS(lock,
39 39
40 TP_PROTO(struct lockdep_map *lock, int nested, unsigned long ip), 40 TP_PROTO(struct lockdep_map *lock, unsigned long ip),
41 41
42 TP_ARGS(lock, nested, ip), 42 TP_ARGS(lock, ip),
43 43
44 TP_STRUCT__entry( 44 TP_STRUCT__entry(
45 __string(name, lock->name) 45 __string( name, lock->name )
46 __field(void *, lockdep_addr) 46 __field( void *, lockdep_addr )
47 ), 47 ),
48 48
49 TP_fast_assign( 49 TP_fast_assign(
@@ -51,51 +51,30 @@ TRACE_EVENT(lock_release,
51 __entry->lockdep_addr = lock; 51 __entry->lockdep_addr = lock;
52 ), 52 ),
53 53
54 TP_printk("%p %s", 54 TP_printk("%p %s", __entry->lockdep_addr, __get_str(name))
55 __entry->lockdep_addr, __get_str(name))
56); 55);
57 56
58#ifdef CONFIG_LOCK_STAT 57DEFINE_EVENT(lock, lock_release,
59
60TRACE_EVENT(lock_contended,
61 58
62 TP_PROTO(struct lockdep_map *lock, unsigned long ip), 59 TP_PROTO(struct lockdep_map *lock, unsigned long ip),
63 60
64 TP_ARGS(lock, ip), 61 TP_ARGS(lock, ip)
62);
65 63
66 TP_STRUCT__entry( 64#ifdef CONFIG_LOCK_STAT
67 __string(name, lock->name)
68 __field(void *, lockdep_addr)
69 ),
70 65
71 TP_fast_assign( 66DEFINE_EVENT(lock, lock_contended,
72 __assign_str(name, lock->name);
73 __entry->lockdep_addr = lock;
74 ),
75 67
76 TP_printk("%p %s", 68 TP_PROTO(struct lockdep_map *lock, unsigned long ip),
77 __entry->lockdep_addr, __get_str(name))
78);
79 69
80TRACE_EVENT(lock_acquired, 70 TP_ARGS(lock, ip)
81 TP_PROTO(struct lockdep_map *lock, unsigned long ip, s64 waittime), 71);
82 72
83 TP_ARGS(lock, ip, waittime), 73DEFINE_EVENT(lock, lock_acquired,
84 74
85 TP_STRUCT__entry( 75 TP_PROTO(struct lockdep_map *lock, unsigned long ip),
86 __string(name, lock->name)
87 __field(s64, wait_nsec)
88 __field(void *, lockdep_addr)
89 ),
90 76
91 TP_fast_assign( 77 TP_ARGS(lock, ip)
92 __assign_str(name, lock->name);
93 __entry->wait_nsec = waittime;
94 __entry->lockdep_addr = lock;
95 ),
96 TP_printk("%p %s (%llu ns)", __entry->lockdep_addr,
97 __get_str(name),
98 __entry->wait_nsec)
99); 78);
100 79
101#endif 80#endif
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 4866c109fa9a..e0e8daa6767e 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -695,13 +695,15 @@ perf_trace_##call(void *__data, proto) \
695 struct ftrace_event_call *event_call = __data; \ 695 struct ftrace_event_call *event_call = __data; \
696 struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ 696 struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\
697 struct ftrace_raw_##call *entry; \ 697 struct ftrace_raw_##call *entry; \
698 struct pt_regs *__regs = &get_cpu_var(perf_trace_regs); \
698 u64 __addr = 0, __count = 1; \ 699 u64 __addr = 0, __count = 1; \
699 unsigned long irq_flags; \ 700 unsigned long irq_flags; \
700 struct pt_regs *__regs; \
701 int __entry_size; \ 701 int __entry_size; \
702 int __data_size; \ 702 int __data_size; \
703 int rctx; \ 703 int rctx; \
704 \ 704 \
705 perf_fetch_caller_regs(__regs, 1); \
706 \
705 __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ 707 __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \
706 __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),\ 708 __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),\
707 sizeof(u64)); \ 709 sizeof(u64)); \
@@ -709,20 +711,19 @@ perf_trace_##call(void *__data, proto) \
709 \ 711 \
710 if (WARN_ONCE(__entry_size > PERF_MAX_TRACE_SIZE, \ 712 if (WARN_ONCE(__entry_size > PERF_MAX_TRACE_SIZE, \
711 "profile buffer not large enough")) \ 713 "profile buffer not large enough")) \
712 return; \ 714 goto out; \
713 entry = (struct ftrace_raw_##call *)perf_trace_buf_prepare( \ 715 entry = (struct ftrace_raw_##call *)perf_trace_buf_prepare( \
714 __entry_size, event_call->event.type, &rctx, &irq_flags); \ 716 __entry_size, event_call->event.type, &rctx, &irq_flags); \
715 if (!entry) \ 717 if (!entry) \
716 return; \ 718 goto out; \
717 tstruct \ 719 tstruct \
718 \ 720 \
719 { assign; } \ 721 { assign; } \
720 \ 722 \
721 __regs = &__get_cpu_var(perf_trace_regs); \
722 perf_fetch_caller_regs(__regs, 2); \
723 \
724 perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \ 723 perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \
725 __count, irq_flags, __regs); \ 724 __count, irq_flags, __regs); \
725 out: \
726 put_cpu_var(perf_trace_regs); \
726} 727}
727 728
728/* 729/*