> On Jun 27, 2019, at 10:47 AM, Andrii Nakryiko <andrii.nakryiko@xxxxxxxxx> wrote: > > On Thu, Jun 27, 2019 at 10:27 AM Song Liu <songliubraving@xxxxxx> wrote: >> >> >> >>> On Jun 26, 2019, at 4:21 PM, Andrii Nakryiko <andriin@xxxxxx> wrote: >>> >>> Change BTF-defined map definitions to capture compile-time integer >>> values as part of BTF type definition, to avoid split of key/value type >>> information and actual type/size/flags initialization for maps. >> >> If I have an old bpf program and compiled it with new llvm, will it >> work with new libbpf? > > You mean BPF programs that used previous incarnation of BTF-defined > maps? No, they won't work. But we never released them, so I think it's > ok to change them. Nothing should be using that except for selftests, > which I fixed. I see. This makes sense. > >> >> >>> >>> Signed-off-by: Andrii Nakryiko <andriin@xxxxxx> >>> --- > > <snip> > >>> diff --git a/tools/testing/selftests/bpf/bpf_helpers.h b/tools/testing/selftests/bpf/bpf_helpers.h >>> index 1a5b1accf091..aa5ddf58c088 100644 >>> --- a/tools/testing/selftests/bpf/bpf_helpers.h >>> +++ b/tools/testing/selftests/bpf/bpf_helpers.h >>> @@ -8,6 +8,9 @@ >>> */ >>> #define SEC(NAME) __attribute__((section(NAME), used)) >>> >>> +#define __int(name, val) int (*name)[val] >>> +#define __type(name, val) val *name >>> + >> >> I think we need these two in libbpf. > > Yes, but it's another story for another set of patches. We'll need to > provide bpf_helpers as part of libbpf for inclusion into BPF programs, > but there are a bunch of problems right now with existing > bpf_heplers.h that prevents us from just copying it into libbpf. We'll > need to resolve those first. > > But then again, there is no use of __int and __type for user-space > programs, so for now it's ok. OK. How about we put these two lines in an separate patch? Thanks, Song