BTF-playground: btf_module_ids is only interested in kernel BTF

Skip BTF IDs that doesn't originate from the kernel as this
program are looking for kernel module BTF.

Signed-off-by: Jesper Dangaard Brouer <netoptimizer@brouer.com>
This commit is contained in:
Jesper Dangaard Brouer
2022-09-02 14:00:53 +02:00
parent 203343c5ac
commit d88d8ffe89

View File

@@ -217,6 +217,9 @@ int find_btf_id_by_name(const char *btf_name, int *btf_size)
if (info.name_len == 0) /* Skip non/empty names */
continue;
if (info.kernel_btf == 0) /* Looking for kernel module BTF */
continue;
name = u64_to_ptr(info.name);
if (strncmp(name, btf_name, 127) == 0) {