Skip to content

Commit

Permalink
powerpc: Enable GCOV
Browse files Browse the repository at this point in the history
Make it possible to enable GCOV code coverage measurement on powerpc.

Lightly tested on 64-bit, seems to work as expected.

Signed-off-by: Michael Ellerman <[email protected]>
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
  • Loading branch information
mpe authored and ozbenh committed Aug 20, 2009
1 parent 7286565 commit a15098c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
7 changes: 7 additions & 0 deletions arch/powerpc/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ ifneq ($(CONFIG_XMON)$(CONFIG_KEXEC),)
obj-y += ppc_save_regs.o
endif

# Disable GCOV in odd or sensitive code
GCOV_PROFILE_prom_init.o := n
GCOV_PROFILE_ftrace.o := n
GCOV_PROFILE_machine_kexec_64.o := n
GCOV_PROFILE_machine_kexec_32.o := n
GCOV_PROFILE_kprobes.o := n

extra-$(CONFIG_PPC_FPU) += fpu.o
extra-$(CONFIG_ALTIVEC) += vector.o
extra-$(CONFIG_PPC64) += entry_64.o
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/kernel/vdso32/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ endif
targets := $(obj-vdso32) vdso32.so vdso32.so.dbg
obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))

GCOV_PROFILE := n

EXTRA_CFLAGS := -shared -fno-common -fno-builtin
EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso32.so.1 \
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/kernel/vdso64/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ obj-vdso64 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o
targets := $(obj-vdso64) vdso64.so vdso64.so.dbg
obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64))

GCOV_PROFILE := n

EXTRA_CFLAGS := -shared -fno-common -fno-builtin
EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso64.so.1 \
$(call ld-option, -Wl$(comma)--hash-style=sysv)
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/xmon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror

GCOV_PROFILE := n

ifdef CONFIG_PPC64
EXTRA_CFLAGS += -mno-minimal-toc
endif
Expand Down
2 changes: 1 addition & 1 deletion kernel/gcov/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ config GCOV_KERNEL
config GCOV_PROFILE_ALL
bool "Profile entire Kernel"
depends on GCOV_KERNEL
depends on S390 || X86
depends on S390 || X86 || (PPC && EXPERIMENTAL)
default n
---help---
This options activates profiling for the entire kernel.
Expand Down

0 comments on commit a15098c

Please sign in to comment.