2022-06-23 09:13:54

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH] kbuild, link-vmlinux: Don't delete output files with make -i

From: Andi Kleen <[email protected]>

make -i is useful to see output files which normally get deleted on an
error. Make this work with link-vmlinux.sh too. Don't delete the output
files on error when make -i is used.

Cc: Masahiro Yamada <[email protected]>
Cc: Michal Marek <[email protected]>
Cc: Nick Desaulniers <[email protected]>
Cc: [email protected]
Signed-off-by: Andi Kleen <[email protected]>
Signed-off-by: Jiri Slaby <[email protected]>
---
scripts/link-vmlinux.sh | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index eecc1863e556..d21759aad4f3 100755
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -193,6 +193,11 @@ sorttable()
# Delete output files in case of error
cleanup()
{
+ # don't delete for make -i
+ case "$MFLAGS" in
+ *-i*) return ;;
+ esac
+
rm -f .btf.*
rm -f System.map
rm -f vmlinux
--
2.36.1


2022-06-23 10:02:43

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH] kbuild, link-vmlinux: Don't delete output files with make -i

On 23. 06. 22, 11:45, Masahiro Yamada wrote:
> On Thu, Jun 23, 2022 at 5:31 PM Jiri Slaby <[email protected]> wrote:
>>
>> From: Andi Kleen <[email protected]>
>>
>> make -i is useful to see output files which normally get deleted on an
>> error. Make this work with link-vmlinux.sh too. Don't delete the output
>> files on error when make -i is used.
>>
>> Cc: Masahiro Yamada <[email protected]>
>> Cc: Michal Marek <[email protected]>
>> Cc: Nick Desaulniers <[email protected]>
>> Cc: [email protected]
>> Signed-off-by: Andi Kleen <[email protected]>
>> Signed-off-by: Jiri Slaby <[email protected]>
>> ---
>
>
>
> I am afraid you missed this commit:
>
>
>
> commit 51eb95e2da41802454f48b9afeb4d96a77295035
> Author: Andi Kleen <[email protected]>
> Date: Tue May 4 20:35:27 2021 -0700
>
> kbuild: Don't remove link-vmlinux temporary files on exit/signal

Oops, thanks a lot for pointing out. We are going through the Andi's LTO
patches and this went unnoticed as it was changed differently (and
rebase succeeded). Now dropped from the queue.

thanks,
--
js
suse labs

2022-06-23 10:04:02

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH] kbuild, link-vmlinux: Don't delete output files with make -i

On Thu, Jun 23, 2022 at 5:31 PM Jiri Slaby <[email protected]> wrote:
>
> From: Andi Kleen <[email protected]>
>
> make -i is useful to see output files which normally get deleted on an
> error. Make this work with link-vmlinux.sh too. Don't delete the output
> files on error when make -i is used.
>
> Cc: Masahiro Yamada <[email protected]>
> Cc: Michal Marek <[email protected]>
> Cc: Nick Desaulniers <[email protected]>
> Cc: [email protected]
> Signed-off-by: Andi Kleen <[email protected]>
> Signed-off-by: Jiri Slaby <[email protected]>
> ---



I am afraid you missed this commit:



commit 51eb95e2da41802454f48b9afeb4d96a77295035
Author: Andi Kleen <[email protected]>
Date: Tue May 4 20:35:27 2021 -0700

kbuild: Don't remove link-vmlinux temporary files on exit/signal

Keep them around until they are cleaned up by make clean. This
uses a bit more disk space, but makes it easier to debug any
problems with the kernel link process.

Suggested-by: Masahiro Yamada <[email protected]>
Signed-off-by: Andi Kleen <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>













> scripts/link-vmlinux.sh | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
> index eecc1863e556..d21759aad4f3 100755
> --- a/scripts/link-vmlinux.sh
> +++ b/scripts/link-vmlinux.sh
> @@ -193,6 +193,11 @@ sorttable()
> # Delete output files in case of error
> cleanup()
> {
> + # don't delete for make -i
> + case "$MFLAGS" in
> + *-i*) return ;;
> + esac
> +
> rm -f .btf.*
> rm -f System.map
> rm -f vmlinux
> --
> 2.36.1
>


--
Best Regards
Masahiro Yamada