Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux...
[pandora-kernel.git] / include / trace / ftrace.h
index e0e8daa..0152b86 100644 (file)
@@ -695,14 +695,14 @@ perf_trace_##call(void *__data, proto)                                    \
        struct ftrace_event_call *event_call = __data;                  \
        struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\
        struct ftrace_raw_##call *entry;                                \
-       struct pt_regs *__regs = &get_cpu_var(perf_trace_regs);         \
+       struct pt_regs __regs;                                          \
        u64 __addr = 0, __count = 1;                                    \
-       unsigned long irq_flags;                                        \
+       struct hlist_head *head;                                        \
        int __entry_size;                                               \
        int __data_size;                                                \
        int rctx;                                                       \
                                                                        \
-       perf_fetch_caller_regs(__regs, 1);                              \
+       perf_fetch_caller_regs(&__regs, 1);                             \
                                                                        \
        __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \
        __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),\
@@ -711,19 +711,20 @@ perf_trace_##call(void *__data, proto)                                    \
                                                                        \
        if (WARN_ONCE(__entry_size > PERF_MAX_TRACE_SIZE,               \
                      "profile buffer not large enough"))               \
-               goto out;                                               \
+               return;                                                 \
+                                                                       \
        entry = (struct ftrace_raw_##call *)perf_trace_buf_prepare(     \
-               __entry_size, event_call->event.type, &rctx, &irq_flags); \
+               __entry_size, event_call->event.type, &__regs, &rctx);  \
        if (!entry)                                                     \
-               goto out;                                               \
+               return;                                                 \
+                                                                       \
        tstruct                                                         \
                                                                        \
        { assign; }                                                     \
                                                                        \
+       head = per_cpu_ptr(event_call->perf_events, smp_processor_id());\
        perf_trace_buf_submit(entry, __entry_size, rctx, __addr,        \
-                              __count, irq_flags, __regs);             \
- out:                                                                  \
-       put_cpu_var(perf_trace_regs);                                   \
+               __count, &__regs, head);                                \
 }
 
 /*
@@ -736,7 +737,6 @@ perf_trace_##call(void *__data, proto)                                      \
 static inline void perf_test_probe_##call(void)                                \
 {                                                                      \
        check_trace_callback_type_##call(perf_trace_##template);        \
-                                                                       \
 }