lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190917133056.5545-1-dxu@dxuuu.xyz>
Date:   Tue, 17 Sep 2019 06:30:51 -0700
From:   Daniel Xu <dxu@...uu.xyz>
To:     bpf@...r.kernel.org, songliubraving@...com, yhs@...com,
        andriin@...com, peterz@...radead.org, mingo@...hat.com,
        acme@...nel.org
Cc:     Daniel Xu <dxu@...uu.xyz>, ast@...com,
        alexander.shishkin@...ux.intel.com, jolsa@...hat.com,
        namhyung@...nel.org, linux-kernel@...r.kernel.org,
        netdev@...r.kernel.org, kernel-team@...com
Subject: [PATCH bpf-next 0/5] Add PERF_FORMAT_LOST read_format

It's useful to know kprobe's nmissed count. For example with tracing
tools, it's important to know when events may have been lost.  debugfs
currently exposes a control file to get this information, but it is not
compatible with probes registered with the perf API.

While bpf programs may be able to manually count nhit, there is no way
to gather nmissed. In other words, it is currently not possible to this
retrieve information about FD-based probes.

This patch adds a new field to perf's read_format that lets users query
misses. Misses include both misses from the underlying kprobe
infrastructure and misses from ringbuffer infrastructure.

I studied the code various code paths for perf software events and perf
tracepoints and it does not look like anything can "miss" in the same
way kprobes can. They can all, however, suffer from ringbuffer misses.
It's possible I missed something while reading the code so please let
me know if I am mistaken.

Daniel Xu (5):
  perf/core: Add PERF_FORMAT_LOST read_format
  perf/core: Sync perf_event.h to tools
  libbpf: Add helpers to extract perf fd from bpf_link
  libbpf: Set read_format PERF_FORMAT_LOST on kprobe perf fds
  libbpf: Add selftest for PERF_FORMAT_LOST perf read_format

 include/linux/trace_events.h                  |  1 +
 include/uapi/linux/perf_event.h               |  5 ++-
 kernel/events/core.c                          | 39 +++++++++++++++++--
 kernel/trace/trace_kprobe.c                   |  8 ++++
 tools/include/uapi/linux/perf_event.h         |  5 ++-
 tools/lib/bpf/libbpf.c                        | 30 ++++++++++++--
 tools/lib/bpf/libbpf.h                        | 13 +++++++
 tools/lib/bpf/libbpf.map                      |  3 ++
 .../selftests/bpf/prog_tests/attach_probe.c   | 32 ++++++++++++++-
 9 files changed, 127 insertions(+), 9 deletions(-)

-- 
2.21.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ