Em Sat, Feb 12, 2022 at 12:36:49PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Sat, Feb 12, 2022 at 12:34:58PM -0300, Arnaldo Carvalho de Melo escreveu: > > Em Fri, Feb 11, 2022 at 11:30:52PM -0800, Andrii Nakryiko escreveu: > > > libbpf's bpf_prog_load() and bpf__object_next() APIs are deprecated. > > > remove perf's usage of these deprecated functions. After this patch > > > set, the only remaining libbpf deprecated APIs in perf would be > > > bpf_program__set_prep() and bpf_program__nth_fd(). > > > > Not applying to perf/core, I'm checking... > > Just some fuzz on the second patch: > > ⬢[acme@toolbox perf]$ patch -p1 < ~/wb/1.patch > patching file tools/perf/util/bpf-loader.c > Hunk #2 succeeded at 111 with fuzz 1 (offset -1 lines). > Hunk #3 succeeded at 156 (offset -2 lines). > Hunk #4 succeeded at 1563 (offset 8 lines). > Hunk #5 succeeded at 1575 (offset 8 lines). > Hunk #6 succeeded at 1628 (offset 8 lines). > ⬢[acme@toolbox perf]$ > > Applying manually to test on the set of test build containers. perf test clean, these also work: # perf trace -e tools/perf/examples/bpf/augmented_raw_syscalls.c sleep 1 [root@quaco perf]# perf trace -e tools/perf/examples/bpf/5sec.c sleep 5s 0.000 perf_bpf_probe:hrtimer_nanosleep(__probe_ip: -1994947936, rqtp: 5000000000) [root@quaco perf]# containers building: [perfbuilder@five ~]$ export BUILD_TARBALL=http://192.168.100.2/perf/perf-5.17.0-rc3.tar.xz [perfbuilder@five ~]$ time dm 1 164.81 almalinux:8 : Ok gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-4) , clang version 12.0.1 (Red Hat 12.0.1-4.module_el8.5.0+1025+93159d6c) 2 90.60 alpine:3.4 : Ok gcc (Alpine 5.3.0) 5.3.0 , clang version 3.8.0 (tags/RELEASE_380/final) 3 55.88 alpine:3.5 : Ok gcc (Alpine 6.2.1) 6.2.1 20160822 , clang version 3.8.1 (tags/RELEASE_381/final) 4 58.69 alpine:3.6 : Ok gcc (Alpine 6.3.0) 6.3.0 , clang version 4.0.0 (tags/RELEASE_400/final) 5 65.65 alpine:3.7 : Ok gcc (Alpine 6.4.0) 6.4.0 , Alpine clang version 5.0.0 (tags/RELEASE_500/final) (based on LLVM 5.0.0) 6 69.85 alpine:3.8 : Ok gcc (Alpine 6.4.0) 6.4.0 , Alpine clang version 5.0.1 (tags/RELEASE_501/final) (based on LLVM 5.0.1) 7 66.83 alpine:3.9 : Ok gcc (Alpine 8.3.0) 8.3.0 , Alpine clang version 5.0.1 (tags/RELEASE_502/final) (based on LLVM 5.0.1) 8: alpine:3.10 I don't expect problems with those, so probably later today I'll push it to perf/core so that it will be on its way t 5.18. - Arnaldo > > > ⬢[acme@toolbox perf]$ b4 am -ctsl --cc-trailers 20220212073054.1052880-1-andrii@xxxxxxxxxx > > Looking up https://lore.kernel.org/r/20220212073054.1052880-1-andrii%40kernel.org > > Grabbing thread from lore.kernel.org/all/20220212073054.1052880-1-andrii%40kernel.org/t.mbox.gz > > Checking for newer revisions on https://lore.kernel.org/all/ > > Analyzing 3 messages in the thread > > Checking attestation on all messages, may take a moment... > > --- > > [PATCH v5 1/2] perf: Stop using deprecated bpf_load_program() API > > + Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> > > + Link: https://lore.kernel.org/r/20220212073054.1052880-2-andrii@xxxxxxxxxx > > + Cc: kernel-team@xxxxxx > > + Cc: daniel@xxxxxxxxxxxxx > > + Cc: ast@xxxxxxxxxx > > + Cc: bpf@xxxxxxxxxxxxxxx > > [PATCH v5 2/2] perf: Stop using deprecated bpf_object__next() API > > + Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> > > + Link: https://lore.kernel.org/r/20220212073054.1052880-3-andrii@xxxxxxxxxx > > + Cc: kernel-team@xxxxxx > > + Cc: daniel@xxxxxxxxxxxxx > > + Cc: ast@xxxxxxxxxx > > + Cc: bpf@xxxxxxxxxxxxxxx > > --- > > Total patches: 2 > > --- > > Cover: ./v5_20220211_andrii_perf_stop_using_deprecated_bpf_apis.cover > > Link: https://lore.kernel.org/r/20220212073054.1052880-1-andrii@xxxxxxxxxx > > Base: not specified > > git am ./v5_20220211_andrii_perf_stop_using_deprecated_bpf_apis.mbx > > ⬢[acme@toolbox perf]$ git am ./v5_20220211_andrii_perf_stop_using_deprecated_bpf_apis.mbx > > Applying: perf: Stop using deprecated bpf_load_program() API > > Applying: perf: Stop using deprecated bpf_object__next() API > > error: patch failed: tools/perf/util/bpf-loader.c:68 > > error: tools/perf/util/bpf-loader.c: patch does not apply > > Patch failed at 0002 perf: Stop using deprecated bpf_object__next() API > > hint: Use 'git am --show-current-patch=diff' to see the failed patch > > When you have resolved this problem, run "git am --continue". > > If you prefer to skip this patch, run "git am --skip" instead. > > To restore the original branch and stop patching, run "git am --abort". > > > > > > - Arnaldo > > > > > v4 -> v5: > > > - add bpf_perf_object__add() and use it where appropriate (Jiri); > > > - use __maybe_unused in first patch; > > > v3 -> v4: > > > - Fixed commit title > > > - Added weak definition for deprecated function > > > v2 -> v3: > > > - Fixed commit message to use upstream perf > > > v1 -> v2: > > > - Added missing commit message > > > - Added more details to commit message and added steps to reproduce > > > original test case. > > > > > > Christy Lee (2): > > > perf: Stop using deprecated bpf_load_program() API > > > perf: Stop using deprecated bpf_object__next() API > > > > > > tools/perf/tests/bpf.c | 14 ++---- > > > tools/perf/util/bpf-event.c | 13 +++++ > > > tools/perf/util/bpf-loader.c | 98 +++++++++++++++++++++++++++++------- > > > 3 files changed, 96 insertions(+), 29 deletions(-) > > > > > > -- > > > 2.30.2 > > > > -- > > > > - Arnaldo > > -- > > - Arnaldo -- - Arnaldo