diff mbox series

[RFC,v2,5/7] objtool: Enable objtool to run only on files with ftrace enabled

Message ID cf3013dfad89ad5ac7d16d56dced72d7c138a20e.1653398233.git.christophe.leroy@csgroup.eu (mailing list archive)
State Superseded
Headers show
Series objtool: Enable and implement --mcount option on powerpc | expand

Commit Message

Christophe Leroy May 24, 2022, 1:17 p.m. UTC
From: Sathvika Vasireddy <sv@linux.ibm.com>

This patch makes sure objtool runs only on the object files
that have ftrace enabled, instead of running on all the object
files.

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Sathvika Vasireddy <sv@linux.ibm.com>
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 scripts/Makefile.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Peter Zijlstra May 24, 2022, 6:01 p.m. UTC | #1
On Tue, May 24, 2022 at 03:17:45PM +0200, Christophe Leroy wrote:
> From: Sathvika Vasireddy <sv@linux.ibm.com>
> 
> This patch makes sure objtool runs only on the object files
> that have ftrace enabled, instead of running on all the object
> files.
> 
> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> Signed-off-by: Sathvika Vasireddy <sv@linux.ibm.com>
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
>  scripts/Makefile.build | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index 2e0c3f9c1459..06ceffd92921 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -258,8 +258,8 @@ else
>  # 'OBJECT_FILES_NON_STANDARD_foo.o := 'y': skip objtool checking for a file
>  # 'OBJECT_FILES_NON_STANDARD_foo.o := 'n': override directory skip for a file
>  
> -$(obj)/%.o: objtool-enabled = $(if $(filter-out y%, \
> -	$(OBJECT_FILES_NON_STANDARD_$(basetarget).o)$(OBJECT_FILES_NON_STANDARD)n),y)
> +$(obj)/%.o: objtool-enabled = $(and $(if $(filter-out y%, $(OBJECT_FILES_NON_STANDARD_$(basetarget).o)$(OBJECT_FILES_NON_STANDARD)n),y),        \
> +        $(if $(findstring $(strip $(CC_FLAGS_FTRACE)),$(_c_flags)),y),y)

I think this breaks x86, quite a bit of files have ftrace disabled but
very much must run objtool anyway.
Peter Zijlstra May 24, 2022, 6:02 p.m. UTC | #2
On Tue, May 24, 2022 at 08:01:39PM +0200, Peter Zijlstra wrote:
> On Tue, May 24, 2022 at 03:17:45PM +0200, Christophe Leroy wrote:
> > From: Sathvika Vasireddy <sv@linux.ibm.com>
> > 
> > This patch makes sure objtool runs only on the object files
> > that have ftrace enabled, instead of running on all the object
> > files.
> > 
> > Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> > Signed-off-by: Sathvika Vasireddy <sv@linux.ibm.com>
> > Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> > ---
> >  scripts/Makefile.build | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> > index 2e0c3f9c1459..06ceffd92921 100644
> > --- a/scripts/Makefile.build
> > +++ b/scripts/Makefile.build
> > @@ -258,8 +258,8 @@ else
> >  # 'OBJECT_FILES_NON_STANDARD_foo.o := 'y': skip objtool checking for a file
> >  # 'OBJECT_FILES_NON_STANDARD_foo.o := 'n': override directory skip for a file
> >  
> > -$(obj)/%.o: objtool-enabled = $(if $(filter-out y%, \
> > -	$(OBJECT_FILES_NON_STANDARD_$(basetarget).o)$(OBJECT_FILES_NON_STANDARD)n),y)
> > +$(obj)/%.o: objtool-enabled = $(and $(if $(filter-out y%, $(OBJECT_FILES_NON_STANDARD_$(basetarget).o)$(OBJECT_FILES_NON_STANDARD)n),y),        \
> > +        $(if $(findstring $(strip $(CC_FLAGS_FTRACE)),$(_c_flags)),y),y)
> 
> I think this breaks x86, quite a bit of files have ftrace disabled but
> very much must run objtool anyway.

Also; since the Changelog gives 0 clue as to what problem it's trying to
solve, I can't suggest anything.
Christophe Leroy May 24, 2022, 6:59 p.m. UTC | #3
Le 24/05/2022 à 20:02, Peter Zijlstra a écrit :
> On Tue, May 24, 2022 at 08:01:39PM +0200, Peter Zijlstra wrote:
>> On Tue, May 24, 2022 at 03:17:45PM +0200, Christophe Leroy wrote:
>>> From: Sathvika Vasireddy <sv@linux.ibm.com>
>>>
>>> This patch makes sure objtool runs only on the object files
>>> that have ftrace enabled, instead of running on all the object
>>> files.
>>>
>>> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
>>> Signed-off-by: Sathvika Vasireddy <sv@linux.ibm.com>
>>> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>>> ---
>>>   scripts/Makefile.build | 4 ++--
>>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
>>> index 2e0c3f9c1459..06ceffd92921 100644
>>> --- a/scripts/Makefile.build
>>> +++ b/scripts/Makefile.build
>>> @@ -258,8 +258,8 @@ else
>>>   # 'OBJECT_FILES_NON_STANDARD_foo.o := 'y': skip objtool checking for a file
>>>   # 'OBJECT_FILES_NON_STANDARD_foo.o := 'n': override directory skip for a file
>>>   
>>> -$(obj)/%.o: objtool-enabled = $(if $(filter-out y%, \
>>> -	$(OBJECT_FILES_NON_STANDARD_$(basetarget).o)$(OBJECT_FILES_NON_STANDARD)n),y)
>>> +$(obj)/%.o: objtool-enabled = $(and $(if $(filter-out y%, $(OBJECT_FILES_NON_STANDARD_$(basetarget).o)$(OBJECT_FILES_NON_STANDARD)n),y),        \
>>> +        $(if $(findstring $(strip $(CC_FLAGS_FTRACE)),$(_c_flags)),y),y)
>>
>> I think this breaks x86, quite a bit of files have ftrace disabled but
>> very much must run objtool anyway.
> 
> Also; since the Changelog gives 0 clue as to what problem it's trying to
> solve, I can't suggest anything.

I asked Sathvika on the previous series, see 
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20220523175548.922671-3-sv@linux.ibm.com/

He says it is to solve the problem I reported at 
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20220318105140.43914-4-sv@linux.ibm.com/#2861128

Christophe
Peter Zijlstra May 24, 2022, 7:50 p.m. UTC | #4
On Tue, May 24, 2022 at 06:59:50PM +0000, Christophe Leroy wrote:
> 
> 
> Le 24/05/2022 à 20:02, Peter Zijlstra a écrit :
> > On Tue, May 24, 2022 at 08:01:39PM +0200, Peter Zijlstra wrote:
> >> On Tue, May 24, 2022 at 03:17:45PM +0200, Christophe Leroy wrote:
> >>> From: Sathvika Vasireddy <sv@linux.ibm.com>
> >>>
> >>> This patch makes sure objtool runs only on the object files
> >>> that have ftrace enabled, instead of running on all the object
> >>> files.
> >>>
> >>> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> >>> Signed-off-by: Sathvika Vasireddy <sv@linux.ibm.com>
> >>> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> >>> ---
> >>>   scripts/Makefile.build | 4 ++--
> >>>   1 file changed, 2 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> >>> index 2e0c3f9c1459..06ceffd92921 100644
> >>> --- a/scripts/Makefile.build
> >>> +++ b/scripts/Makefile.build
> >>> @@ -258,8 +258,8 @@ else
> >>>   # 'OBJECT_FILES_NON_STANDARD_foo.o := 'y': skip objtool checking for a file
> >>>   # 'OBJECT_FILES_NON_STANDARD_foo.o := 'n': override directory skip for a file
> >>>   
> >>> -$(obj)/%.o: objtool-enabled = $(if $(filter-out y%, \
> >>> -	$(OBJECT_FILES_NON_STANDARD_$(basetarget).o)$(OBJECT_FILES_NON_STANDARD)n),y)
> >>> +$(obj)/%.o: objtool-enabled = $(and $(if $(filter-out y%, $(OBJECT_FILES_NON_STANDARD_$(basetarget).o)$(OBJECT_FILES_NON_STANDARD)n),y),        \
> >>> +        $(if $(findstring $(strip $(CC_FLAGS_FTRACE)),$(_c_flags)),y),y)
> >>
> >> I think this breaks x86, quite a bit of files have ftrace disabled but
> >> very much must run objtool anyway.
> > 
> > Also; since the Changelog gives 0 clue as to what problem it's trying to
> > solve, I can't suggest anything.
> 
> I asked Sathvika on the previous series, see 
> https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20220523175548.922671-3-sv@linux.ibm.com/
> 
> He says it is to solve the problem I reported at 
> https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20220318105140.43914-4-sv@linux.ibm.com/#2861128

So on x86 we have:

arch/x86/entry/vdso/Makefile:OBJECT_FILES_NON_STANDARD       := y

to kill objtool for the whole of the VDSO. When we run objtool on
vmlinux it isn't a problem, because the VDSO ends up as a data section
through linker scripts.
Sathvika Vasireddy May 25, 2022, 11 a.m. UTC | #5
Hi Peter,

On 25/05/22 01:20, Peter Zijlstra wrote:
> On Tue, May 24, 2022 at 06:59:50PM +0000, Christophe Leroy wrote:
>>
>> Le 24/05/2022 à 20:02, Peter Zijlstra a écrit :
>>> On Tue, May 24, 2022 at 08:01:39PM +0200, Peter Zijlstra wrote:
>>>> On Tue, May 24, 2022 at 03:17:45PM +0200, Christophe Leroy wrote:
>>>>> From: Sathvika Vasireddy<sv@linux.ibm.com>
>>>>>
>>>>> This patch makes sure objtool runs only on the object files
>>>>> that have ftrace enabled, instead of running on all the object
>>>>> files.
>>>>>
>>>>> Signed-off-by: Naveen N. Rao<naveen.n.rao@linux.vnet.ibm.com>
>>>>> Signed-off-by: Sathvika Vasireddy<sv@linux.ibm.com>
>>>>> Signed-off-by: Christophe Leroy<christophe.leroy@csgroup.eu>
>>>>> ---
>>>>>    scripts/Makefile.build | 4 ++--
>>>>>    1 file changed, 2 insertions(+), 2 deletions(-)
>>>>>
>>>>> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
>>>>> index 2e0c3f9c1459..06ceffd92921 100644
>>>>> --- a/scripts/Makefile.build
>>>>> +++ b/scripts/Makefile.build
>>>>> @@ -258,8 +258,8 @@ else
>>>>>    # 'OBJECT_FILES_NON_STANDARD_foo.o := 'y': skip objtool checking for a file
>>>>>    # 'OBJECT_FILES_NON_STANDARD_foo.o := 'n': override directory skip for a file
>>>>>    
>>>>> -$(obj)/%.o: objtool-enabled = $(if $(filter-out y%, \
>>>>> -	$(OBJECT_FILES_NON_STANDARD_$(basetarget).o)$(OBJECT_FILES_NON_STANDARD)n),y)
>>>>> +$(obj)/%.o: objtool-enabled = $(and $(if $(filter-out y%, $(OBJECT_FILES_NON_STANDARD_$(basetarget).o)$(OBJECT_FILES_NON_STANDARD)n),y),        \
>>>>> +        $(if $(findstring $(strip $(CC_FLAGS_FTRACE)),$(_c_flags)),y),y)
>>>> I think this breaks x86, quite a bit of files have ftrace disabled but
>>>> very much must run objtool anyway.
>>> Also; since the Changelog gives 0 clue as to what problem it's trying to
>>> solve, I can't suggest anything.
>> I asked Sathvika on the previous series, see
>> https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20220523175548.922671-3-sv@linux.ibm.com/
>>
>> He says it is to solve the problem I reported at
>> https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20220318105140.43914-4-sv@linux.ibm.com/#2861128
> So on x86 we have:
>
> arch/x86/entry/vdso/Makefile:OBJECT_FILES_NON_STANDARD       := y
>
> to kill objtool for the whole of the VDSO. When we run objtool on
> vmlinux it isn't a problem, because the VDSO ends up as a data section
> through linker scripts.
Right.. Like you and Christophe mentioned,
arch/powerpc/kernel/vdso/Makefile:OBJECT_FILES_NON_STANDARD := y
should solve it for powerpc as well.


I'll drop this patch and replace it with the above change as part of next
revision series.


Thanks for reviewing!



- Sathvika
diff mbox series

Patch

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 2e0c3f9c1459..06ceffd92921 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -258,8 +258,8 @@  else
 # 'OBJECT_FILES_NON_STANDARD_foo.o := 'y': skip objtool checking for a file
 # 'OBJECT_FILES_NON_STANDARD_foo.o := 'n': override directory skip for a file
 
-$(obj)/%.o: objtool-enabled = $(if $(filter-out y%, \
-	$(OBJECT_FILES_NON_STANDARD_$(basetarget).o)$(OBJECT_FILES_NON_STANDARD)n),y)
+$(obj)/%.o: objtool-enabled = $(and $(if $(filter-out y%, $(OBJECT_FILES_NON_STANDARD_$(basetarget).o)$(OBJECT_FILES_NON_STANDARD)n),y),        \
+        $(if $(findstring $(strip $(CC_FLAGS_FTRACE)),$(_c_flags)),y),y)
 
 endif