Re: [RFC 1/2] perf: support build BPF skeletons with perf

From: Jiri Olsa
Date: Tue Nov 24 2020 - 14:51:27 EST


On Wed, Nov 18, 2020 at 08:50:45PM -0800, Song Liu wrote:

SNIP

> +
> +$(TMP_OUTPUT):
> + $(call msg,MKDIR,$@)
> + $(Q)mkdir -p $(TMP_OUTPUT)
> +
> +$(TMP_OUTPUT)/vmlinux.h: $(VMLINUX_BTF_PATH) | $(TMP_OUTPUT) $(BPFTOOL)
> + $(call msg,GEN,$@)
> + $(Q)if [ ! -e "$(VMLINUX_BTF_PATH)" ] ; then \
> + echo "Couldn't find kernel BTF; set VMLINUX_BTF to" \
> + "specify its location." >&2; \
> + exit 1;\
> + fi
> + $(Q)$(BPFTOOL) btf dump file $(VMLINUX_BTF_PATH) format c > $@
> +
> +$(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(TMP_OUTPUT)
> + $(Q)$(MAKE) $(submake_extras) -C $(LIBBPF_SRC) \
> + OUTPUT=$(abspath $(dir $@))/ $(abspath $@)
> +
> +$(DEFAULT_BPFTOOL): | $(TMP_OUTPUT)
> + $(Q)$(MAKE) $(submake_extras) -C ../../../bpf/bpftool \
> + prefix= OUTPUT=$(TMP_OUTPUT)/ DESTDIR=$(TMP_OUTPUT) install

could we build just the bootstrap version of bpftool?
should be enough for skeleton and vmlinux.h dump, no?

thanks,
jirka