]> git.baikalelectronics.ru Git - kernel.git/commit
uprobes/perf: Avoid uprobe_apply() whenever possible
authorOleg Nesterov <oleg@redhat.com>
Mon, 4 Feb 2013 18:05:43 +0000 (19:05 +0100)
committerOleg Nesterov <oleg@redhat.com>
Fri, 8 Feb 2013 17:28:08 +0000 (18:28 +0100)
commita3c928fcbb97e1e4753dfdc02ddd5fc336e1b624
tree1bd1defbfe3f285dfa7c77f94bc5523ac4a82679
parent2a92eeb70e89d7bd8040f86976e0b01a8e8e6014
uprobes/perf: Avoid uprobe_apply() whenever possible

uprobe_perf_open/close call the costly uprobe_apply() every time,
we can avoid it if:

- "nr_systemwide != 0" is not changed.

- There is another process/thread with the same ->mm.

- copy_proccess() does inherit_event(). dup_mmap() preserves the
  inserted breakpoints.

- event->attr.enable_on_exec == T, we can rely on uprobe_mmap()
  called by exec/mmap paths.

- tp_target is exiting. Only _close() checks PF_EXITING, I don't
  think TRACE_REG_PERF_OPEN can hit the dying task too often.

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