As we already need encoder->btfe->btf, so the number of args remain the
same and paves the way for other globals to be moved to the btf_encoder
class.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Start grouping all the state associated with the BTF encoder into a new
class, do it transparently to the user, pahole, until the last moment,
when it will call btf_encoder__new(), etc.
First step is just encapsulating the btf_elf instance, we'll adding the
globals one by one and at the end probably the btf_elf class will be
completely fagocitated. 8-)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As it is all that it needs, rename from the __add_ pattern to __encode
to avoid a clash with libbpf btf__add_array() API.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As it is all that it needs, rename from the __add_ pattern to __encode
to avoid a clash with libbpf btf__add_array() API.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As it is all that it needs, rename from the __add_ pattern to __encode
to avoid a clash with libbpf btf__add_array() API.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As it is all that it needs, rename from the __add_ pattern to __encode
to avoid a clash with libbpf btf__add_array() API.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As it is all that it needs, rename from the __add_ pattern to __encode
to avoid a clash with libbpf btf__add_array() API.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As it is all that it needs, rename from the __add_ pattern to __encode
to avoid a clash with libbpf btf__add_array() API.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As it is all that it needs, rename from the __add_ pattern to __encode
to avoid a clash with libbpf btf__add_array() API.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As it is all that it needs. Rename from __add to __encode prefix for
consistency, as we have btf__add_array() and thus need to use a
different name for arrays, so do it here as well.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As it is all that it needs. Rename from __add to __encode prefix for
consistency, as we have btf__add_array() and thus need to use a
different name for arrays, so do it here as well.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As it is all that it needs. Rename from __add to __encode prefix for
consistency, as we have btf__add_array() and thus need to use a
different name for arrays, so do it here as well.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As it is all that it needs. Rename from __add to __encode prefix for
consistency, as we have btf__add_array() and thus need to use a
different name for arrays, so do it here as well.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
And that is where its passed, so just use the constructor argument, no
need to have it in the newly created object.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As btf_elf__new() is only called from the BTF encoder, and that will not
be encoding from a BTF file, it'll be from a DWARF one.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>