Subject: Re: ppc64le: ftrace self-tests and $(CC_FLAGS_FTRACE) broken?

From: Joe Lawrence <[email-masked]>
Date: Sat, 23 Mar 2019 13:01:14 -0400

On Sat, Mar 23, 2019 at 12:17:32PM -0400, Steven Rostedt wrote:
> On Sat, 23 Mar 2019 09:19:50 -0400
> Joe Lawrence <[email-masked]> wrote:
> 
> > Perhaps this is gcc version specific?  I didn't see any other reports,
> > so maybe its specific to my config.  If I run make V=1, I can see that
> > gcc is called with '-pg -mprofile-kernel', but then the record_mcount
> > script is skipped.  Any ideas?
> 
> But you see it running the script if you remove that commit? Do you
> happen to see -mrecord-mcount at all in a V=1 make?
> 

Hey Steve,

Here's a diff of output from 'make V=1 kernel/trace/trace_selftest_dynamic.o' 
with stock v5.0 vs. v5.0 and that commit reverted.  The part that I
think is interesting is where it decides to invoke recordmcount.pl

I can send or pastebin the entire output from make if that is easier to
read.

-- Joe

--- v5.0.out	2019-03-23 12:54:09.540042581 -0400
+++ v5.0-revert.out	2019-03-23 12:53:05.253264482 -0400
@@ -20,29 +20,18 @@ make -f ./scripts/Makefile.build obj=scr
 make -f ./scripts/Makefile.build obj=scripts/selinux/genheaders need-builtin=
 make -f ./scripts/Makefile.build obj=scripts/selinux/mdp need-builtin=
 make -f ./scripts/Makefile.build obj=scripts/mod
-  scripts/mod/mk_elfconfig < scripts/mod/empty.o > scripts/mod/elfconfig.h
-  gcc -Wp,-MD,scripts/mod/.modpost.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89       -c -o scripts/mod/modpost.o scripts/mod/modpost.c
 set -e; mkdir -p scripts/mod/; { 	 echo "#ifndef __DEVICETABLE_OFFSETS_H__"; echo "#define __DEVICETABLE_OFFSETS_H__"; echo "/*"; echo " * DO NOT MODIFY."; echo " *"; echo " * This file was generated by Kbuild"; echo " */"; echo ""; sed -ne 	's:^[[:space:]]*\.ascii[[:space:]]*"\(.*\)".*:\1:; /^->/{s:->#\(.*\):/* \1 */:; s:^->\([^ ]*\) [\$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}' < scripts/mod/devicetable-offsets.s; echo ""; echo "#endif"; } > scripts/mod/devicetable-offsets.h.tmp; if [ -r scripts/mod/devicetable-offsets.h ] && cmp -s scripts/mod/devicetable-offsets.h scripts/mod/devicetable-offsets.h.tmp; then rm -f scripts/mod/devicetable-offsets.h.tmp; else : '  UPD     scripts/mod/devicetable-offsets.h'; mv -f scripts/mod/devicetable-offsets.h.tmp scripts/mod/devicetable-offsets.h; fi
-  gcc -Wp,-MD,scripts/mod/.file2alias.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89       -c -o scripts/mod/file2alias.o scripts/mod/file2alias.c
-  gcc -Wp,-MD,scripts/mod/.sumversion.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89       -c -o scripts/mod/sumversion.o scripts/mod/sumversion.c
-  gcc   -o scripts/mod/modpost scripts/mod/modpost.o scripts/mod/file2alias.o scripts/mod/sumversion.o   
 make -f ./scripts/Makefile.build obj=.
 set -e; mkdir -p include/generated/; { 	 echo "#ifndef __LINUX_BOUNDS_H__"; echo "#define __LINUX_BOUNDS_H__"; echo "/*"; echo " * DO NOT MODIFY."; echo " *"; echo " * This file was generated by Kbuild"; echo " */"; echo ""; sed -ne 	's:^[[:space:]]*\.ascii[[:space:]]*"\(.*\)".*:\1:; /^->/{s:->#\(.*\):/* \1 */:; s:^->\([^ ]*\) [\$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}' < kernel/bounds.s; echo ""; echo "#endif"; } > include/generated/bounds.h.tmp; if [ -r include/generated/bounds.h ] && cmp -s include/generated/bounds.h include/generated/bounds.h.tmp; then rm -f include/generated/bounds.h.tmp; else : '  UPD     include/generated/bounds.h'; mv -f include/generated/bounds.h.tmp include/generated/bounds.h; fi
 set -e; mkdir -p include/generated/; { echo 100 | bc -q kernel/time/timeconst.bc; } > include/generated/timeconst.h.tmp; if [ -r include/generated/timeconst.h ] && cmp -s include/generated/timeconst.h include/generated/timeconst.h.tmp; then rm -f include/generated/timeconst.h.tmp; else : '  UPD     include/generated/timeconst.h'; mv -f include/generated/timeconst.h.tmp include/generated/timeconst.h; fi
 set -e; mkdir -p include/generated/; { 	 echo "#ifndef __ASM_OFFSETS_H__"; echo "#define __ASM_OFFSETS_H__"; echo "/*"; echo " * DO NOT MODIFY."; echo " *"; echo " * This file was generated by Kbuild"; echo " */"; echo ""; sed -ne 	's:^[[:space:]]*\.ascii[[:space:]]*"\(.*\)".*:\1:; /^->/{s:->#\(.*\):/* \1 */:; s:^->\([^ ]*\) [\$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}' < arch/powerpc/kernel/asm-offsets.s; echo ""; echo "#endif"; } > include/generated/asm-offsets.h.tmp; if [ -r include/generated/asm-offsets.h ] && cmp -s include/generated/asm-offsets.h include/generated/asm-offsets.h.tmp; then rm -f include/generated/asm-offsets.h.tmp; else : '  UPD     include/generated/asm-offsets.h'; mv -f include/generated/asm-offsets.h.tmp include/generated/asm-offsets.h; fi
 <stdin>:1478:2: warning: #warning syscall pidfd_send_signal not implemented [-Wcpp]
 <stdin>:1481:2: warning: #warning syscall io_uring_setup not implemented [-Wcpp]
 <stdin>:1484:2: warning: #warning syscall io_uring_enter not implemented [-Wcpp]
 <stdin>:1487:2: warning: #warning syscall io_uring_register not implemented [-Wcpp]
   /bin/sh scripts/atomic/check-atomics.sh
 make -f ./scripts/Makefile.build obj=kernel/trace kernel/trace/trace_selftest_dynamic.o