Lines Matching refs:tp_event
24 static int perf_trace_event_perm(struct ftrace_event_call *tp_event, in perf_trace_event_perm() argument
28 if (ftrace_event_is_function(tp_event) && in perf_trace_event_perm()
38 if (tp_event->flags & TRACE_EVENT_FL_CAP_ANY) in perf_trace_event_perm()
52 static int perf_trace_event_reg(struct ftrace_event_call *tp_event, in perf_trace_event_reg() argument
59 p_event->tp_event = tp_event; in perf_trace_event_reg()
60 if (tp_event->perf_refcount++ > 0) in perf_trace_event_reg()
70 tp_event->perf_events = list; in perf_trace_event_reg()
85 ret = tp_event->class->reg(tp_event, TRACE_REG_PERF_REGISTER, NULL); in perf_trace_event_reg()
102 if (!--tp_event->perf_refcount) { in perf_trace_event_reg()
103 free_percpu(tp_event->perf_events); in perf_trace_event_reg()
104 tp_event->perf_events = NULL; in perf_trace_event_reg()
112 struct ftrace_event_call *tp_event = p_event->tp_event; in perf_trace_event_unreg() local
115 if (--tp_event->perf_refcount > 0) in perf_trace_event_unreg()
118 tp_event->class->reg(tp_event, TRACE_REG_PERF_UNREGISTER, NULL); in perf_trace_event_unreg()
126 free_percpu(tp_event->perf_events); in perf_trace_event_unreg()
127 tp_event->perf_events = NULL; in perf_trace_event_unreg()
136 module_put(tp_event->mod); in perf_trace_event_unreg()
141 struct ftrace_event_call *tp_event = p_event->tp_event; in perf_trace_event_open() local
142 return tp_event->class->reg(tp_event, TRACE_REG_PERF_OPEN, p_event); in perf_trace_event_open()
147 struct ftrace_event_call *tp_event = p_event->tp_event; in perf_trace_event_close() local
148 tp_event->class->reg(tp_event, TRACE_REG_PERF_CLOSE, p_event); in perf_trace_event_close()
151 static int perf_trace_event_init(struct ftrace_event_call *tp_event, in perf_trace_event_init() argument
156 ret = perf_trace_event_perm(tp_event, p_event); in perf_trace_event_init()
160 ret = perf_trace_event_reg(tp_event, p_event); in perf_trace_event_init()
175 struct ftrace_event_call *tp_event; in perf_trace_init() local
180 list_for_each_entry(tp_event, &ftrace_events, list) { in perf_trace_init()
181 if (tp_event->event.type == event_id && in perf_trace_init()
182 tp_event->class && tp_event->class->reg && in perf_trace_init()
183 try_module_get(tp_event->mod)) { in perf_trace_init()
184 ret = perf_trace_event_init(tp_event, p_event); in perf_trace_init()
186 module_put(tp_event->mod); in perf_trace_init()
205 struct ftrace_event_call *tp_event = p_event->tp_event; in perf_trace_add() local
209 pcpu_list = tp_event->perf_events; in perf_trace_add()
219 return tp_event->class->reg(tp_event, TRACE_REG_PERF_ADD, p_event); in perf_trace_add()
224 struct ftrace_event_call *tp_event = p_event->tp_event; in perf_trace_del() local
226 tp_event->class->reg(tp_event, TRACE_REG_PERF_DEL, p_event); in perf_trace_del()