diff options
author | Steven Rostedt <srostedt@redhat.com> | 2010-05-17 22:26:53 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-05-18 00:35:23 -0400 |
commit | f0218b3e9974f06014b61be8987159f4a20e011e (patch) | |
tree | 29a593c4d71ab18cb0c450a34e79bf6bea66877e /include/trace | |
parent | 1eaa4787a774c4896518c81f24e8bccaa2244924 (diff) | |
parent | 9d192e118a094087494997ea1c8a2faf39af38c5 (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/trace')
-rw-r--r-- | include/trace/events/lock.h | 55 | ||||
-rw-r--r-- | include/trace/ftrace.h | 13 |
2 files changed, 24 insertions, 44 deletions
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 | ||
38 | TRACE_EVENT(lock_release, | 38 | DECLARE_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 | 57 | DEFINE_EVENT(lock, lock_release, |
59 | |||
60 | TRACE_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( | 66 | DEFINE_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 | ||
80 | TRACE_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), | 73 | DEFINE_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 | /* |