uprobes/perf: Teach trace_uprobe/perf code to track the active perf_event's
authorOleg Nesterov <oleg@redhat.com>
Sun, 3 Feb 2013 19:58:35 +0000 (20:58 +0100)
committerOleg Nesterov <oleg@redhat.com>
Fri, 8 Feb 2013 17:28:06 +0000 (18:28 +0100)
commit736288ba5016e255869c26296014eeff649971c2
tree235ab829ec63136e19d97a817489484f88ad3da8
parentbdf8647c44766590ed02f9a84a450a796558b753
uprobes/perf: Teach trace_uprobe/perf code to track the active perf_event's

Introduce "struct trace_uprobe_filter" which records the "active"
perf_event's attached to ftrace_event_call. For the start we simply
use list_head, we can optimize this later if needed. For example, we
do not really need to record an event with ->parent != NULL, we can
rely on parent->child_list. And we can certainly do some optimizations
for the case when 2 events have the same ->tp_target or tp_target->mm.

Change trace_uprobe_register() to process TRACE_REG_PERF_OPEN/CLOSE
and add/del this perf_event to the list.

We can probably avoid any locking, but lets start with the "obvioulsy
correct" trace_uprobe_filter->rwlock which protects everything.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
kernel/trace/trace_uprobe.c