From: Jiri Olsa <jolsa@kernel.org> Date: 2021-02-05 12:43:52
Setting up separate build directories for libbpf and libpsubcmd,
so it's separated from other objects and we don't get them mixed
in the future.
It also simplifies cleaning, which is now simple rm -rf.
Also there's no need for FEATURE-DUMP.libbpf and bpf_helper_defs.h
files in .gitignore anymore.
Acked-by: Song Liu <redacted>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/bpf/resolve_btfids/.gitignore | 2 --
tools/bpf/resolve_btfids/Makefile | 26 +++++++++++---------------
2 files changed, 11 insertions(+), 17 deletions(-)
From: Jiri Olsa <jolsa@kernel.org> Date: 2021-02-05 12:43:55
The resolve_btfids tool is used during the kernel build,
so we should clean it on kernel's make clean.
Invoking the the resolve_btfids clean as part of root
'make clean'.
Acked-by: Song Liu <redacted>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
Makefile | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
From: Jiri Olsa <jolsa@kernel.org> Date: 2021-02-05 23:02:21
We want this clean to be called from tree's root Makefile,
which defines same srctree variable and that will screw
the make setup.
We actually do not use srctree being passed from outside,
so we can solve this by setting current srctree value
directly.
Also changing the way how srctree is initialized as suggested
by Andrri.
Also root Makefile does not define the implicit RM variable,
so adding RM initialization.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/bpf/resolve_btfids/Makefile | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
From: Jiri Olsa <jolsa@kernel.org> Date: 2021-02-05 23:02:47
We want this clean to be called from tree's root clean
and that one is silent if there's nothing to clean.
Adding check for all object to clean and display CLEAN
messages only if there are objects to remove.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/bpf/resolve_btfids/Makefile | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
On Fri, Feb 5, 2021 at 2:59 PM Jiri Olsa [off-list ref] wrote:
We want this clean to be called from tree's root clean
and that one is silent if there's nothing to clean.
Adding check for all object to clean and display CLEAN
messages only if there are objects to remove.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
On Fri, Feb 5, 2021 at 4:46 AM Jiri Olsa [off-list ref] wrote:
Setting up separate build directories for libbpf and libpsubcmd,
so it's separated from other objects and we don't get them mixed
in the future.
It also simplifies cleaning, which is now simple rm -rf.
Also there's no need for FEATURE-DUMP.libbpf and bpf_helper_defs.h
files in .gitignore anymore.
Acked-by: Song Liu <redacted>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
On Fri, Feb 5, 2021 at 4:45 AM Jiri Olsa [off-list ref] wrote:
hi,
resolve_btfids tool is used during the kernel build,
so we should clean it on kernel's make clean.
v2 changes:
- add Song's acks on patches 1 and 4 (others changed) [Song]
- add missing / [Andrii]
- change srctree variable initialization [Andrii]
- shifted ifdef for clean target [Andrii]
thanks,
jirka
From: Jiri Olsa <hidden> Date: 2021-02-06 03:02:35
On Fri, Feb 05, 2021 at 02:27:08PM -0800, Andrii Nakryiko wrote:
On Fri, Feb 5, 2021 at 4:45 AM Jiri Olsa [off-list ref] wrote:
quoted
hi,
resolve_btfids tool is used during the kernel build,
so we should clean it on kernel's make clean.
v2 changes:
- add Song's acks on patches 1 and 4 (others changed) [Song]
- add missing / [Andrii]
- change srctree variable initialization [Andrii]
- shifted ifdef for clean target [Andrii]
thanks,
jirka
On Fri, Feb 5, 2021 at 4:46 AM Jiri Olsa [off-list ref] wrote:
We want this clean to be called from tree's root Makefile,
which defines same srctree variable and that will screw
the make setup.
We actually do not use srctree being passed from outside,
so we can solve this by setting current srctree value
directly.
Also changing the way how srctree is initialized as suggested
by Andrri.
Also root Makefile does not define the implicit RM variable,
so adding RM initialization.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
From: Jiri Olsa <hidden> Date: 2021-02-06 03:26:48
On Fri, Feb 05, 2021 at 11:32:57PM +0100, Jiri Olsa wrote:
On Fri, Feb 05, 2021 at 02:27:08PM -0800, Andrii Nakryiko wrote:
quoted
On Fri, Feb 5, 2021 at 4:45 AM Jiri Olsa [off-list ref] wrote:
quoted
hi,
resolve_btfids tool is used during the kernel build,
so we should clean it on kernel's make clean.
v2 changes:
- add Song's acks on patches 1 and 4 (others changed) [Song]
- add missing / [Andrii]
- change srctree variable initialization [Andrii]
- shifted ifdef for clean target [Andrii]
thanks,
jirka
On Fri, Feb 5, 2021 at 4:46 AM Jiri Olsa [off-list ref] wrote:
quoted hunk
The resolve_btfids tool is used during the kernel build,
so we should clean it on kernel's make clean.
Invoking the the resolve_btfids clean as part of root
'make clean'.
Acked-by: Song Liu <redacted>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
Makefile | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
On Fri, Feb 5, 2021 at 4:45 AM Jiri Olsa [off-list ref] wrote:
hi,
resolve_btfids tool is used during the kernel build,
so we should clean it on kernel's make clean.
v2 changes:
- add Song's acks on patches 1 and 4 (others changed) [Song]
- add missing / [Andrii]
- change srctree variable initialization [Andrii]
- shifted ifdef for clean target [Andrii]
thanks,
jirka
---
Jiri Olsa (4):
tools/resolve_btfids: Build libbpf and libsubcmd in separate directories
tools/resolve_btfids: Check objects before removing
tools/resolve_btfids: Set srctree variable unconditionally
kbuild: Add resolve_btfids clean to root clean target
Makefile | 7 ++++++-
tools/bpf/resolve_btfids/.gitignore | 2 --
tools/bpf/resolve_btfids/Makefile | 44 ++++++++++++++++++++++----------------------
3 files changed, 28 insertions(+), 25 deletions(-)
I've applied the changes to the bpf-next tree. Thanks.
Next time please make sure that each patch in the series has a v2 tag
in [PATCH] section, it was a bit confusing to figure out which one is
the actual v2 version. Our tooling (CI) also expects the format [PATCH
v2 bpf-next], so try not to merge v2 with PATCH.
From: Jiri Olsa <hidden> Date: 2021-02-09 09:35:15
On Mon, Feb 08, 2021 at 09:36:40PM -0800, Andrii Nakryiko wrote:
On Fri, Feb 5, 2021 at 4:45 AM Jiri Olsa [off-list ref] wrote:
quoted
hi,
resolve_btfids tool is used during the kernel build,
so we should clean it on kernel's make clean.
v2 changes:
- add Song's acks on patches 1 and 4 (others changed) [Song]
- add missing / [Andrii]
- change srctree variable initialization [Andrii]
- shifted ifdef for clean target [Andrii]
thanks,
jirka
---
Jiri Olsa (4):
tools/resolve_btfids: Build libbpf and libsubcmd in separate directories
tools/resolve_btfids: Check objects before removing
tools/resolve_btfids: Set srctree variable unconditionally
kbuild: Add resolve_btfids clean to root clean target
Makefile | 7 ++++++-
tools/bpf/resolve_btfids/.gitignore | 2 --
tools/bpf/resolve_btfids/Makefile | 44 ++++++++++++++++++++++----------------------
3 files changed, 28 insertions(+), 25 deletions(-)
I've applied the changes to the bpf-next tree. Thanks.
Next time please make sure that each patch in the series has a v2 tag
in [PATCH] section, it was a bit confusing to figure out which one is
the actual v2 version. Our tooling (CI) also expects the format [PATCH
v2 bpf-next], so try not to merge v2 with PATCH.
On Fri, Feb 05, 2021 at 01:40:20PM +0100, Jiri Olsa wrote:
quoted hunk
The resolve_btfids tool is used during the kernel build,
so we should clean it on kernel's make clean.
Invoking the the resolve_btfids clean as part of root
'make clean'.
Acked-by: Song Liu <redacted>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
Makefile | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
@@ -1495,7 +1500,7 @@ vmlinuxclean:$(Q)$(CONFIG_SHELL)$(srctree)/scripts/link-vmlinux.shclean$(Q)$(if$(ARCH_POSTLINK),$(MAKE)-f$(ARCH_POSTLINK)clean)-clean:archcleanvmlinuxclean+clean:archcleanvmlinuxcleanresolve_btfids_clean# mrproper - Delete all generated files, including .config#
--
2.26.2
This breaks running distclean on a clean tree (my script just
unconditionally runs distclean regardless of the tree state):
$ make -s O=build distclean
../../scripts/Makefile.include:4: *** O=/home/nathan/cbl/src/linux-next/build/tools/bpf/resolve_btfids does not exist. Stop.
Cheers,
Nathan
On Wed, Feb 10, 2021 at 9:47 AM Nathan Chancellor [off-list ref] wrote:
On Fri, Feb 05, 2021 at 01:40:20PM +0100, Jiri Olsa wrote:
quoted
The resolve_btfids tool is used during the kernel build,
so we should clean it on kernel's make clean.
Invoking the the resolve_btfids clean as part of root
'make clean'.
Acked-by: Song Liu <redacted>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
Makefile | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
@@ -1495,7 +1500,7 @@ vmlinuxclean:$(Q)$(CONFIG_SHELL)$(srctree)/scripts/link-vmlinux.shclean$(Q)$(if$(ARCH_POSTLINK),$(MAKE)-f$(ARCH_POSTLINK)clean)-clean:archcleanvmlinuxclean+clean:archcleanvmlinuxcleanresolve_btfids_clean# mrproper - Delete all generated files, including .config#--
2.26.2
This breaks running distclean on a clean tree (my script just
unconditionally runs distclean regardless of the tree state):
$ make -s O=build distclean
../../scripts/Makefile.include:4: *** O=/home/nathan/cbl/src/linux-next/build/tools/bpf/resolve_btfids does not exist. Stop.
Can't reproduce it. It works in all kinds of variants (relative and
absolute O=, clean and not clean trees, etc). Jiri, please check as
well.
On Wed, Feb 10, 2021 at 09:52:42AM -0800, Andrii Nakryiko wrote:
On Wed, Feb 10, 2021 at 9:47 AM Nathan Chancellor [off-list ref] wrote:
quoted
On Fri, Feb 05, 2021 at 01:40:20PM +0100, Jiri Olsa wrote:
quoted
The resolve_btfids tool is used during the kernel build,
so we should clean it on kernel's make clean.
Invoking the the resolve_btfids clean as part of root
'make clean'.
Acked-by: Song Liu <redacted>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
Makefile | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
@@ -1495,7 +1500,7 @@ vmlinuxclean:$(Q)$(CONFIG_SHELL)$(srctree)/scripts/link-vmlinux.shclean$(Q)$(if$(ARCH_POSTLINK),$(MAKE)-f$(ARCH_POSTLINK)clean)-clean:archcleanvmlinuxclean+clean:archcleanvmlinuxcleanresolve_btfids_clean# mrproper - Delete all generated files, including .config#--
2.26.2
This breaks running distclean on a clean tree (my script just
unconditionally runs distclean regardless of the tree state):
$ make -s O=build distclean
../../scripts/Makefile.include:4: *** O=/home/nathan/cbl/src/linux-next/build/tools/bpf/resolve_btfids does not exist. Stop.
Can't reproduce it. It works in all kinds of variants (relative and
absolute O=, clean and not clean trees, etc). Jiri, please check as
well.
Odd, this reproduces for me on a completely clean checkout of bpf-next:
$ git clone --depth=1 https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/
$ cd bpf-next
$ make -s O=build distclean
../../scripts/Makefile.include:4: *** O=/tmp/bpf-next/build/tools/bpf/resolve_btfids does not exist. Stop.
I do not really see how this could be environment related. It seems like
this comes from tools/scripts/Makefile.include, where there is no
guarantee that $(O) is created before being used like in the main
Makefile?
Cheers,
Nathan
From: Jiri Olsa <hidden> Date: 2021-02-10 18:17:55
On Wed, Feb 10, 2021 at 09:52:42AM -0800, Andrii Nakryiko wrote:
On Wed, Feb 10, 2021 at 9:47 AM Nathan Chancellor [off-list ref] wrote:
quoted
On Fri, Feb 05, 2021 at 01:40:20PM +0100, Jiri Olsa wrote:
quoted
The resolve_btfids tool is used during the kernel build,
so we should clean it on kernel's make clean.
Invoking the the resolve_btfids clean as part of root
'make clean'.
Acked-by: Song Liu <redacted>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
Makefile | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
@@ -1495,7 +1500,7 @@ vmlinuxclean:$(Q)$(CONFIG_SHELL)$(srctree)/scripts/link-vmlinux.shclean$(Q)$(if$(ARCH_POSTLINK),$(MAKE)-f$(ARCH_POSTLINK)clean)-clean:archcleanvmlinuxclean+clean:archcleanvmlinuxcleanresolve_btfids_clean# mrproper - Delete all generated files, including .config#--
2.26.2
This breaks running distclean on a clean tree (my script just
unconditionally runs distclean regardless of the tree state):
$ make -s O=build distclean
../../scripts/Makefile.include:4: *** O=/home/nathan/cbl/src/linux-next/build/tools/bpf/resolve_btfids does not exist. Stop.
Can't reproduce it. It works in all kinds of variants (relative and
absolute O=, clean and not clean trees, etc). Jiri, please check as
well.
I can reproduce if I set O=XXX to directory that does not contain kernel build
$ mkdir /tmp/krava
$ make O=/tmp/krava distclean
make[1]: Entering directory '/tmp/krava'
../../scripts/Makefile.include:4: *** O=/tmp/krava/tools/bpf/resolve_btfids does not exist. Stop.
make[1]: *** [/home/jolsa/linux/Makefile:1092: resolve_btfids_clean] Error 2
make[1]: Leaving directory '/tmp/krava'
make: *** [Makefile:185: __sub-make] Error 2
will check on fix
jirka
From: Jiri Olsa <hidden> Date: 2021-02-10 18:35:28
On Wed, Feb 10, 2021 at 11:02:15AM -0700, Nathan Chancellor wrote:
On Wed, Feb 10, 2021 at 09:52:42AM -0800, Andrii Nakryiko wrote:
quoted
On Wed, Feb 10, 2021 at 9:47 AM Nathan Chancellor [off-list ref] wrote:
quoted
On Fri, Feb 05, 2021 at 01:40:20PM +0100, Jiri Olsa wrote:
quoted
The resolve_btfids tool is used during the kernel build,
so we should clean it on kernel's make clean.
Invoking the the resolve_btfids clean as part of root
'make clean'.
Acked-by: Song Liu <redacted>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
Makefile | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
@@ -1495,7 +1500,7 @@ vmlinuxclean:$(Q)$(CONFIG_SHELL)$(srctree)/scripts/link-vmlinux.shclean$(Q)$(if$(ARCH_POSTLINK),$(MAKE)-f$(ARCH_POSTLINK)clean)-clean:archcleanvmlinuxclean+clean:archcleanvmlinuxcleanresolve_btfids_clean# mrproper - Delete all generated files, including .config#--
2.26.2
This breaks running distclean on a clean tree (my script just
unconditionally runs distclean regardless of the tree state):
$ make -s O=build distclean
../../scripts/Makefile.include:4: *** O=/home/nathan/cbl/src/linux-next/build/tools/bpf/resolve_btfids does not exist. Stop.
Can't reproduce it. It works in all kinds of variants (relative and
absolute O=, clean and not clean trees, etc). Jiri, please check as
well.
Odd, this reproduces for me on a completely clean checkout of bpf-next:
$ git clone --depth=1 https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/
$ cd bpf-next
$ make -s O=build distclean
../../scripts/Makefile.include:4: *** O=/tmp/bpf-next/build/tools/bpf/resolve_btfids does not exist. Stop.
I do not really see how this could be environment related. It seems like
this comes from tools/scripts/Makefile.include, where there is no
guarantee that $(O) is created before being used like in the main
Makefile?
right, we need to handle the case where tools/bpf/resolve_btfids
does not exist, patch below fixes it for me
jirka
---
@@ -1088,8 +1088,14 @@ endifPHONY+=resolve_btfids_clean+resolve_btfids_O=$(abspath$(objtree))/tools/bpf/resolve_btfids++# tools/bpf/resolve_btfids directory might not exist+# in output directory, skip its clean in that caseresolve_btfids_clean:-$(Q)$(MAKE)-sC$(srctree)/tools/bpf/resolve_btfidsO=$(abspath$(objtree))/tools/bpf/resolve_btfidsclean+ifneq (,$(wildcard $(resolve_btfids_O)))+$(Q)$(MAKE)-sC$(srctree)/tools/bpf/resolve_btfidsO=$(resolve_btfids_O)clean+endififdef CONFIG_BPFifdef CONFIG_DEBUG_INFO_BTF
On Wed, Feb 10, 2021 at 07:29:31PM +0100, Jiri Olsa wrote:
On Wed, Feb 10, 2021 at 11:02:15AM -0700, Nathan Chancellor wrote:
quoted
On Wed, Feb 10, 2021 at 09:52:42AM -0800, Andrii Nakryiko wrote:
quoted
On Wed, Feb 10, 2021 at 9:47 AM Nathan Chancellor [off-list ref] wrote:
quoted
On Fri, Feb 05, 2021 at 01:40:20PM +0100, Jiri Olsa wrote:
quoted
The resolve_btfids tool is used during the kernel build,
so we should clean it on kernel's make clean.
Invoking the the resolve_btfids clean as part of root
'make clean'.
Acked-by: Song Liu <redacted>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
Makefile | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
@@ -1495,7 +1500,7 @@ vmlinuxclean:$(Q)$(CONFIG_SHELL)$(srctree)/scripts/link-vmlinux.shclean$(Q)$(if$(ARCH_POSTLINK),$(MAKE)-f$(ARCH_POSTLINK)clean)-clean:archcleanvmlinuxclean+clean:archcleanvmlinuxcleanresolve_btfids_clean# mrproper - Delete all generated files, including .config#--
2.26.2
This breaks running distclean on a clean tree (my script just
unconditionally runs distclean regardless of the tree state):
$ make -s O=build distclean
../../scripts/Makefile.include:4: *** O=/home/nathan/cbl/src/linux-next/build/tools/bpf/resolve_btfids does not exist. Stop.
Can't reproduce it. It works in all kinds of variants (relative and
absolute O=, clean and not clean trees, etc). Jiri, please check as
well.
Odd, this reproduces for me on a completely clean checkout of bpf-next:
$ git clone --depth=1 https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/
$ cd bpf-next
$ make -s O=build distclean
../../scripts/Makefile.include:4: *** O=/tmp/bpf-next/build/tools/bpf/resolve_btfids does not exist. Stop.
I do not really see how this could be environment related. It seems like
this comes from tools/scripts/Makefile.include, where there is no
guarantee that $(O) is created before being used like in the main
Makefile?
right, we need to handle the case where tools/bpf/resolve_btfids
does not exist, patch below fixes it for me
jirka
Yes, this seems to work fine for me as well.
Tested-by: Nathan Chancellor <nathan@kernel.org>
@@ -1088,8 +1088,14 @@ endifPHONY+=resolve_btfids_clean+resolve_btfids_O=$(abspath$(objtree))/tools/bpf/resolve_btfids++# tools/bpf/resolve_btfids directory might not exist+# in output directory, skip its clean in that caseresolve_btfids_clean:-$(Q)$(MAKE)-sC$(srctree)/tools/bpf/resolve_btfidsO=$(abspath$(objtree))/tools/bpf/resolve_btfidsclean+ifneq (,$(wildcard $(resolve_btfids_O)))+$(Q)$(MAKE)-sC$(srctree)/tools/bpf/resolve_btfidsO=$(resolve_btfids_O)clean+endififdef CONFIG_BPFifdef CONFIG_DEBUG_INFO_BTF
On Wed, Feb 10, 2021 at 10:02 AM Nathan Chancellor [off-list ref] wrote:
On Wed, Feb 10, 2021 at 09:52:42AM -0800, Andrii Nakryiko wrote:
quoted
On Wed, Feb 10, 2021 at 9:47 AM Nathan Chancellor [off-list ref] wrote:
quoted
On Fri, Feb 05, 2021 at 01:40:20PM +0100, Jiri Olsa wrote:
quoted
The resolve_btfids tool is used during the kernel build,
so we should clean it on kernel's make clean.
Invoking the the resolve_btfids clean as part of root
'make clean'.
Acked-by: Song Liu <redacted>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
Makefile | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
@@ -1495,7 +1500,7 @@ vmlinuxclean:$(Q)$(CONFIG_SHELL)$(srctree)/scripts/link-vmlinux.shclean$(Q)$(if$(ARCH_POSTLINK),$(MAKE)-f$(ARCH_POSTLINK)clean)-clean:archcleanvmlinuxclean+clean:archcleanvmlinuxcleanresolve_btfids_clean# mrproper - Delete all generated files, including .config#--
2.26.2
This breaks running distclean on a clean tree (my script just
unconditionally runs distclean regardless of the tree state):
$ make -s O=build distclean
../../scripts/Makefile.include:4: *** O=/home/nathan/cbl/src/linux-next/build/tools/bpf/resolve_btfids does not exist. Stop.
Can't reproduce it. It works in all kinds of variants (relative and
absolute O=, clean and not clean trees, etc). Jiri, please check as
well.
Odd, this reproduces for me on a completely clean checkout of bpf-next:
my bad, I was trying it on a branch that didn't have Jiri's patches,
sorry about that.
$ git clone --depth=1 https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/
$ cd bpf-next
$ make -s O=build distclean
../../scripts/Makefile.include:4: *** O=/tmp/bpf-next/build/tools/bpf/resolve_btfids does not exist. Stop.
I do not really see how this could be environment related. It seems like
this comes from tools/scripts/Makefile.include, where there is no
guarantee that $(O) is created before being used like in the main
Makefile?
Cheers,
Nathan
On Wed, Feb 10, 2021 at 10:29 AM Jiri Olsa [off-list ref] wrote:
On Wed, Feb 10, 2021 at 11:02:15AM -0700, Nathan Chancellor wrote:
quoted
On Wed, Feb 10, 2021 at 09:52:42AM -0800, Andrii Nakryiko wrote:
quoted
On Wed, Feb 10, 2021 at 9:47 AM Nathan Chancellor [off-list ref] wrote:
quoted
On Fri, Feb 05, 2021 at 01:40:20PM +0100, Jiri Olsa wrote:
quoted
The resolve_btfids tool is used during the kernel build,
so we should clean it on kernel's make clean.
Invoking the the resolve_btfids clean as part of root
'make clean'.
Acked-by: Song Liu <redacted>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
Makefile | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
@@ -1495,7 +1500,7 @@ vmlinuxclean:$(Q)$(CONFIG_SHELL)$(srctree)/scripts/link-vmlinux.shclean$(Q)$(if$(ARCH_POSTLINK),$(MAKE)-f$(ARCH_POSTLINK)clean)-clean:archcleanvmlinuxclean+clean:archcleanvmlinuxcleanresolve_btfids_clean# mrproper - Delete all generated files, including .config#--
2.26.2
This breaks running distclean on a clean tree (my script just
unconditionally runs distclean regardless of the tree state):
$ make -s O=build distclean
../../scripts/Makefile.include:4: *** O=/home/nathan/cbl/src/linux-next/build/tools/bpf/resolve_btfids does not exist. Stop.
Can't reproduce it. It works in all kinds of variants (relative and
absolute O=, clean and not clean trees, etc). Jiri, please check as
well.
Odd, this reproduces for me on a completely clean checkout of bpf-next:
$ git clone --depth=1 https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/
$ cd bpf-next
$ make -s O=build distclean
../../scripts/Makefile.include:4: *** O=/tmp/bpf-next/build/tools/bpf/resolve_btfids does not exist. Stop.
I do not really see how this could be environment related. It seems like
this comes from tools/scripts/Makefile.include, where there is no
guarantee that $(O) is created before being used like in the main
Makefile?
right, we need to handle the case where tools/bpf/resolve_btfids
does not exist, patch below fixes it for me
jirka
Looks good to me, please send it as a proper patch to bpf-next.
But I'm curious, why is objtool not doing something like that? Is it
not doing clean at all? Or does it do it in some different way?
@@ -1088,8 +1088,14 @@ endifPHONY+=resolve_btfids_clean+resolve_btfids_O=$(abspath$(objtree))/tools/bpf/resolve_btfids++# tools/bpf/resolve_btfids directory might not exist+# in output directory, skip its clean in that caseresolve_btfids_clean:-$(Q)$(MAKE)-sC$(srctree)/tools/bpf/resolve_btfidsO=$(abspath$(objtree))/tools/bpf/resolve_btfidsclean+ifneq (,$(wildcard $(resolve_btfids_O)))
nit: kind of backwards, usually it's in a `ifneq($var,)` form
From: Jiri Olsa <hidden> Date: 2021-02-11 12:21:51
On Wed, Feb 10, 2021 at 11:26:28AM -0800, Andrii Nakryiko wrote:
SNIP
quoted
quoted
quoted
Can't reproduce it. It works in all kinds of variants (relative and
absolute O=, clean and not clean trees, etc). Jiri, please check as
well.
Odd, this reproduces for me on a completely clean checkout of bpf-next:
$ git clone --depth=1 https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/
$ cd bpf-next
$ make -s O=build distclean
../../scripts/Makefile.include:4: *** O=/tmp/bpf-next/build/tools/bpf/resolve_btfids does not exist. Stop.
I do not really see how this could be environment related. It seems like
this comes from tools/scripts/Makefile.include, where there is no
guarantee that $(O) is created before being used like in the main
Makefile?
right, we need to handle the case where tools/bpf/resolve_btfids
does not exist, patch below fixes it for me
jirka
Looks good to me, please send it as a proper patch to bpf-next.
But I'm curious, why is objtool not doing something like that? Is it
not doing clean at all? Or does it do it in some different way?
@@ -1088,8 +1088,14 @@ endifPHONY+=resolve_btfids_clean+resolve_btfids_O=$(abspath$(objtree))/tools/bpf/resolve_btfids++# tools/bpf/resolve_btfids directory might not exist+# in output directory, skip its clean in that caseresolve_btfids_clean:-$(Q)$(MAKE)-sC$(srctree)/tools/bpf/resolve_btfidsO=$(abspath$(objtree))/tools/bpf/resolve_btfidsclean+ifneq (,$(wildcard $(resolve_btfids_O)))
nit: kind of backwards, usually it's in a `ifneq($var,)` form
On Thu, Feb 11, 2021 at 9:17 PM Jiri Olsa [off-list ref] wrote:
On Wed, Feb 10, 2021 at 11:26:28AM -0800, Andrii Nakryiko wrote:
SNIP
quoted
quoted
quoted
quoted
Can't reproduce it. It works in all kinds of variants (relative and
absolute O=, clean and not clean trees, etc). Jiri, please check as
well.
Odd, this reproduces for me on a completely clean checkout of bpf-next:
$ git clone --depth=1 https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/
$ cd bpf-next
$ make -s O=build distclean
../../scripts/Makefile.include:4: *** O=/tmp/bpf-next/build/tools/bpf/resolve_btfids does not exist. Stop.
I do not really see how this could be environment related. It seems like
this comes from tools/scripts/Makefile.include, where there is no
guarantee that $(O) is created before being used like in the main
Makefile?
right, we need to handle the case where tools/bpf/resolve_btfids
does not exist, patch below fixes it for me
jirka
Looks good to me, please send it as a proper patch to bpf-next.
But I'm curious, why is objtool not doing something like that? Is it
not doing clean at all? Or does it do it in some different way?
@@ -1088,8 +1088,14 @@ endifPHONY+=resolve_btfids_clean+resolve_btfids_O=$(abspath$(objtree))/tools/bpf/resolve_btfids++# tools/bpf/resolve_btfids directory might not exist+# in output directory, skip its clean in that caseresolve_btfids_clean:-$(Q)$(MAKE)-sC$(srctree)/tools/bpf/resolve_btfidsO=$(abspath$(objtree))/tools/bpf/resolve_btfidsclean+ifneq (,$(wildcard $(resolve_btfids_O)))
nit: kind of backwards, usually it's in a `ifneq($var,)` form
ok
thanks,
jirka
I expected this kind of mess
when I saw 33a57ce0a54d498275f432db04850001175dfdfa
The tools/ directory is a completely different world
governed by a different build system
(no, not a build system, but a collection of adhoc makefile code)
All the other programs used during the kernel build
are located under scripts/, and can be built with
a simple syntax, and cleaned up correctly.
It is simple, clean and robust.
objtool is the first alien that opt out Kbuild,
and this is the second one.
It is scary to mix up two different things,
which run in different working directories.
See, this is wired up in the top Makefile
in an ugly way, and you are struggling
in suppressing issues, where you can never
do it in the right way.
--
Best Regards
Masahiro Yamada
From: Jiri Olsa <hidden> Date: 2021-02-12 13:37:15
On Fri, Feb 12, 2021 at 12:30:45PM +0900, Masahiro Yamada wrote:
SNIP
I expected this kind of mess
when I saw 33a57ce0a54d498275f432db04850001175dfdfa
The tools/ directory is a completely different world
governed by a different build system
(no, not a build system, but a collection of adhoc makefile code)
All the other programs used during the kernel build
are located under scripts/, and can be built with
a simple syntax, and cleaned up correctly.
It is simple, clean and robust.
objtool is the first alien that opt out Kbuild,
and this is the second one.
It is scary to mix up two different things,
which run in different working directories.
would you see any way out? apart from changing resolve_btfids
to use Kbuild.. there are some dependencies we'd need to change
as well and they are used by other tools.. probably it'd end up
with all or nothing scenario
See, this is wired up in the top Makefile
in an ugly way, and you are struggling
in suppressing issues, where you can never
do it in the right way.
maybe we could move it out of top makefile into separate one,
that would handle all the related mess
jirka
From: Viktor Jägersküpper <hidden> Date: 2021-03-10 17:35:08
Hi,
Setting up separate build directories for libbpf and libpsubcmd,
so it's separated from other objects and we don't get them mixed
in the future.
It also simplifies cleaning, which is now simple rm -rf.
Also there's no need for FEATURE-DUMP.libbpf and bpf_helper_defs.h
files in .gitignore anymore.
Acked-by: Song Liu <redacted>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
when I invoke 'git status' on the master branch of my local git repository
(cloned from stable/linux.git), which I have used to compile several kernels,
it lists two untracked files:
tools/bpf/resolve_btfids/FEATURE-DUMP.libbpf
tools/bpf/resolve_btfids/bpf_helper_defs.h
'git status' doesn't complain about these files with v5.11, and I can't get rid
of them by 'make clean' with v5.11 or v5.12-rc1/rc2. So I used 'git bisect' and
found that this is caused by commit fc6b48f692f89cc48bfb7fd1aa65454dfe9b2d77,
which links to this thread.
Looking at the diff it's obvious because of the change in the .gitignore file,
but I don't know why these files are there and I have never touched anything in
the 'tools' directory.
Can I savely delete the files? Do I even have to delete them before I compile
v5.12-rcX?
Thanks,
Viktor
On Wed, Mar 10, 2021 at 9:35 AM Viktor Jägersküpper
[off-list ref] wrote:
Hi,
quoted
Setting up separate build directories for libbpf and libpsubcmd,
so it's separated from other objects and we don't get them mixed
in the future.
It also simplifies cleaning, which is now simple rm -rf.
Also there's no need for FEATURE-DUMP.libbpf and bpf_helper_defs.h
files in .gitignore anymore.
Acked-by: Song Liu <redacted>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
when I invoke 'git status' on the master branch of my local git repository
(cloned from stable/linux.git), which I have used to compile several kernels,
it lists two untracked files:
tools/bpf/resolve_btfids/FEATURE-DUMP.libbpf
tools/bpf/resolve_btfids/bpf_helper_defs.h
'git status' doesn't complain about these files with v5.11, and I can't get rid
of them by 'make clean' with v5.11 or v5.12-rc1/rc2. So I used 'git bisect' and
found that this is caused by commit fc6b48f692f89cc48bfb7fd1aa65454dfe9b2d77,
which links to this thread.
Looking at the diff it's obvious because of the change in the .gitignore file,
but I don't know why these files are there and I have never touched anything in
the 'tools' directory.
Can I savely delete the files? Do I even have to delete them before I compile
v5.12-rcX?
yes, those were auto-generated files. You can safely remove them.
From: Jiri Olsa <hidden> Date: 2021-03-10 22:43:35
On Wed, Mar 10, 2021 at 11:27:19AM -0800, Andrii Nakryiko wrote:
On Wed, Mar 10, 2021 at 9:35 AM Viktor Jägersküpper
[off-list ref] wrote:
quoted
Hi,
quoted
Setting up separate build directories for libbpf and libpsubcmd,
so it's separated from other objects and we don't get them mixed
in the future.
It also simplifies cleaning, which is now simple rm -rf.
Also there's no need for FEATURE-DUMP.libbpf and bpf_helper_defs.h
files in .gitignore anymore.
Acked-by: Song Liu <redacted>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
when I invoke 'git status' on the master branch of my local git repository
(cloned from stable/linux.git), which I have used to compile several kernels,
it lists two untracked files:
tools/bpf/resolve_btfids/FEATURE-DUMP.libbpf
tools/bpf/resolve_btfids/bpf_helper_defs.h
'git status' doesn't complain about these files with v5.11, and I can't get rid
of them by 'make clean' with v5.11 or v5.12-rc1/rc2. So I used 'git bisect' and
found that this is caused by commit fc6b48f692f89cc48bfb7fd1aa65454dfe9b2d77,
which links to this thread.
Looking at the diff it's obvious because of the change in the .gitignore file,
but I don't know why these files are there and I have never touched anything in
the 'tools' directory.
Can I savely delete the files? Do I even have to delete them before I compile
v5.12-rcX?
yes, those were auto-generated files. You can safely remove them.
hm, I answered this email, but for some reason I can't see it on
lore.. FWIW, trying once more ;-)
hi,
yes, you can delete them, this patch moved libbpf and libsubcmd
into their own build directories, so those 2 files stayed there
from your last build without the patch
jirka