Re: [PATCH bpf-next v2 1/3] bpf: btf: export btf types and name by offset from lib

From: Jakub Kicinski
Date: Tue Jul 03 2018 - 00:07:39 EST


On Mon, 2 Jul 2018 11:39:14 -0700, Okash Khawaja wrote:
> --- a/tools/lib/bpf/btf.h
> +++ b/tools/lib/bpf/btf.h
> @@ -17,6 +17,9 @@ void btf__free(struct btf *btf);
> struct btf *btf__new(uint8_t *data, uint32_t size, btf_print_fn_t err_log);
> int32_t btf__find_by_name(const struct btf *btf, const char *type_name);
> int64_t btf__resolve_size(const struct btf *btf, uint32_t type_id);
> +int32_t btf__resolve_type(const struct btf *btf, uint32_t type_id);
> int btf__fd(const struct btf *btf);
> +const char *btf__name_by_offset(const struct btf *btf, uint32_t offset);
> +const struct btf_type *btf__type_by_id(const struct btf *btf, uint32_t type_id);

Why is BTF code using stdint types? libbpf used to follow the kernel
coding style AFA int types go.