So that we can eventually ditch the btf_encoder__verbose and
btf_gen_float globals, making them members of 'struct btf_encoder'.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As it is just prep work to call libbpf's btf__add_datasec() for
variables using pahole's data structures populated from another format,
normally DWARF.
So that we can eventually ditch the btf_encoder__verbose and
btf_gen_float globals, making them members of 'struct btf_encoder'.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As it is just prep work to call libbpf's btf__add_var for a variable
using pahole's data structures populated from another format, normally
DWARF.
So that we can eventually ditch the btf_encoder__verbose and
btf_gen_float globals, making them members of 'struct btf_encoder'.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As it is just prep work to call libbpf's btf__add_enum_val for an
enumeration entry using pahole's data structures populated from another
format, normally DWARF.
So that we can eventually ditch the btf_encoder__verbose and
btf_gen_float globals, making them members of 'struct btf_encoder'.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As it is just prep work to call libbpf's btf__add_enum for an
enumeration using pahole's data structures populated from another
format, normally DWARF.
So that we can eventually ditch the btf_encoder__verbose and
btf_gen_float globals, making them members of 'struct btf_encoder'.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As it is just prep work to call libbpf's btf__add_enum*() APIs for an
enumeration and its entries using pahole's data structures populated
from another format, normally DWARF.
So that we can eventually ditch the btf_encoder__verbose and
btf_gen_float globals, making them members of 'struct btf_encoder'.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As it is just prep work to call libbpf's btf__add_func_param() for an
argument in a function prototype using pahole's data structures
populated from another format, normally DWARF.
So that we can eventually ditch the btf_encoder__verbose and
btf_gen_float globals, making them members of 'struct btf_encoder'.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As it is just prep work to call libbpf's btf__add_func_proto() for a
function prototype using pahole's data structures populated from another
format, normally DWARF.
So that we can eventually ditch the btf_encoder__verbose and
btf_gen_float globals, making them members of 'struct btf_encoder'.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As it is just prep work to call libbpf's btf__add_array() for an array
using pahole's data structures populated from another format, normally
DWARF.
So that we can eventually ditch the btf_encoder__verbose and
btf_gen_float globals, making them members of 'struct btf_encoder'.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As it is just prep work to call libbpf's btf__add_struct() for a
struct/union/class using pahole's data structures populated from another
format, normally DWARF.
So that we can eventually ditch the btf_encoder__verbose and
btf_gen_float globals, making them members of 'struct btf_encoder'.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As it is just prep work to call libbpf's btf__add_field() for a
struct/union/class member using pahole's data structures populated from
another format, normally DWARF.
So that we can eventually ditch the btf_encoder__verbose and
btf_gen_float globals, making them members of 'struct btf_encoder'.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As it is just prep work to call the various libbpf's btf__add*() for
structs/unions and its members using pahole's data structures populated
from another format, normally DWARF.
So that we can eventually ditch the btf_encoder__verbose and
btf_gen_float globals, making them members of 'struct btf_encoder'.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As it is just prep work to call the various libbpf's btf__add*() for
types that reference other types (volatile, const, pointers, etc) using
pahole's data structures populated from another format, normally DWARF.
So that we can eventually ditch the btf_encoder__verbose and
btf_gen_float globals, making them members of 'struct btf_encoder'.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As it is just prep work to call libbpf's btf__add_float() using
pahole's data structures populated from another format, normally DWARF.
So that we can eventually ditch the btf_encoder__verbose and
btf_gen_float globals, making them members of 'struct btf_encoder'.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As it is just prep work to call libbpf's btf__add_base_type() using
pahole's data structures populated from another format, normally DWARF.
So that we can eventually ditch the btf_encoder__verbose and
btf_gen_float globals, making them members of 'struct btf_encoder'.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
The continuous eroding of libbtf and the move to use libbpf APIs made
possible to ditch these aspects from libbtf.c and btf_elf, that is near
terminal death :-)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
To move creation to pahole.c, i.e. outside the library, to the user,
then move the other methods still using the global variable.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
I.e.:
$ rm -f vmlinux.btf ; pahole -j vmlinux.btf vmlinux && btfdiff vmlinux vmlinux.btf
Is much more robust in making sure we really generated new BTF from
the DWARF in a ELF file and that the detached BTF produces the same
output as the original DWARF.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
For a vmlinux, the usual case, btf_encoder__encode() ends up being
called just from pahole, after processing all CUs, this looks like a
leftover from when Andrii made it support multiple CUs.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As we'll call the constructor from users, not from inside the a
btf_constructor method updating a global variable.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
In 2e719cca66 ("btf_encoder: revamp how per-CPU variables are encoded")
hash.h stopped being used, remove the hash.h include.
Cc: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
And this reduces the btf_encoder__encode_tag() signature, since we don't
have to pass this variable, as it is now in the 'encoder' parameter.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>