Lines Matching defs:tp_event
27 static int perf_trace_event_perm(struct trace_event_call *tp_event,
32 if (tp_event->perf_perm) {
33 ret = tp_event->perf_perm(tp_event, p_event);
51 if (ftrace_event_is_function(tp_event)) {
81 if (tp_event->flags & TRACE_EVENT_FL_CAP_ANY)
96 static int perf_trace_event_reg(struct trace_event_call *tp_event,
103 p_event->tp_event = tp_event;
104 if (tp_event->perf_refcount++ > 0)
114 tp_event->perf_events = list;
129 ret = tp_event->class->reg(tp_event, TRACE_REG_PERF_REGISTER, NULL);
146 if (!--tp_event->perf_refcount) {
147 free_percpu(tp_event->perf_events);
148 tp_event->perf_events = NULL;
156 struct trace_event_call *tp_event = p_event->tp_event;
159 if (--tp_event->perf_refcount > 0)
162 tp_event->class->reg(tp_event, TRACE_REG_PERF_UNREGISTER, NULL);
170 free_percpu(tp_event->perf_events);
171 tp_event->perf_events = NULL;
183 struct trace_event_call *tp_event = p_event->tp_event;
184 return tp_event->class->reg(tp_event, TRACE_REG_PERF_OPEN, p_event);
189 struct trace_event_call *tp_event = p_event->tp_event;
190 tp_event->class->reg(tp_event, TRACE_REG_PERF_CLOSE, p_event);
193 static int perf_trace_event_init(struct trace_event_call *tp_event,
198 ret = perf_trace_event_perm(tp_event, p_event);
202 ret = perf_trace_event_reg(tp_event, p_event);
217 struct trace_event_call *tp_event;
222 list_for_each_entry(tp_event, &ftrace_events, list) {
223 if (tp_event->event.type == event_id &&
224 tp_event->class && tp_event->class->reg &&
225 trace_event_try_get_ref(tp_event)) {
226 ret = perf_trace_event_init(tp_event, p_event);
228 trace_event_put_ref(tp_event);
242 trace_event_put_ref(p_event->tp_event);
251 struct trace_event_call *tp_event;
267 tp_event = create_local_trace_kprobe(
270 if (IS_ERR(tp_event)) {
271 ret = PTR_ERR(tp_event);
276 ret = perf_trace_event_init(tp_event, p_event);
278 destroy_local_trace_kprobe(tp_event);
290 trace_event_put_ref(p_event->tp_event);
293 destroy_local_trace_kprobe(p_event->tp_event);
303 struct trace_event_call *tp_event;
319 tp_event = create_local_trace_uprobe(path, p_event->attr.probe_offset,
321 if (IS_ERR(tp_event)) {
322 ret = PTR_ERR(tp_event);
332 ret = perf_trace_event_init(tp_event, p_event);
334 destroy_local_trace_uprobe(tp_event);
346 trace_event_put_ref(p_event->tp_event);
348 destroy_local_trace_uprobe(p_event->tp_event);
354 struct trace_event_call *tp_event = p_event->tp_event;
370 if (!tp_event->class->reg(tp_event, TRACE_REG_PERF_ADD, p_event)) {
374 pcpu_list = tp_event->perf_events;
387 struct trace_event_call *tp_event = p_event->tp_event;
394 if (!tp_event->class->reg(tp_event, TRACE_REG_PERF_DEL, p_event))