[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <E615D7DE-06E4-4903-B47D-40336EB1F184@fb.com>
Date: Tue, 24 Nov 2020 23:51:21 +0000
From: Song Liu <songliubraving@...com>
To: Jiri Olsa <jolsa@...hat.com>
CC: open list <linux-kernel@...r.kernel.org>,
Kernel Team <Kernel-team@...com>,
"peterz@...radead.org" <peterz@...radead.org>,
"mingo@...hat.com" <mingo@...hat.com>,
"acme@...nel.org" <acme@...nel.org>,
"mark.rutland@....com" <mark.rutland@....com>,
"alexander.shishkin@...ux.intel.com"
<alexander.shishkin@...ux.intel.com>,
"namhyung@...nel.org" <namhyung@...nel.org>
Subject: Re: [RFC 1/2] perf: support build BPF skeletons with perf
> On Nov 22, 2020, at 3:32 PM, Jiri Olsa <jolsa@...hat.com> wrote:
>
> On Wed, Nov 18, 2020 at 08:50:45PM -0800, Song Liu wrote:
>
> SNIP
>
>> diff --git a/tools/perf/util/bpf_skel/.gitignore b/tools/perf/util/bpf_skel/.gitignore
>> new file mode 100644
>> index 0000000000000..5263e9e6c5d83
>> --- /dev/null
>> +++ b/tools/perf/util/bpf_skel/.gitignore
>> @@ -0,0 +1,3 @@
>> +# SPDX-License-Identifier: GPL-2.0-only
>> +.tmp
>> +*.skel.h
>> \ No newline at end of file
>> diff --git a/tools/perf/util/bpf_skel/Makefile b/tools/perf/util/bpf_skel/Makefile
>> new file mode 100644
>> index 0000000000000..853bece088f4b
>> --- /dev/null
>> +++ b/tools/perf/util/bpf_skel/Makefile
>> @@ -0,0 +1,71 @@
>> +# SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
>> +SKEL_OUTPUT := $(abspath .)
>> +TMP_OUTPUT := $(abspath .tmp)
>> +CLANG ?= clang
>> +LLC ?= llc
>> +LLVM_STRIP ?= llvm-strip
>> +DEFAULT_BPFTOOL := $(TMP_OUTPUT)/sbin/bpftool
>> +BPFTOOL ?= $(DEFAULT_BPFTOOL)
>> +LIBBPF_SRC := $(abspath ../../../lib/bpf)
>> +BPFOBJ := $(TMP_OUTPUT)/libbpf.a
>> +BPF_INCLUDE := $(TMP_OUTPUT)
>> +INCLUDES := -I$(TMP_OUTPUT) -I$(BPF_INCLUDE) -I$(abspath ../../../lib) \
>> + -I$(abspath ../../../include/uapi)
>> +CFLAGS := -g -Wall
>> +
>> +# Try to detect best kernel BTF source
>> +KERNEL_REL := $(shell uname -r)
>> +VMLINUX_BTF_PATHS := /sys/kernel/btf/vmlinux /boot/vmlinux-$(KERNEL_REL)
>> +VMLINUX_BTF_PATH := $(or $(VMLINUX_BTF),$(firstword \
>> + $(wildcard $(VMLINUX_BTF_PATHS))))
>> +ifeq ($(V),1)
>> +Q =
>> +msg =
>> +else
>> +Q = @
>> +msg = @printf ' %-8s %s%s\n' "$(1)" "$(notdir $(2))" "$(if $(3), $(3))";
>> +MAKEFLAGS += --no-print-directory
>> +submake_extras := feature_display=0
>> +endif
>
> some of the above should already be defined in the base Makefile.perf
> we should use that, I think it'd fit better in the Makefile.perf itself
Let me try that. OTOH, I think Makefile.perf is a little too big (1k+ lines)..
Thanks,
Song
Powered by blists - more mailing lists