* [PATCH] rtla: Fix Makefile when called from -C tools/
@ 2022-07-08 12:17 Daniel Bristot de Oliveira
2022-07-10 8:40 ` Sedat Dilek
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Bristot de Oliveira @ 2022-07-08 12:17 UTC (permalink / raw)
To: linux-kernel, linux-trace-devel
Cc: Daniel Bristot de Oliveira, Steven Rostedt, Sedat Dilek
Sedat Dilek reported an error on rtla Makefile when running:
$ make -C tools/
[...]
make[2]: Entering directory
'/home/dileks/src/linux-kernel/git/tools/tracing/rtla'
[...]
'/home/dileks/src/linux-kernel/git/Documentation/tools/rtla'
/bin/sh: 1: test: rtla-make[2]:: unexpected operator <------ The problem
rm: cannot remove '/home/dileks/src/linux-kernel/git': Is a directory
make[2]: *** [Makefile:120: clean] Error 1
make[2]: Leaving directory
This occurred because the rtla calls kernel's Makefile to get the
version in silence mode, e.g.,
$ make -sC ../../.. kernelversion
5.19.0-rc4
But the -s is being ignored when rtla's makefile is called from indirectly,
so the output looks like:
$ make -C ../../.. kernelversion
make: Entering directory '/root/linux'
5.19.0-rc4
make: Leaving directory '/root/linux'
'grep -v make' to avoid this problem, e.g.,
$ make -C ../../.. kernelversion | grep -v make
5.19.0-rc4
Cc: Steven Rostedt <rostedt@goodmis.org>
Fixes: 8619e32825fd ("rtla: Follow kernel version")
Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
---
tools/tracing/rtla/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/tracing/rtla/Makefile b/tools/tracing/rtla/Makefile
index 3822f4ea5f49..1bea2d16d4c1 100644
--- a/tools/tracing/rtla/Makefile
+++ b/tools/tracing/rtla/Makefile
@@ -1,6 +1,6 @@
NAME := rtla
# Follow the kernel version
-VERSION := $(shell cat VERSION 2> /dev/null || make -sC ../../.. kernelversion)
+VERSION := $(shell cat VERSION 2> /dev/null || make -sC ../../.. kernelversion | grep -v make)
# From libtracefs:
# Makefiles suck: This macro sets a default value of $(2) for the
--
2.32.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] rtla: Fix Makefile when called from -C tools/
2022-07-08 12:17 [PATCH] rtla: Fix Makefile when called from -C tools/ Daniel Bristot de Oliveira
@ 2022-07-10 8:40 ` Sedat Dilek
2022-07-13 20:32 ` Steven Rostedt
2022-07-13 21:32 ` Daniel Bristot de Oliveira
0 siblings, 2 replies; 4+ messages in thread
From: Sedat Dilek @ 2022-07-10 8:40 UTC (permalink / raw)
To: Daniel Bristot de Oliveira
Cc: linux-kernel, linux-trace-devel, Steven Rostedt
On Fri, Jul 8, 2022 at 2:17 PM Daniel Bristot de Oliveira
<bristot@kernel.org> wrote:
>
> Sedat Dilek reported an error on rtla Makefile when running:
>
Hi Daniel,
Thanks for the patch.
> $ make -C tools/
No, that was with...
$ make -C tools/ clean
> [...]
> make[2]: Entering directory
> '/home/dileks/src/linux-kernel/git/tools/tracing/rtla'
> [...]
> '/home/dileks/src/linux-kernel/git/Documentation/tools/rtla'
> /bin/sh: 1: test: rtla-make[2]:: unexpected operator <------ The problem
> rm: cannot remove '/home/dileks/src/linux-kernel/git': Is a directory
> make[2]: *** [Makefile:120: clean] Error 1
> make[2]: Leaving directory
>
> This occurred because the rtla calls kernel's Makefile to get the
> version in silence mode, e.g.,
>
> $ make -sC ../../.. kernelversion
> 5.19.0-rc4
>
> But the -s is being ignored when rtla's makefile is called from indirectly,
> so the output looks like:
>
> $ make -C ../../.. kernelversion
> make: Entering directory '/root/linux'
> 5.19.0-rc4
> make: Leaving directory '/root/linux'
>
> 'grep -v make' to avoid this problem, e.g.,
>
Missing word at the beginning soething like:
Use 'grep -v make' to avoid this problem ...
> $ make -C ../../.. kernelversion | grep -v make
> 5.19.0-rc4
>
Shouldn't that be:
$ make -sC ... (missing "s")
Regards,
-Sedat-
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Fixes: 8619e32825fd ("rtla: Follow kernel version")
> Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
> Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
> Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
> ---
> tools/tracing/rtla/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/tracing/rtla/Makefile b/tools/tracing/rtla/Makefile
> index 3822f4ea5f49..1bea2d16d4c1 100644
> --- a/tools/tracing/rtla/Makefile
> +++ b/tools/tracing/rtla/Makefile
> @@ -1,6 +1,6 @@
> NAME := rtla
> # Follow the kernel version
> -VERSION := $(shell cat VERSION 2> /dev/null || make -sC ../../.. kernelversion)
> +VERSION := $(shell cat VERSION 2> /dev/null || make -sC ../../.. kernelversion | grep -v make)
>
> # From libtracefs:
> # Makefiles suck: This macro sets a default value of $(2) for the
> --
> 2.32.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rtla: Fix Makefile when called from -C tools/
2022-07-10 8:40 ` Sedat Dilek
@ 2022-07-13 20:32 ` Steven Rostedt
2022-07-13 21:32 ` Daniel Bristot de Oliveira
1 sibling, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2022-07-13 20:32 UTC (permalink / raw)
To: Sedat Dilek; +Cc: Daniel Bristot de Oliveira, linux-kernel, linux-trace-devel
On Sun, 10 Jul 2022 10:40:47 +0200
Sedat Dilek <sedat.dilek@gmail.com> wrote:
> On Fri, Jul 8, 2022 at 2:17 PM Daniel Bristot de Oliveira
> <bristot@kernel.org> wrote:
> >
> > Sedat Dilek reported an error on rtla Makefile when running:
> >
>
> Hi Daniel,
>
> Thanks for the patch.
>
> > $ make -C tools/
>
> No, that was with...
>
> $ make -C tools/ clean
>
> > [...]
> > make[2]: Entering directory
> > '/home/dileks/src/linux-kernel/git/tools/tracing/rtla'
> > [...]
> > '/home/dileks/src/linux-kernel/git/Documentation/tools/rtla'
> > /bin/sh: 1: test: rtla-make[2]:: unexpected operator <------ The problem
> > rm: cannot remove '/home/dileks/src/linux-kernel/git': Is a directory
> > make[2]: *** [Makefile:120: clean] Error 1
> > make[2]: Leaving directory
> >
> > This occurred because the rtla calls kernel's Makefile to get the
> > version in silence mode, e.g.,
> >
> > $ make -sC ../../.. kernelversion
> > 5.19.0-rc4
> >
> > But the -s is being ignored when rtla's makefile is called from indirectly,
> > so the output looks like:
> >
> > $ make -C ../../.. kernelversion
> > make: Entering directory '/root/linux'
> > 5.19.0-rc4
> > make: Leaving directory '/root/linux'
> >
> > 'grep -v make' to avoid this problem, e.g.,
> >
>
> Missing word at the beginning soething like:
>
> Use 'grep -v make' to avoid this problem ...
>
> > $ make -C ../../.. kernelversion | grep -v make
> > 5.19.0-rc4
> >
>
> Shouldn't that be:
>
> $ make -sC ... (missing "s")
Hi Daniel,
Any response to Sedat's comments? I'm holding off sending the rtla branch
to Linus waiting for an update to this patch.
-- Steve
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rtla: Fix Makefile when called from -C tools/
2022-07-10 8:40 ` Sedat Dilek
2022-07-13 20:32 ` Steven Rostedt
@ 2022-07-13 21:32 ` Daniel Bristot de Oliveira
1 sibling, 0 replies; 4+ messages in thread
From: Daniel Bristot de Oliveira @ 2022-07-13 21:32 UTC (permalink / raw)
To: sedat.dilek; +Cc: linux-kernel, linux-trace-devel, Steven Rostedt
On 7/10/22 10:40, Sedat Dilek wrote:
Fixing the other comments in the v2... and
>> $ make -C ../../.. kernelversion | grep -v make
>> 5.19.0-rc4
>>
> Shouldn't that be:
>
> $ make -sC ... (missing "s")
I did not add the -s here to show that the | grep -v make fixes the problem
when the -s is ignored/bypassed (the cause of this bug).
Sending the v2
(Sorry for the delay Steven)
-- Daniel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-07-13 21:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-08 12:17 [PATCH] rtla: Fix Makefile when called from -C tools/ Daniel Bristot de Oliveira
2022-07-10 8:40 ` Sedat Dilek
2022-07-13 20:32 ` Steven Rostedt
2022-07-13 21:32 ` Daniel Bristot de Oliveira
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).