Lines Matching refs:p_event
28 struct perf_event *p_event) in perf_trace_event_perm() argument
33 ret = tp_event->perf_perm(tp_event, p_event); in perf_trace_event_perm()
42 if (p_event->parent) in perf_trace_event_perm()
52 ret = perf_allow_tracepoint(&p_event->attr); in perf_trace_event_perm()
56 if (!is_sampling_event(p_event)) in perf_trace_event_perm()
64 if (!p_event->attr.exclude_callchain_user) in perf_trace_event_perm()
71 if (p_event->attr.sample_type & PERF_SAMPLE_STACK_USER) in perf_trace_event_perm()
76 if (!(p_event->attr.sample_type & PERF_SAMPLE_RAW)) in perf_trace_event_perm()
80 if (p_event->attach_state == PERF_ATTACH_TASK) { in perf_trace_event_perm()
89 ret = perf_allow_tracepoint(&p_event->attr); in perf_trace_event_perm()
97 struct perf_event *p_event) in perf_trace_event_reg() argument
103 p_event->tp_event = tp_event; in perf_trace_event_reg()
154 static void perf_trace_event_unreg(struct perf_event *p_event) in perf_trace_event_unreg() argument
156 struct trace_event_call *tp_event = p_event->tp_event; in perf_trace_event_unreg()
181 static int perf_trace_event_open(struct perf_event *p_event) in perf_trace_event_open() argument
183 struct trace_event_call *tp_event = p_event->tp_event; in perf_trace_event_open()
184 return tp_event->class->reg(tp_event, TRACE_REG_PERF_OPEN, p_event); in perf_trace_event_open()
187 static void perf_trace_event_close(struct perf_event *p_event) in perf_trace_event_close() argument
189 struct trace_event_call *tp_event = p_event->tp_event; in perf_trace_event_close()
190 tp_event->class->reg(tp_event, TRACE_REG_PERF_CLOSE, p_event); in perf_trace_event_close()
194 struct perf_event *p_event) in perf_trace_event_init() argument
198 ret = perf_trace_event_perm(tp_event, p_event); in perf_trace_event_init()
202 ret = perf_trace_event_reg(tp_event, p_event); in perf_trace_event_init()
206 ret = perf_trace_event_open(p_event); in perf_trace_event_init()
208 perf_trace_event_unreg(p_event); in perf_trace_event_init()
215 int perf_trace_init(struct perf_event *p_event) in perf_trace_init() argument
218 u64 event_id = p_event->attr.config; in perf_trace_init()
226 ret = perf_trace_event_init(tp_event, p_event); in perf_trace_init()
237 void perf_trace_destroy(struct perf_event *p_event) in perf_trace_destroy() argument
240 perf_trace_event_close(p_event); in perf_trace_destroy()
241 perf_trace_event_unreg(p_event); in perf_trace_destroy()
242 trace_event_put_ref(p_event->tp_event); in perf_trace_destroy()
247 int perf_kprobe_init(struct perf_event *p_event, bool is_retprobe) in perf_kprobe_init() argument
253 if (p_event->attr.kprobe_func) { in perf_kprobe_init()
254 func = strndup_user(u64_to_user_ptr(p_event->attr.kprobe_func), in perf_kprobe_init()
268 func, (void *)(unsigned long)(p_event->attr.kprobe_addr), in perf_kprobe_init()
269 p_event->attr.probe_offset, is_retprobe); in perf_kprobe_init()
276 ret = perf_trace_event_init(tp_event, p_event); in perf_kprobe_init()
285 void perf_kprobe_destroy(struct perf_event *p_event) in perf_kprobe_destroy() argument
288 perf_trace_event_close(p_event); in perf_kprobe_destroy()
289 perf_trace_event_unreg(p_event); in perf_kprobe_destroy()
290 trace_event_put_ref(p_event->tp_event); in perf_kprobe_destroy()
293 destroy_local_trace_kprobe(p_event->tp_event); in perf_kprobe_destroy()
298 int perf_uprobe_init(struct perf_event *p_event, in perf_uprobe_init() argument
305 if (!p_event->attr.uprobe_path) in perf_uprobe_init()
308 path = strndup_user(u64_to_user_ptr(p_event->attr.uprobe_path), in perf_uprobe_init()
319 tp_event = create_local_trace_uprobe(path, p_event->attr.probe_offset, in perf_uprobe_init()
332 ret = perf_trace_event_init(tp_event, p_event); in perf_uprobe_init()
341 void perf_uprobe_destroy(struct perf_event *p_event) in perf_uprobe_destroy() argument
344 perf_trace_event_close(p_event); in perf_uprobe_destroy()
345 perf_trace_event_unreg(p_event); in perf_uprobe_destroy()
346 trace_event_put_ref(p_event->tp_event); in perf_uprobe_destroy()
348 destroy_local_trace_uprobe(p_event->tp_event); in perf_uprobe_destroy()
352 int perf_trace_add(struct perf_event *p_event, int flags) in perf_trace_add() argument
354 struct trace_event_call *tp_event = p_event->tp_event; in perf_trace_add()
357 p_event->hw.state = PERF_HES_STOPPED; in perf_trace_add()
364 if (!tp_event->class->reg(tp_event, TRACE_REG_PERF_ADD, p_event)) { in perf_trace_add()
373 hlist_add_head_rcu(&p_event->hlist_entry, list); in perf_trace_add()
379 void perf_trace_del(struct perf_event *p_event, int flags) in perf_trace_del() argument
381 struct trace_event_call *tp_event = p_event->tp_event; in perf_trace_del()
388 if (!tp_event->class->reg(tp_event, TRACE_REG_PERF_DEL, p_event)) in perf_trace_del()
389 hlist_del_rcu(&p_event->hlist_entry); in perf_trace_del()