LIBBPF_DYNAMIC=1 fixes
Arnaldo Carvalho de Melo
maintainercover LIBBPF_DYNAMIC=1 fixes
Hi,
Please take a look, noticed after processing a patch from Ian
for another such issue, on a hurry now, haven't checked when that emit_string was introduced.
- Arnaldo
Arnaldo Carvalho de Melo (2):
perf bpf: Move the LIBBPF_CURRENT_VERSION_GEQ macro to bpf-utils.h perf bpf: Check libbpf version to use
btf_dump_type_data_opts.emit_strings
tools/perf/util/bpf-event.c | 2 ++ tools/perf/util/bpf-filter.c | 5 +---- tools/perf/util/bpf-utils.h | 5 +++++ 3 files changed, 8 insertions(+), 4 deletions(-)
Signature · 1 line
2.51.0
Arnaldo Carvalho de Melo
maintainerPATCH 1/2 perf bpf: Move the LIBBPF_CURRENT_VERSION_GEQ macro to bpf-utils.h
From: Arnaldo Carvalho de Melo <[email protected]>
We need it to fix some other libbpf version dependent issues when building with LIBBPF_DINAMYC=1
--- tools/perf/util/bpf-filter.c | 5 +---- tools/perf/util/bpf-utils.h | 5 +++++ 2 files changed, 6 insertions(+), 4 deletions(-)
tools/perf/util/bpf-filter.c +1 -4
@@ -56,6 +56,7 @@#include "util/debug.h" #include "util/evsel.h" #include "util/target.h" +#include "util/bpf-utils.h" #include "util/bpf-filter.h" #include <util/bpf-filter-flex.h>
@@ -443,10 +444,6 @@ static int create_idx_hash(struct evsel *evsel, struct perf_bpf_filter_entry *enreturn -1 ; } -#define LIBBPF_CURRENT_VERSION_GEQ (major, minor) \ - (LIBBPF_MAJOR_VERSION > (major) || \ - (LIBBPF_MAJOR_VERSION == (major) && LIBBPF_MINOR_VERSION >= (minor))) -int perf_bpf_filter__prepare (struct evsel *evsel,struct target *target) {int i, x, y, fd, ret;
tools/perf/util/bpf-utils.h +5 -0
@@ -8,6 +8,11 @@#ifdef HAVE_LIBBPF_SUPPORT #include <bpf/libbpf.h> +#include <bpf/libbpf_version.h> + +#define LIBBPF_CURRENT_VERSION_GEQ (major, minor) \ + (LIBBPF_MAJOR_VERSION > (major) || \ + (LIBBPF_MAJOR_VERSION == (major) && LIBBPF_MINOR_VERSION >= (minor)))/* * Get bpf_prog_info in continuous memory
Signature · 1 line
2.51.0
Re: [PATCH 1/2] perf bpf: Move the LIBBPF_CURRENT_VERSION_GEQ macro to bpf-utils.h
Quoted 5 lines · Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo <[email protected]>
We need it to fix some other libbpf version dependent issues when building with LIBBPF_DINAMYC=1
nit: s/DINAMYC/DYNAMIC/ :-)
Thanks,
Ian
Quoted 56 lines
Cc Adrian Hunter <[email protected]>Cc Andrii Nakryiko <[email protected]>Cc Ian Rogers <[email protected]>Cc James Clark <[email protected]>Cc Jiri Olsa <[email protected]>Cc Kan Liang <[email protected]>Cc Namhyung Kim <[email protected]>Signed-off-by Arnaldo Carvalho de Melo <[email protected]>--- tools/perf/util/bpf-filter.c | 5 +---- tools/perf/util/bpf-utils.h | 5 +++++ 2 files changed, 6 insertions(+), 4 deletions(-)tools/perf/util/bpf-filter.c +1
-4@@ -56,6 +56,7 @@#include "util/debug.h" #include "util/evsel.h" #include "util/target.h" +#include "util/bpf-utils.h" #include "util/bpf-filter.h" #include <util/bpf-filter-flex.h> @@ -443,10 +444,6 @@ static int create_idx_hash(struct evsel *evsel, struct perf_bpf_filter_entry *enreturn -1 ; } -#define LIBBPF_CURRENT_VERSION_GEQ (major, minor) \ - (LIBBPF_MAJOR_VERSION > (major) || \ - (LIBBPF_MAJOR_VERSION == (major) && LIBBPF_MINOR_VERSION >= (minor))) -int perf_bpf_filter__prepare (struct evsel *evsel,struct target *target) {int i, x, y, fd, ret;tools/perf/util/bpf-utils.h +5
-1@@ -8,6 +8,11 @@#ifdef HAVE_LIBBPF_SUPPORT #include <bpf/libbpf.h> +#include <bpf/libbpf_version.h> + +#define LIBBPF_CURRENT_VERSION_GEQ (major, minor) \ + (LIBBPF_MAJOR_VERSION > (major) || \ + (LIBBPF_MAJOR_VERSION == (major) && LIBBPF_MINOR_VERSION >= (minor)))/* * Get bpf_prog_info in continuous memory -- 2.51.0
Arnaldo Carvalho de Melo
maintainerPATCH 2/2 perf bpf: Check libbpf version to use btf_dump_type_data_opts.emit_strings
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
When building perf with LIBBPF_DINAMIC=1 on a fedora system with libbpf-devel 1.5 I it was breaking with:
util/bpf-event.c: In function ‘format_btf_variable’:util/bpf-event.c:291:18: error: ‘const struct btf_dump_type_data_opts’ has no member named ‘emit_strings’
291 | .emit_strings = 1,
| ^~~~~~~~~~~~
util/bpf-event.c:291:33: error: initialized field overwritten [-Werror=override-init]
291 | .emit_strings = 1,
| ^util/bpf-event.c:291:33: note: (near initialization for ‘opts.skip_names’)
Check the version before using that feature.
--- tools/perf/util/bpf-event.c | 2 ++ 1 file changed, 2 insertions(+)
tools/perf/util/bpf-event.c +2 -0
@@ -288,7 +288,9 @@ static void format_btf_variable(struct btf *btf, char *buf, size_t buf_size, .sz = sizeof(struct btf_dump_type_data_opts), .skip_names = 1, .compact = 1, +#if LIBBPF_CURRENT_VERSION_GEQ (1 ,7 ) .emit_strings = 1, +#endif };struct btf_dump *d;size_t btf_size;
Signature · 1 line
2.51.0
Re: [PATCH 2/2] perf bpf: Check libbpf version to use btf_dump_type_data_opts.emit_strings
Quoted 4 lines · Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo <[email protected]>
When building perf with LIBBPF_DINAMIC=1 on a fedora system with
nit: s/DINAMIC/DYNAMIC/
Quoted 13 lines
libbpf-devel 1.5 I it was breaking with:
util/bpf-event.c: In function ‘format_btf_variable’:util/bpf-event.c:291:18: error: ‘const struct btf_dump_type_data_opts’ has no member named ‘emit_strings’
291 | .emit_strings = 1,| ^~~~~~~~~~~~
util/bpf-event.c:291:33: error: initialized field overwritten [-Werror=override-init]
291 | .emit_strings = 1,
| ^util/bpf-event.c:291:33: note: (near initialization for ‘opts.skip_names’)Check the version before using that feature.
Quoted 8 lines
Cc Adrian Hunter <[email protected]>Cc Andrii Nakryiko <[email protected]>Cc Ian Rogers <[email protected]>Cc James Clark <[email protected]>Cc Jiri Olsa <[email protected]>Cc Kan Liang <[email protected]>Cc Namhyung Kim <[email protected]>Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
Thanks,
Ian
Quoted 21 lines
--- tools/perf/util/bpf-event.c | 2 ++ 1 file changed, 2 insertions(+)tools/perf/util/bpf-event.c +2
-1@@ -288,7 +288,9 @@ static void format_btf_variable(struct btf *btf, char *buf, size_t buf_size, .sz = sizeof(struct btf_dump_type_data_opts), .skip_names = 1, .compact = 1, +#if LIBBPF_CURRENT_VERSION_GEQ (1 ,7 ) .emit_strings = 1, +#endif };struct btf_dump *d;size_t btf_size; --2.51.0
Quoted 6 lines · Arnaldo Carvalho de Melo
Hi,
Please take a look, noticed after processing a patch from Ian
for another such issue, on a hurry now, haven't checked when thatemit_stringwas introduced.
Quoted 6 lines
- Arnaldo
Arnaldo Carvalho de Melo (2):
perf bpf: Move theLIBBPF_CURRENT_VERSION_GEQmacro tobpf-utils.hperf bpf: Check libbpf version to use
btf_dump_type_data_opts.emit_strings
Thanks,
Namhyung
Quoted 9 lines
tools/perf/util/bpf-event.c | 2 ++ tools/perf/util/bpf-filter.c | 5 +---- tools/perf/util/bpf-utils.h | 5 +++++ 3 files changed, 8 insertions(+), 4 deletions(-)Signature · 1 line
2.51.0
Ian Rogers
reviewerQuoted 7 lines · Namhyung Kim
Quoted 5 lines · Arnaldo Carvalho de Melo
Hi,
Please take a look, noticed after processing a patch from Ian
for another such issue, on a hurry now, haven't checked when thatemit_stringwas introduced.
emit_strings was added in Linux v6.17 and libbpf was tagged as version 1.7 prior to that.
Thanks,
Ian
Quoted 22 lines
Quoted 7 lines
- Arnaldo
Arnaldo Carvalho de Melo (2):
perf bpf: Move theLIBBPF_CURRENT_VERSION_GEQmacro tobpf-utils.hperf bpf: Check libbpf version to use
btf_dump_type_data_opts.emit_stringsAcked-by Namhyung Kim <[email protected]>Thanks,
NamhyungQuoted 9 lines
tools/perf/util/bpf-event.c | 2 ++ tools/perf/util/bpf-filter.c | 5 +---- tools/perf/util/bpf-utils.h | 5 +++++ 3 files changed, 8 insertions(+), 4 deletions(-)--
2.51.0
Ian Rogers
reviewerQuoted 10 lines · Ian Rogers
Quoted 7 lines · Namhyung Kim
Quoted 5 lines · Arnaldo Carvalho de Melo
Hi,
Please take a look, noticed after processing a patch from Ian
for another such issue, on a hurry now, haven't checked when thatemit_stringwas introduced.
Quoted 5 lines
emit_stringswas added in Linux v6.17 and libbpf was tagged as version 1.7 prior to that.Thanks,
Ian
Ping.
When this lands I can rebase:
https://lore.kernel.org/lkml/[email protected]/
on it.
Thanks,
Ian
Quoted 22 lines
Quoted 22 lines
Quoted 7 lines
- Arnaldo
Arnaldo Carvalho de Melo (2):
perf bpf: Move theLIBBPF_CURRENT_VERSION_GEQmacro tobpf-utils.hperf bpf: Check libbpf version to use
btf_dump_type_data_opts.emit_stringsAcked-by Namhyung Kim <[email protected]>Thanks,
NamhyungQuoted 9 lines
tools/perf/util/bpf-event.c | 2 ++ tools/perf/util/bpf-filter.c | 5 +---- tools/perf/util/bpf-utils.h | 5 +++++ 3 files changed, 8 insertions(+), 4 deletions(-)--
2.51.0
Arnaldo Carvalho de Melo
maintainerQuoted 14 lines · Ian Rogers
Quoted 13 lines · Ian Rogers
Quoted 7 lines · Namhyung Kim
Quoted 5 lines · Arnaldo Carvalho de Melo
Hi,
Please take a look, noticed after processing a patch from Ian
for another such issue, on a hurry now, haven't checked when thatemit_stringwas introduced.
emit_stringswas added in Linux v6.17 and libbpf was tagged as version 1.7 prior to that.
Quoted 8 lines
Quoted 2 lines
Thanks,
IanPing.
When this lands I can rebase:
https://lore.kernel.org/lkml/[email protected]/
on it.
I'm testing this now.
- Arnaldo
Quoted 25 lines
Thanks,
IanQuoted 22 lines
Quoted 22 lines
Quoted 7 lines
- Arnaldo
Arnaldo Carvalho de Melo (2):
perf bpf: Move theLIBBPF_CURRENT_VERSION_GEQmacro tobpf-utils.hperf bpf: Check libbpf version to use
btf_dump_type_data_opts.emit_stringsAcked-by Namhyung Kim <[email protected]>Thanks,
NamhyungQuoted 9 lines
tools/perf/util/bpf-event.c | 2 ++ tools/perf/util/bpf-filter.c | 5 +---- tools/perf/util/bpf-utils.h | 5 +++++ 3 files changed, 8 insertions(+), 4 deletions(-)--
2.51.0