• Ian Rogers's avatar
    perf parse-events: Remove BPF event support · 3d6dfae8
    Ian Rogers authored
    New features like the BPF --filter support in perf record have made the
    BPF event functionality somewhat redundant. As shown by commit
    fcb027c1a4f6 ("perf tools: Revert enable indices setting syntax for BPF
    map") and commit 14e4b9f4 ("perf trace: Raw augmented syscalls fix
    libbpf 1.0+ compatibility") the BPF event support hasn't been well
    maintained and it adds considerable complexity in areas like event
    parsing, not least as '/' is a separator for event modifiers as well as
    in paths.
    
    This patch removes support in the event parser for BPF events and then
    the associated functions are removed. This leads to the removal of whole
    source files like bpf-loader.c.  Removing support means that augmented
    syscalls in perf trace is broken, this will be fixed in a later commit
    adding support using BPF skeletons.
    
    The removal of BPF events causes an unused label warning from flex
    generated code, so update build to ignore it:
    
      ```
      util/parse-events-flex.c:2704:1: error: label ‘find_rule’ defined but not used [-Werror=unused-label]
      2704 | find_rule: /* we branch to this label when backing up */
      ```
    
    Committer notes:
    
    Extracted from a larger patch that was also removing the support for
    linking with libllvm and libclang, that were an alternative to using an
    external clang execution to compile the .c event source code into BPF
    bytecode.
    
    Testing it:
    
      # perf trace -e /home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.c
      event syntax error: '/home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.c'
                            \___ Bad event or PMU
    
      Unabled to find PMU or event on a PMU of 'home'
    
      Initial error:
      event syntax error: '/home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.c'
                            \___ Cannot find PMU `home'. Missing kernel support?
      Run 'perf list' for a list of valid events
    
       Usage: perf trace [<options>] [<command>]
          or: perf trace [<options>] -- <command> [<options>]
          or: perf trace record [<options>] [<command>]
          or: perf trace record [<options>] -- <command> [<options>]
    
          -e, --event <event>   event/syscall selector. use 'perf list' to list available events
      #
    Signed-off-by: default avatarIan Rogers <irogers@google.com>
    Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
    Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Andi Kleen <ak@linux.intel.com>
    Cc: Andrii Nakryiko <andrii@kernel.org>
    Cc: Anshuman Khandual <anshuman.khandual@arm.com>
    Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
    Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
    Cc: Carsten Haitzler <carsten.haitzler@arm.com>
    Cc: Eduard Zingerman <eddyz87@gmail.com>
    Cc: Fangrui Song <maskray@google.com>
    Cc: He Kuang <hekuang@huawei.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: James Clark <james.clark@arm.com>
    Cc: Kan Liang <kan.liang@linux.intel.com>
    Cc: Leo Yan <leo.yan@linaro.org>
    Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Nathan Chancellor <nathan@kernel.org>
    Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
    Cc: Nick Desaulniers <ndesaulniers@google.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Ravi Bangoria <ravi.bangoria@amd.com>
    Cc: Rob Herring <robh@kernel.org>
    Cc: Tiezhu Yang <yangtiezhu@loongson.cn>
    Cc: Tom Rix <trix@redhat.com>
    Cc: Wang Nan <wangnan0@huawei.com>
    Cc: Wang ShaoBo <bobo.shaobowang@huawei.com>
    Cc: Yang Jihong <yangjihong1@huawei.com>
    Cc: Yonghong Song <yhs@fb.com>
    Cc: YueHaibing <yuehaibing@huawei.com>
    Cc: bpf@vger.kernel.org
    Cc: llvm@lists.linux.dev
    Link: https://lore.kernel.org/r/20230810184853.2860737-2-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    3d6dfae8
config.c 18.8 KB