I have uploaded into the kernel GIT tree the ptrace dependency removal
patch. This is a major improvement to perfmon. This was a long-standing
implementation limitation, not an API limitation.
This patch is useful for all people doing per-thread monitoring and in
monitoring of another thread (not self-monitoring). Up until now, to operate
on a "remote" thread, that thread had to be stopped via ptrace(). This was
painful and it also prevented sampling of other threads within a single process.
This patch does the following:
- remove ptrace() dependency. No need to have the thread stopped via
ptrace() to issue, pfm_load_context, pfm_read_pmds, pfm_write_pmcs,
pfm_write_pmds, pfm_stop, pfm_start, close, pfm_restart. Simply issue
the syscall, the kernel will track the thread for you.
- in system-wide mode, the caller does not need to be on the monitored
CPU to issue any of the perfmon syscalls.
- no more ZOMBIE state for a context.
- effect of a perfmon syscall are guaranteed visible by the time the syscall
This is a generic change which benefits all architectures.
Please try it out.