Messages in this thread | | | Date | Wed, 12 Feb 2014 20:58:27 +0100 | From | Peter Zijlstra <> | Subject | Re: [RFC][PATCH 4/4] perf/events: Use helper functions in event assignment to shrink macro size |
| |
> +void *perf_trace_event_setup(struct ftrace_event_call *event_call, > + struct perf_trace_event *pe) > +{ > + pe->head = this_cpu_ptr(event_call->perf_events); > + if (pe->constant && hlist_empty(pe->head)) > + return NULL; > + > + pe->entry_size = ALIGN(pe->entry_size + sizeof(u32), sizeof(u64)); > + pe->entry_size -= sizeof(u32); > + pe->event_call = event_call; > + > + perf_fetch_caller_regs(&pe->regs);
I think this one is wrong, we're getting the wrong caller now.
> + pe->entry = perf_trace_buf_prepare(pe->entry_size, > + event_call->event.type, &pe->regs, &pe->rctx); > + return pe->entry; > +} > +EXPORT_SYMBOL_GPL(perf_trace_event_setup);
> +void perf_trace_event_submit(struct perf_trace_event *pe) > +{ > + perf_trace_buf_submit(pe->entry, pe->entry_size, pe->rctx, pe->addr, > + pe->count, &pe->regs, pe->head, pe->task); > +} > +EXPORT_SYMBOL_GPL(perf_trace_event_submit);
This is ridiculous, perf_trace_buf_submit() is already a pointless wrapper, which you now wrap moar...
It would be nice if we could reduce the api clutter a little and keep this and the [ku]probe/syscall sites similar.
| |