Go to file
Dmitrii Dolgov e50996c159 perf stat: Separate bperf from bpf_profiler
[ Upstream commit ecc68ee216 ]

It seems that perf stat -b <prog id> doesn't produce any results:

    $ perf stat -e cycles -b 4 -I 10000 -vvv
    Control descriptor is not initialized
    cycles: 0 0 0
                time        counts unit      events
	10.007641640    <not supported>      cycles

Looks like this happens because fentry/fexit progs are getting loaded, but the
corresponding perf event is not enabled and not added into the events bpf map.
I think there is some mixing up between two type of bpf support, one for bperf
and one for bpf_profiler. Both are identified via evsel__is_bpf, based on which
perf events are enabled, but for the latter (bpf_profiler) a perf event is
required. Using evsel__is_bperf to check only bperf produces expected results:

    $ perf stat -e cycles -b 4 -I 10000 -vvv
    Control descriptor is not initialized
    ------------------------------------------------------------
    perf_event_attr:
      size                             136
      sample_type                      IDENTIFIER
      read_format                      TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING
      disabled                         1
      exclude_guest                    1
    ------------------------------------------------------------
    sys_perf_event_open: pid -1  cpu 0  group_fd -1  flags 0x8 = 3
    ------------------------------------------------------------
    [...perf_event_attr for other CPUs...]
    ------------------------------------------------------------
    cycles: 309426 169009 169009
		time             counts unit events
	10.010091271             309426      cycles

The final numbers correspond (at least in the level of magnitude) to the
same metric obtained via bpftool.

Fixes: 112cb56164 ("perf stat: Introduce config stat.bpf-counter-events")
Reviewed-by: Song Liu <song@kernel.org>
Signed-off-by: Dmitrii Dolgov <9erthalion6@gmail.com>
Tested-by: Song Liu <song@kernel.org>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20230412182316.11628-1-9erthalion6@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-17 13:58:54 +02:00
Documentation ASoC: dt-bindings: qcom,lpass-rx-macro: correct minItems for clocks 2023-05-11 23:10:55 +09:00
LICENSES LICENSES: Add the copyleft-next-0.3.1 license 2022-11-08 15:44:01 +01:00
arch KVM: s390: fix race in gmap_make_secure() 2023-05-17 13:58:50 +02:00
block block: Skip destroyed blkg when restart in blkg_destroy_all() 2023-05-17 13:58:45 +02:00
certs certs: Fix build error when PKCS#11 URI contains semicolon 2023-01-31 17:53:01 +09:00
crypto crypto: engine - fix crypto_queue backlog handling 2023-05-17 13:58:53 +02:00
drivers crypto: sun8i-ss - Fix a test in sun8i_ss_setup_ivs() 2023-05-17 13:58:53 +02:00
fs rxrpc: Fix timeout of a call that hasn't yet been granted a channel 2023-05-17 13:58:47 +02:00
include crypto: api - Add scaffolding to change completion function signature 2023-05-17 13:58:53 +02:00
init gcc: disable '-Warray-bounds' for gcc-13 too 2023-04-26 14:30:08 +02:00
io_uring io_uring/rsrc: use nospec'ed indexes 2023-05-11 23:11:15 +09:00
ipc Non-MM patches for 6.2-rc1. 2022-12-12 17:28:58 -08:00
kernel kcsan: Avoid READ_ONCE() in read_instrumented_memory() 2023-05-11 23:11:34 +09:00
lib debugobject: Ensure pool refill (again) 2023-05-11 23:11:36 +09:00
mm mm/mempolicy: correctly update prev when policy is equal on mbind 2023-05-11 23:11:35 +09:00
net af_packet: Don't send zero-byte data in packet_sendmsg_spkt(). 2023-05-17 13:58:49 +02:00
rust rust: kernel: Mark rust_fmt_argument as extern "C" 2023-04-26 14:30:02 +02:00
samples ftrace: Export ftrace_free_filter() to modules 2023-01-24 11:20:58 -05:00
scripts scripts/gdb: fix lx-timerlist for Python3 2023-05-11 23:11:34 +09:00
security selinux: ensure av_permissions.h is built when needed 2023-05-11 23:10:56 +09:00
sound ALSA: caiaq: input: Add error handling for unsupported input methods in `snd_usb_caiaq_input_init` 2023-05-17 13:58:50 +02:00
tools perf stat: Separate bperf from bpf_profiler 2023-05-17 13:58:54 +02:00
usr usr/gen_init_cpio.c: remove unnecessary -1 values from int file 2022-10-03 14:21:44 -07:00
virt KVM: Register /dev/kvm as the _very_ last thing during initialization 2023-03-10 09:29:33 +01:00
.clang-format iommufd for 6.2 2022-12-14 09:15:43 -08:00
.cocciconfig
.get_maintainer.ignore get_maintainer: add Alan to .get_maintainer.ignore 2022-08-20 15:17:44 -07:00
.gitattributes .gitattributes: use 'dts' diff driver for dts files 2019-12-04 19:44:11 -08:00
.gitignore .gitignore: ignore *.rpm 2022-12-30 17:22:14 +09:00
.mailmap 12 hotfixes, mostly against mm/. Five of these fixes are cc:stable. 2023-02-13 14:09:20 -08:00
.rustfmt.toml rust: add `.rustfmt.toml` 2022-09-28 09:02:20 +02:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS MAINTAINERS: update SCTP maintainers 2023-02-02 11:35:33 -08:00
Kbuild Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS audit: update the mailing list in MAINTAINERS 2023-02-25 11:13:29 +01:00
Makefile Linux 6.2.15 2023-05-11 23:11:36 +09:00
README Drop all 00-INDEX files from Documentation/ 2018-09-09 15:08:58 -06:00

README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.