Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[safe/jmp/linux-2.6] / include / trace / ftrace.h
index e0e8daa..3d685d1 100644 (file)
@@ -68,7 +68,7 @@
 
 #undef DEFINE_EVENT
 #define DEFINE_EVENT(template, name, proto, args)      \
-       static struct ftrace_event_call                 \
+       static struct ftrace_event_call __used          \
        __attribute__((__aligned__(4))) event_##name
 
 #undef DEFINE_EVENT_PRINT
                ftrace_print_symbols_seq(p, value, symbols);            \
        })
 
+#undef __print_hex
+#define __print_hex(buf, buf_len) ftrace_print_hex_seq(p, buf, buf_len)
+
 #undef DECLARE_EVENT_CLASS
 #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
 static notrace enum print_line_t                                       \
@@ -695,14 +698,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 +714,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 +740,6 @@ perf_trace_##call(void *__data, proto)                                      \
 static inline void perf_test_probe_##call(void)                                \
 {                                                                      \
        check_trace_callback_type_##call(perf_trace_##template);        \
-                                                                       \
 }