It's useful to know kprobe's nmissed and nhit stats. For example with tracing tools, it's important to know when events may have been lost. There is currently no way to get that information from the perf API. This patch adds a new ioctl that lets users query this information. Daniel Xu (3): tracing/kprobe: Add PERF_EVENT_IOC_QUERY_KPROBE ioctl libbpf: Add helper to extract perf fd from bpf_link tracing/kprobe: Add self test for PERF_EVENT_IOC_QUERY_KPROBE include/linux/trace_events.h | 6 +++ include/uapi/linux/perf_event.h | 23 ++++++++++ kernel/events/core.c | 11 +++++ kernel/trace/trace_kprobe.c | 25 +++++++++++ tools/include/uapi/linux/perf_event.h | 23 ++++++++++ tools/lib/bpf/libbpf.c | 13 ++++++ tools/lib/bpf/libbpf.h | 1 + tools/lib/bpf/libbpf.map | 5 +++ .../selftests/bpf/prog_tests/attach_probe.c | 43 +++++++++++++++++++ 9 files changed, 150 insertions(+) -- 2.20.1