diff options
-rw-r--r-- | include/linux/ftrace_event.h | 2 | ||||
-rw-r--r-- | include/linux/syscalls.h | 2 | ||||
-rw-r--r-- | include/trace/ftrace.h | 1 | ||||
-rw-r--r-- | kernel/trace/trace_event_profile.c | 6 | ||||
-rw-r--r-- | kernel/trace/trace_kprobe.c | 1 |
5 files changed, 4 insertions, 8 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index db97c64ce0e9..2233c98d80df 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -131,7 +131,7 @@ struct ftrace_event_call { | |||
131 | void *mod; | 131 | void *mod; |
132 | void *data; | 132 | void *data; |
133 | 133 | ||
134 | atomic_t profile_count; | 134 | int profile_count; |
135 | int (*profile_enable)(struct ftrace_event_call *); | 135 | int (*profile_enable)(struct ftrace_event_call *); |
136 | void (*profile_disable)(struct ftrace_event_call *); | 136 | void (*profile_disable)(struct ftrace_event_call *); |
137 | }; | 137 | }; |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 94ac28437bef..72d69860d901 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -102,12 +102,10 @@ struct perf_event_attr; | |||
102 | #ifdef CONFIG_EVENT_PROFILE | 102 | #ifdef CONFIG_EVENT_PROFILE |
103 | 103 | ||
104 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) \ | 104 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) \ |
105 | .profile_count = ATOMIC_INIT(-1), \ | ||
106 | .profile_enable = prof_sysenter_enable, \ | 105 | .profile_enable = prof_sysenter_enable, \ |
107 | .profile_disable = prof_sysenter_disable, | 106 | .profile_disable = prof_sysenter_disable, |
108 | 107 | ||
109 | #define TRACE_SYS_EXIT_PROFILE_INIT(sname) \ | 108 | #define TRACE_SYS_EXIT_PROFILE_INIT(sname) \ |
110 | .profile_count = ATOMIC_INIT(-1), \ | ||
111 | .profile_enable = prof_sysexit_enable, \ | 109 | .profile_enable = prof_sysexit_enable, \ |
112 | .profile_disable = prof_sysexit_disable, | 110 | .profile_disable = prof_sysexit_disable, |
113 | #else | 111 | #else |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 0c21af85211c..73523151a731 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -629,7 +629,6 @@ static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\ | |||
629 | #ifdef CONFIG_EVENT_PROFILE | 629 | #ifdef CONFIG_EVENT_PROFILE |
630 | 630 | ||
631 | #define _TRACE_PROFILE_INIT(call) \ | 631 | #define _TRACE_PROFILE_INIT(call) \ |
632 | .profile_count = ATOMIC_INIT(-1), \ | ||
633 | .profile_enable = ftrace_profile_enable_##call, \ | 632 | .profile_enable = ftrace_profile_enable_##call, \ |
634 | .profile_disable = ftrace_profile_disable_##call, | 633 | .profile_disable = ftrace_profile_disable_##call, |
635 | 634 | ||
diff --git a/kernel/trace/trace_event_profile.c b/kernel/trace/trace_event_profile.c index d9c60f80aa0d..9e25573242cf 100644 --- a/kernel/trace/trace_event_profile.c +++ b/kernel/trace/trace_event_profile.c | |||
@@ -25,7 +25,7 @@ static int ftrace_profile_enable_event(struct ftrace_event_call *event) | |||
25 | char *buf; | 25 | char *buf; |
26 | int ret = -ENOMEM; | 26 | int ret = -ENOMEM; |
27 | 27 | ||
28 | if (atomic_inc_return(&event->profile_count)) | 28 | if (event->profile_count++ > 0) |
29 | return 0; | 29 | return 0; |
30 | 30 | ||
31 | if (!total_profile_count) { | 31 | if (!total_profile_count) { |
@@ -56,7 +56,7 @@ fail_buf_nmi: | |||
56 | perf_trace_buf = NULL; | 56 | perf_trace_buf = NULL; |
57 | } | 57 | } |
58 | fail_buf: | 58 | fail_buf: |
59 | atomic_dec(&event->profile_count); | 59 | event->profile_count--; |
60 | 60 | ||
61 | return ret; | 61 | return ret; |
62 | } | 62 | } |
@@ -83,7 +83,7 @@ static void ftrace_profile_disable_event(struct ftrace_event_call *event) | |||
83 | { | 83 | { |
84 | char *buf, *nmi_buf; | 84 | char *buf, *nmi_buf; |
85 | 85 | ||
86 | if (!atomic_add_negative(-1, &event->profile_count)) | 86 | if (--event->profile_count > 0) |
87 | return; | 87 | return; |
88 | 88 | ||
89 | event->profile_disable(event); | 89 | event->profile_disable(event); |
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index e3c80e925896..6ed223447a3f 100644 --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c | |||
@@ -1426,7 +1426,6 @@ static int register_probe_event(struct trace_probe *tp) | |||
1426 | call->unregfunc = probe_event_disable; | 1426 | call->unregfunc = probe_event_disable; |
1427 | 1427 | ||
1428 | #ifdef CONFIG_EVENT_PROFILE | 1428 | #ifdef CONFIG_EVENT_PROFILE |
1429 | atomic_set(&call->profile_count, -1); | ||
1430 | call->profile_enable = probe_profile_enable; | 1429 | call->profile_enable = probe_profile_enable; |
1431 | call->profile_disable = probe_profile_disable; | 1430 | call->profile_disable = probe_profile_disable; |
1432 | #endif | 1431 | #endif |