Lines Matching refs:tp_event
27 static int perf_trace_event_perm(struct trace_event_call *tp_event, in perf_trace_event_perm() argument
32 if (tp_event->perf_perm) { in perf_trace_event_perm()
33 ret = tp_event->perf_perm(tp_event, p_event); in perf_trace_event_perm()
51 if (ftrace_event_is_function(tp_event)) { in perf_trace_event_perm()
81 if (tp_event->flags & TRACE_EVENT_FL_CAP_ANY) in perf_trace_event_perm()
96 static int perf_trace_event_reg(struct trace_event_call *tp_event, in perf_trace_event_reg() argument
103 p_event->tp_event = tp_event; in perf_trace_event_reg()
104 if (tp_event->perf_refcount++ > 0) in perf_trace_event_reg()
114 tp_event->perf_events = list; in perf_trace_event_reg()
129 ret = tp_event->class->reg(tp_event, TRACE_REG_PERF_REGISTER, NULL); in perf_trace_event_reg()
146 if (!--tp_event->perf_refcount) { in perf_trace_event_reg()
147 free_percpu(tp_event->perf_events); in perf_trace_event_reg()
148 tp_event->perf_events = NULL; in perf_trace_event_reg()
156 struct trace_event_call *tp_event = p_event->tp_event; in perf_trace_event_unreg() local
159 if (--tp_event->perf_refcount > 0) in perf_trace_event_unreg()
162 tp_event->class->reg(tp_event, TRACE_REG_PERF_UNREGISTER, NULL); in perf_trace_event_unreg()
170 free_percpu(tp_event->perf_events); in perf_trace_event_unreg()
171 tp_event->perf_events = NULL; in perf_trace_event_unreg()
180 trace_event_put_ref(tp_event); in perf_trace_event_unreg()
185 struct trace_event_call *tp_event = p_event->tp_event; in perf_trace_event_open() local
186 return tp_event->class->reg(tp_event, TRACE_REG_PERF_OPEN, p_event); in perf_trace_event_open()
191 struct trace_event_call *tp_event = p_event->tp_event; in perf_trace_event_close() local
192 tp_event->class->reg(tp_event, TRACE_REG_PERF_CLOSE, p_event); in perf_trace_event_close()
195 static int perf_trace_event_init(struct trace_event_call *tp_event, in perf_trace_event_init() argument
200 ret = perf_trace_event_perm(tp_event, p_event); in perf_trace_event_init()
204 ret = perf_trace_event_reg(tp_event, p_event); in perf_trace_event_init()
219 struct trace_event_call *tp_event; in perf_trace_init() local
224 list_for_each_entry(tp_event, &ftrace_events, list) { in perf_trace_init()
225 if (tp_event->event.type == event_id && in perf_trace_init()
226 tp_event->class && tp_event->class->reg && in perf_trace_init()
227 trace_event_try_get_ref(tp_event)) { in perf_trace_init()
228 ret = perf_trace_event_init(tp_event, p_event); in perf_trace_init()
230 trace_event_put_ref(tp_event); in perf_trace_init()
252 struct trace_event_call *tp_event; in perf_kprobe_init() local
272 tp_event = create_local_trace_kprobe( in perf_kprobe_init()
275 if (IS_ERR(tp_event)) { in perf_kprobe_init()
276 ret = PTR_ERR(tp_event); in perf_kprobe_init()
281 ret = perf_trace_event_init(tp_event, p_event); in perf_kprobe_init()
283 destroy_local_trace_kprobe(tp_event); in perf_kprobe_init()
297 destroy_local_trace_kprobe(p_event->tp_event); in perf_kprobe_destroy()
307 struct trace_event_call *tp_event; in perf_uprobe_init() local
323 tp_event = create_local_trace_uprobe(path, p_event->attr.probe_offset, in perf_uprobe_init()
325 if (IS_ERR(tp_event)) { in perf_uprobe_init()
326 ret = PTR_ERR(tp_event); in perf_uprobe_init()
336 ret = perf_trace_event_init(tp_event, p_event); in perf_uprobe_init()
338 destroy_local_trace_uprobe(tp_event); in perf_uprobe_init()
351 destroy_local_trace_uprobe(p_event->tp_event); in perf_uprobe_destroy()
357 struct trace_event_call *tp_event = p_event->tp_event; in perf_trace_add() local
367 if (!tp_event->class->reg(tp_event, TRACE_REG_PERF_ADD, p_event)) { in perf_trace_add()
371 pcpu_list = tp_event->perf_events; in perf_trace_add()
384 struct trace_event_call *tp_event = p_event->tp_event; in perf_trace_del() local
391 if (!tp_event->class->reg(tp_event, TRACE_REG_PERF_DEL, p_event)) in perf_trace_del()