From: Jiri Olsa <jolsa@redhat.com>
To: Song Liu <songliubraving@fb.com>
Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com,
peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
namhyung@kernel.org
Subject: Re: [PATCH v3 1/2] perf: support build BPF skeletons with perf
Date: Wed, 9 Dec 2020 18:03:55 +0100 [thread overview]
Message-ID: <20201209170355.GE69683@krava> (raw)
In-Reply-To: <20201208181646.3044417-2-songliubraving@fb.com>
On Tue, Dec 08, 2020 at 10:16:45AM -0800, Song Liu wrote:
> BPF programs are useful in perf to profile BPF programs. BPF skeleton is
> by far the easiest way to write BPF tools. Enable building BPF skeletons
> in util/bpf_skel. A dummy bpf skeleton is added. More bpf skeletons will
> be added for different use cases.
>
> Signed-off-by: Song Liu <songliubraving@fb.com>
one nit below, but other than that:
Acked-by: Jiri Olsa <jolsa@redhat.com>
thanks,
jirka
> ---
> tools/bpf/bpftool/Makefile | 3 ++
> tools/build/Makefile.feature | 4 ++-
> tools/perf/Makefile.config | 9 ++++++
> tools/perf/Makefile.perf | 48 +++++++++++++++++++++++++++--
> tools/perf/util/bpf_skel/.gitignore | 3 ++
> tools/scripts/Makefile.include | 1 +
> 6 files changed, 65 insertions(+), 3 deletions(-)
> create mode 100644 tools/perf/util/bpf_skel/.gitignore
>
> diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
> index f897cb5fb12d0..390af1a52601e 100644
> --- a/tools/bpf/bpftool/Makefile
> +++ b/tools/bpf/bpftool/Makefile
> @@ -139,6 +139,9 @@ endif
> BPFTOOL_BOOTSTRAP := $(BOOTSTRAP_OUTPUT)bpftool
>
> BOOTSTRAP_OBJS = $(addprefix $(BOOTSTRAP_OUTPUT),main.o common.o json_writer.o gen.o btf.o)
> +
> +bootstrap: $(BPFTOOL_BOOTSTRAP)
> +
> OBJS = $(patsubst %.c,$(OUTPUT)%.o,$(SRCS)) $(OUTPUT)disasm.o
>
> VMLINUX_BTF_PATHS ?= $(if $(O),$(O)/vmlinux) \
> diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
> index 97cbfb31b7625..74e255d58d8d0 100644
> --- a/tools/build/Makefile.feature
> +++ b/tools/build/Makefile.feature
> @@ -99,7 +99,9 @@ FEATURE_TESTS_EXTRA := \
> clang \
> libbpf \
> libpfm4 \
> - libdebuginfod
> + libdebuginfod \
> + clang-bpf-co-re
> +
>
> FEATURE_TESTS ?= $(FEATURE_TESTS_BASIC)
>
> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> index ce8516e4de34f..fe234b8bfeefb 100644
> --- a/tools/perf/Makefile.config
> +++ b/tools/perf/Makefile.config
> @@ -621,6 +621,15 @@ ifndef NO_LIBBPF
> endif
> endif
>
> +ifdef BUILD_BPF_SKEL
> + $(call feature_check,clang-bpf-co-re)
> + ifeq ($(feature-clang-bpf-co-re), 0)
> + dummy := $(error Error: clang too old. Please install recent clang)
> + endif
> + $(call detected,CONFIG_PERF_BPF_SKEL)
> + CFLAGS += -DBUILD_BPF_SKEL
sorry I did not notice before, but we use HAVE_* name style for these C macros
HAVE_BPF_SKEL should fit
> +endif
> +
> dwarf-post-unwind := 1
> dwarf-post-unwind-text := BUG
>
> diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
> index 62f3deb1d3a8b..9ea9047a621bc 100644
> --- a/tools/perf/Makefile.perf
SNIP
next prev parent reply other threads:[~2020-12-09 17:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-08 18:16 [PATCH v3 0/2] Introduce perf-stat -b for BPF programs Song Liu
2020-12-08 18:16 ` [PATCH v3 1/2] perf: support build BPF skeletons with perf Song Liu
2020-12-09 17:03 ` Jiri Olsa [this message]
2020-12-09 23:32 ` Song Liu
2020-12-08 18:16 ` [PATCH v3 2/2] perf-stat: enable counting events for BPF programs Song Liu
2020-12-09 17:03 ` Jiri Olsa
2020-12-10 0:15 ` Song Liu
2020-12-13 22:34 ` Jiri Olsa
2020-12-09 17:36 ` [PATCH v3 0/2] Introduce perf-stat -b " Arnaldo Carvalho de Melo
2020-12-09 23:30 ` Song Liu
2020-12-10 0:32 ` Song Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201209170355.GE69683@krava \
--to=jolsa@redhat.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=songliubraving@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.