On Wed, Jun 28, 2023 at 11:53:18AM +0000, Yafang Shao wrote: > This patchset enhances the usability of kprobe_multi program by introducing > support for ->fill_link_info. This allows users to easily determine the > probed functions associated with a kprobe_multi program. While > `bpftool perf show` already provides information about functions probed by > perf_event programs, supporting ->fill_link_info ensures consistent access > to this information across all bpf links. > > In addition, this patch extends support to generic perf events, which are > currently not covered by `bpftool perf show`. While userspace is exposed to > only the perf type and config, other attributes such as sample_period and > sample_freq are disregarded. > > To ensure accurate identification of probed functions, it is preferable to > expose the address directly rather than relying solely on the symbol name. > However, this implementation respects the kptr_restrict setting and avoids > exposing the address if it is not permitted. > > v5->v6: > - From Andrii > - if ucount is too less, copy ucount items and return -E2BIG > - zero out kmulti_link->cnt elements if it is not permitted by kptr > - avoid leaking information when ucount is greater than kmulti_link->cnt > - drop the flags, and add BPF_PERF_EVENT_[UK]RETPROBE > - From Quentin > - use jsonw_null instead when we have no module name > - add explanation on perf_type_name in the commit log > - avoid the unnecessary out lable Acked-by: Jiri Olsa <jolsa@xxxxxxxxxx> jirka