Re: [RFC PATCH v3 33/37] perf bpf: Probe at kprobe points

Alexei Starovoitov
2015-05-18T19:25:19Z

On 5/17/15 3:56 AM, Wang Nan wrote:
> In this patch, kprobe points are created using add_perf_probe_events.
> Since all events are already grouped together in an array, calling
> add_perf_probe_events() once creates all of them.
>
> To ensure recover the system when existing, a bpf_unprobe() is also
> provided and hooked to atexit(). Because all of events are in group
> "perf_bpf_probe" (PERF_BPF_PROBE_GROUP), use 'perf_bpf_probe:*' string
> to remove all of them should be a simple method. However, this also
> introduces a constrain that only one instance of 'perf bpf' is allowed
> to be active.

perf bits look ok to me, but I'm not a perf codebase expert.
The above restriction also looks fine for now.
We can relax it later if it really becomes a problem.