[llvmlinux] [PATCH v3.10] ftrace: x86: Revert parts of 0033 patch from llvmlinux

Sedat Dilek sedat.dilek at gmail.com
Thu Jul 25 14:29:59 UTC 2013


On Thu, Jul 25, 2013 at 4:24 PM, Sedat Dilek <sedat.dilek at gmail.com> wrote:
> On Thu, Jul 25, 2013 at 4:10 PM, Jan-Simon Möller <dl9pf at gmx.de> wrote:
>> Hi Sedat,
>>
>> ok, so you just dropped 0033 and it compiles. Can you test if it works by
>> doing a simple trace ?
>>
>> If it does, I'll drop the patch then.
>>
>> Tnx.
>>
>
> Wait. I built with the wrong kernel-config.
>

My -2 kernel was the one from last week. -3 is the new one.

$ diff -uprN /boot/config-3.10.0-2-llvmlinux-iniza-small
/boot/config-3.10.0-3-llvmlinux-iniza-small | grep ^+
+++ /boot/config-3.10.0-3-llvmlinux-iniza-small 2013-07-25
14:48:48.000000000 +0200
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+# CONFIG_FUNCTION_TRACER is not set
+# CONFIG_STACK_TRACER is not set

My -4 with tracing-support enabled still fails.

$ egrep -i 'ftrace|function_tracer' linux/.config | grep -v HAVE | grep ^CONFIG
CONFIG_KPROBES_ON_FTRACE=y
CONFIG_FTRACE=y
CONFIG_FUNCTION_TRACER=y
CONFIG_FTRACE_SYSCALLS=y
CONFIG_DYNAMIC_FTRACE=y
CONFIG_DYNAMIC_FTRACE_WITH_REGS=y
CONFIG_FTRACE_MCOUNT_RECORD=y

$ tail -20 build-log_3.10.0-4-llvmlinux-iniza-small.txt
  LD      drivers/usb/built-in.o
  LD      drivers/built-in.o
  LINK    vmlinux
  LD      vmlinux.o
  MODPOST vmlinux.o
  GEN     .version
  CHK     include/generated/compile.h
  UPD     include/generated/compile.h
  CC      init/version.o
  LD      init/built-in.o
arch/x86/kernel/head64.o: In function `early_make_pgtable':
arch/x86/kernel/head64.c:(.init.text+0x2a): undefined reference to `mcount'
arch/x86/kernel/head64.c:(.init.text+0x3e): undefined reference to `mcount'
arch/x86/kernel/head64.c:(.init.text+0x4d): undefined reference to `mcount'
arch/x86/kernel/head64.c:(.init.text+0xb1): undefined reference to `mcount'
arch/x86/kernel/head64.c:(.init.text+0xd4): undefined reference to `mcount'
arch/x86/kernel/head64.o:arch/x86/kernel/head64.c:(.init.text+0x106):
more undefined references to `mcount' follow
make[2]: *** [vmlinux] Error 1
make[1]: *** [deb-pkg] Error 2
make: *** [deb-pkg] Error 2

Sorry, I did a...

    $ yes "" | make oldconfig; make silentoldconfig </dev/null

...with the wrong kernel-config.

- Sedat -

> - Sedat -
>
>> Best,
>> --
>>
>> Dipl.-Ing.
>> Jan-Simon Möller
>>
>> jansimon.moeller at gmx.de
>> On Thursday 25 July 2013 15:05:22 Sedat Dilek wrote:
>>> Background: The build on x86_64 breaks with tracing support enabled.
>>>
>>> pageexec from PaX Team suggested to drop the changes in 0033.
>>> The result is tracing-support builds fine, now.
>>> Also, I could boot into the generated kernel.
>>>
>>> For more details see this thread on llvmlinux ML:
>>> "[arch/x86/kernel/head64.c] In function `early_make_pgtable': undefined
>>> reference to `mcount'"
>>>
>>> See also original patch from [1].
>>>
>>> [1]
>>> http://git.linuxfoundation.org/?p=llvmlinux.git;a=blob;f=arch/x86_64/patche
>>> s/0033-Various-fixes-in-arch-x86-include-asm.patch
>>>
>>> Tested with pre-built toolchain v3.3 (AMD64) from <llvm.org> against Linux
>>> v3.10.
>>>
>>> [ Untested: Doing some real tracing on x86_64. ]
>>>
>>> Suggested-by: PaX Team <pageexec at gmail.com>
>>> Signed-off-by: Sedat Dilek <sedat.dilek at gmail.com>
>>> ---
>>>  arch/x86/include/asm/ftrace.h | 11 -----------
>>>  1 file changed, 11 deletions(-)
>>>
>>> diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
>>> index ca98134..0525a8b 100644
>>> --- a/arch/x86/include/asm/ftrace.h
>>> +++ b/arch/x86/include/asm/ftrace.h
>>> @@ -32,17 +32,6 @@
>>>       addq $(SS+8-\skip), %rsp
>>>       .endm
>>>
>>> -#else
>>> -
>>> -#define HAVE_ARCH_CALLER_ADDR
>>> -
>>> -#define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0))
>>> -#define CALLER_ADDR1 0UL
>>> -#define CALLER_ADDR2 0UL
>>> -#define CALLER_ADDR3 0UL
>>> -#define CALLER_ADDR4 0UL
>>> -#define CALLER_ADDR5 0UL
>>> -#define CALLER_ADDR6 0UL
>>>  #endif
>>>
>>>  #ifdef CONFIG_FUNCTION_TRACER


More information about the LLVMLinux mailing list