perf bpf: Rename perf_include_dir to libbpf_include_dir

As this is where we expect to find bpf/bpf_helpers.h, etc.

This needs more work to make it follow LIBBPF_DYNAMIC=1 usage, i.e. when
not using the system libbpf it should use the headers in the in-kernel
sources libbpf in tools/lib/bpf.

We need to do that anyway to avoid this mixup system libbpf and
in-kernel files, so we'll get this sorted out that way.

And this also may become moot as we move to using BPF skels for this
feature.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 3cd65616
...@@ -1216,7 +1216,7 @@ endif ...@@ -1216,7 +1216,7 @@ endif
# Among the variables below, these: # Among the variables below, these:
# perfexecdir # perfexecdir
# perf_include_dir # libbpf_include_dir
# perf_examples_dir # perf_examples_dir
# template_dir # template_dir
# mandir # mandir
...@@ -1240,7 +1240,7 @@ mandir = share/man ...@@ -1240,7 +1240,7 @@ mandir = share/man
infodir = share/info infodir = share/info
perfexecdir = libexec/perf-core perfexecdir = libexec/perf-core
# FIXME: system's libbpf header directory, where we expect to find bpf/bpf_helpers.h, for instance # FIXME: system's libbpf header directory, where we expect to find bpf/bpf_helpers.h, for instance
perf_include_dir = /usr/include libbpf_include_dir = /usr/include
perf_examples_dir = lib/perf/examples perf_examples_dir = lib/perf/examples
sharedir = $(prefix)/share sharedir = $(prefix)/share
template_dir = share/perf-core/templates template_dir = share/perf-core/templates
...@@ -1273,7 +1273,7 @@ includedir_SQ = $(subst ','\'',$(includedir)) ...@@ -1273,7 +1273,7 @@ includedir_SQ = $(subst ','\'',$(includedir))
mandir_SQ = $(subst ','\'',$(mandir)) mandir_SQ = $(subst ','\'',$(mandir))
infodir_SQ = $(subst ','\'',$(infodir)) infodir_SQ = $(subst ','\'',$(infodir))
perfexecdir_SQ = $(subst ','\'',$(perfexecdir)) perfexecdir_SQ = $(subst ','\'',$(perfexecdir))
perf_include_dir_SQ = $(subst ','\'',$(perf_include_dir)) libbpf_include_dir_SQ = $(subst ','\'',$(libbpf_include_dir))
perf_examples_dir_SQ = $(subst ','\'',$(perf_examples_dir)) perf_examples_dir_SQ = $(subst ','\'',$(perf_examples_dir))
template_dir_SQ = $(subst ','\'',$(template_dir)) template_dir_SQ = $(subst ','\'',$(template_dir))
htmldir_SQ = $(subst ','\'',$(htmldir)) htmldir_SQ = $(subst ','\'',$(htmldir))
...@@ -1285,13 +1285,13 @@ srcdir_SQ = $(subst ','\'',$(srcdir)) ...@@ -1285,13 +1285,13 @@ srcdir_SQ = $(subst ','\'',$(srcdir))
ifneq ($(filter /%,$(firstword $(perfexecdir))),) ifneq ($(filter /%,$(firstword $(perfexecdir))),)
perfexec_instdir = $(perfexecdir) perfexec_instdir = $(perfexecdir)
perf_include_instdir = $(perf_include_dir) perf_include_instdir = $(libbpf_include_dir)
perf_examples_instdir = $(perf_examples_dir) perf_examples_instdir = $(perf_examples_dir)
STRACE_GROUPS_INSTDIR = $(STRACE_GROUPS_DIR) STRACE_GROUPS_INSTDIR = $(STRACE_GROUPS_DIR)
tip_instdir = $(tipdir) tip_instdir = $(tipdir)
else else
perfexec_instdir = $(prefix)/$(perfexecdir) perfexec_instdir = $(prefix)/$(perfexecdir)
perf_include_instdir = $(prefix)/$(perf_include_dir) perf_include_instdir = $(prefix)/$(libbpf_include_dir)
perf_examples_instdir = $(prefix)/$(perf_examples_dir) perf_examples_instdir = $(prefix)/$(perf_examples_dir)
STRACE_GROUPS_INSTDIR = $(prefix)/$(STRACE_GROUPS_DIR) STRACE_GROUPS_INSTDIR = $(prefix)/$(STRACE_GROUPS_DIR)
tip_instdir = $(prefix)/$(tipdir) tip_instdir = $(prefix)/$(tipdir)
...@@ -1353,7 +1353,7 @@ $(call detected_var,ETC_PERFCONFIG_SQ) ...@@ -1353,7 +1353,7 @@ $(call detected_var,ETC_PERFCONFIG_SQ)
$(call detected_var,STRACE_GROUPS_DIR_SQ) $(call detected_var,STRACE_GROUPS_DIR_SQ)
$(call detected_var,prefix_SQ) $(call detected_var,prefix_SQ)
$(call detected_var,perfexecdir_SQ) $(call detected_var,perfexecdir_SQ)
$(call detected_var,perf_include_dir_SQ) $(call detected_var,libbpf_include_dir_SQ)
$(call detected_var,perf_examples_dir_SQ) $(call detected_var,perf_examples_dir_SQ)
$(call detected_var,tipdir_SQ) $(call detected_var,tipdir_SQ)
$(call detected_var,srcdir_SQ) $(call detected_var,srcdir_SQ)
......
...@@ -220,7 +220,7 @@ perf-$(CONFIG_CXX) += c++/ ...@@ -220,7 +220,7 @@ perf-$(CONFIG_CXX) += c++/
perf-$(CONFIG_LIBPFM4) += pfm.o perf-$(CONFIG_LIBPFM4) += pfm.o
CFLAGS_config.o += -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))" CFLAGS_config.o += -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
CFLAGS_llvm-utils.o += -DPERF_INCLUDE_DIR="BUILD_STR($(perf_include_dir_SQ))" CFLAGS_llvm-utils.o += -DLIBBPF_INCLUDE_DIR="BUILD_STR($(libbpf_include_dir_SQ))"
# avoid compiler warnings in 32-bit mode # avoid compiler warnings in 32-bit mode
CFLAGS_genelf_debug.o += -Wno-packed CFLAGS_genelf_debug.o += -Wno-packed
......
...@@ -463,7 +463,7 @@ int llvm__compile_bpf(const char *path, void **p_obj_buf, ...@@ -463,7 +463,7 @@ int llvm__compile_bpf(const char *path, void **p_obj_buf,
char *pipe_template = NULL; char *pipe_template = NULL;
const char *opts = llvm_param.opts; const char *opts = llvm_param.opts;
char *command_echo = NULL, *command_out; char *command_echo = NULL, *command_out;
char *perf_include_dir = system_path(PERF_INCLUDE_DIR); char *libbpf_include_dir = system_path(LIBBPF_INCLUDE_DIR);
if (path[0] != '-' && realpath(path, abspath) == NULL) { if (path[0] != '-' && realpath(path, abspath) == NULL) {
err = errno; err = errno;
...@@ -495,7 +495,7 @@ int llvm__compile_bpf(const char *path, void **p_obj_buf, ...@@ -495,7 +495,7 @@ int llvm__compile_bpf(const char *path, void **p_obj_buf,
snprintf(linux_version_code_str, sizeof(linux_version_code_str), snprintf(linux_version_code_str, sizeof(linux_version_code_str),
"0x%x", kernel_version); "0x%x", kernel_version);
if (asprintf(&perf_bpf_include_opts, "-I%s/", perf_include_dir) < 0) if (asprintf(&perf_bpf_include_opts, "-I%s/", libbpf_include_dir) < 0)
goto errout; goto errout;
force_set_env("NR_CPUS", nr_cpus_avail_str); force_set_env("NR_CPUS", nr_cpus_avail_str);
force_set_env("LINUX_VERSION_CODE", linux_version_code_str); force_set_env("LINUX_VERSION_CODE", linux_version_code_str);
...@@ -556,7 +556,7 @@ int llvm__compile_bpf(const char *path, void **p_obj_buf, ...@@ -556,7 +556,7 @@ int llvm__compile_bpf(const char *path, void **p_obj_buf,
free(kbuild_dir); free(kbuild_dir);
free(kbuild_include_opts); free(kbuild_include_opts);
free(perf_bpf_include_opts); free(perf_bpf_include_opts);
free(perf_include_dir); free(libbpf_include_dir);
if (!p_obj_buf) if (!p_obj_buf)
free(obj_buf); free(obj_buf);
...@@ -572,7 +572,7 @@ int llvm__compile_bpf(const char *path, void **p_obj_buf, ...@@ -572,7 +572,7 @@ int llvm__compile_bpf(const char *path, void **p_obj_buf,
free(kbuild_include_opts); free(kbuild_include_opts);
free(obj_buf); free(obj_buf);
free(perf_bpf_include_opts); free(perf_bpf_include_opts);
free(perf_include_dir); free(libbpf_include_dir);
free(pipe_template); free(pipe_template);
if (p_obj_buf) if (p_obj_buf)
*p_obj_buf = NULL; *p_obj_buf = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment