Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 366dd4ea authored by Helge Deller's avatar Helge Deller
Browse files

parisc: Fix ftrace function tracer



Fix the FTRACE function tracer for 32- and 64-bit kernel.
The former code was horribly broken.

Reimplement most coding in assembly and utilize optimizations, e.g. put
mcount() and ftrace_stub() into one L1 cacheline.

Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent b562e44f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4,8 +4,8 @@ config PARISC
	select ARCH_MIGHT_HAVE_PC_PARPORT
	select HAVE_IDE
	select HAVE_OPROFILE
	select HAVE_FUNCTION_TRACER if 64BIT
	select HAVE_FUNCTION_GRAPH_TRACER if 64BIT
	select HAVE_FUNCTION_TRACER
	select HAVE_FUNCTION_GRAPH_TRACER
	select ARCH_WANT_FRAME_POINTERS
	select RTC_CLASS
	select RTC_DRV_GENERIC
+4 −0
Original line number Diff line number Diff line
@@ -2,9 +2,13 @@ menu "Kernel hacking"

source "lib/Kconfig.debug"

config TRACE_IRQFLAGS_SUPPORT
	def_bool y

config DEBUG_RODATA
       bool "Write protect kernel read-only data structures"
       depends on DEBUG_KERNEL
       default y
       help
         Mark the kernel read-only data as write-protected in the pagetables,
         in order to catch accidental (and incorrect) writes to such const
+1 −3
Original line number Diff line number Diff line
@@ -62,9 +62,7 @@ cflags-y += -mdisable-fpregs

# Without this, "ld -r" results in .text sections that are too big
# (> 0x40000) for branches to reach stubs.
ifndef CONFIG_FUNCTION_TRACER
cflags-y	+= -ffunction-sections
endif

# Use long jumps instead of long branches (needed if your linker fails to
# link a too big vmlinux executable). Not enabled for building modules.
+1 −17
Original line number Diff line number Diff line
@@ -4,23 +4,7 @@
#ifndef __ASSEMBLY__
extern void mcount(void);

/*
 * Stack of return addresses for functions of a thread.
 * Used in struct thread_info
 */
struct ftrace_ret_stack {
	unsigned long ret;
	unsigned long func;
	unsigned long long calltime;
};

/*
 * Primary handler of a function return.
 * It relays on ftrace_return_to_handler.
 * Defined in entry.S
 */
extern void return_to_handler(void);

#define MCOUNT_INSN_SIZE 4

extern unsigned long return_address(unsigned int);

+0 −4
Original line number Diff line number Diff line
@@ -15,11 +15,7 @@ ifdef CONFIG_FUNCTION_TRACER
# Do not profile debug and lowlevel utilities
CFLAGS_REMOVE_ftrace.o = -pg
CFLAGS_REMOVE_cache.o = -pg
CFLAGS_REMOVE_irq.o = -pg
CFLAGS_REMOVE_pacache.o = -pg
CFLAGS_REMOVE_perf.o = -pg
CFLAGS_REMOVE_traps.o = -pg
CFLAGS_REMOVE_unaligned.o = -pg
CFLAGS_REMOVE_unwind.o = -pg
endif

Loading