X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=include%2Ftrace%2Fftrace.h;h=3d685d1f2a03f0099f159ac96eb648eed107a0a7;hb=c5617b200ac52e35f7e8cf05a17b0a2d50f6b3e9;hp=824141d5cf04b4469f50fe07b1b4ee83f984706e;hpb=80decc70afc57c87eee9d6b836aec2ecacba3457;p=safe%2Fjmp%2Flinux-2.6 diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 824141d..3d685d1 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h @@ -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 @@ -150,7 +150,7 @@ * * entry = iter->ent; * - * if (entry->type != event_.id) { + * if (entry->type != event_->event.type) { * WARN_ON_ONCE(1); * return TRACE_TYPE_UNHANDLED; * } @@ -203,6 +203,9 @@ 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 \ @@ -221,7 +224,7 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \ \ entry = iter->ent; \ \ - if (entry->type != event->id) { \ + if (entry->type != event->event.type) { \ WARN_ON_ONCE(1); \ return TRACE_TYPE_UNHANDLED; \ } \ @@ -257,7 +260,7 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \ \ entry = iter->ent; \ \ - if (entry->type != event_##call.id) { \ + if (entry->type != event_##call.event.type) { \ WARN_ON_ONCE(1); \ return TRACE_TYPE_UNHANDLED; \ } \ @@ -409,7 +412,7 @@ static inline notrace int ftrace_get_offsets_##call( \ * __data_size = ftrace_get_offsets_(&__data_offsets, args); * * event = trace_current_buffer_lock_reserve(&buffer, - * event_.id, + * event_->event.type, * sizeof(*entry) + __data_size, * irq_flags, pc); * if (!event) @@ -510,7 +513,7 @@ ftrace_raw_event_##call(void *__data, proto) \ __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ \ event = trace_current_buffer_lock_reserve(&buffer, \ - event_call->id, \ + event_call->event.type, \ sizeof(*entry) + __data_size, \ irq_flags, pc); \ if (!event) \ @@ -695,13 +698,15 @@ 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; \ u64 __addr = 0, __count = 1; \ - unsigned long irq_flags; \ - struct pt_regs *__regs; \ + struct hlist_head *head; \ int __entry_size; \ int __data_size; \ int rctx; \ \ + perf_fetch_caller_regs(&__regs, 1); \ + \ __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),\ sizeof(u64)); \ @@ -710,19 +715,19 @@ perf_trace_##call(void *__data, proto) \ if (WARN_ONCE(__entry_size > PERF_MAX_TRACE_SIZE, \ "profile buffer not large enough")) \ return; \ + \ entry = (struct ftrace_raw_##call *)perf_trace_buf_prepare( \ - __entry_size, event_call->id, &rctx, &irq_flags); \ + __entry_size, event_call->event.type, &__regs, &rctx); \ if (!entry) \ return; \ + \ tstruct \ \ { assign; } \ \ - __regs = &__get_cpu_var(perf_trace_regs); \ - perf_fetch_caller_regs(__regs, 2); \ - \ + head = per_cpu_ptr(event_call->perf_events, smp_processor_id());\ perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \ - __count, irq_flags, __regs); \ + __count, &__regs, head); \ } /* @@ -735,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); \ - \ }