microblaze: Fix ftrace

- Do not trace idle loop which takes a lot time
- Fix cache handling in generic ftrace code
- Do not trace lib functions ashldi3, ashrdi3, lshrdi3
Functions are called from generic ftrace code which
can't be traced

Signed-off-by: Michal Simek <monstr@monstr.eu>

+13 -4
+1
arch/microblaze/kernel/Makefile
··· 10 10 CFLAGS_REMOVE_selfmod.o = -pg 11 11 CFLAGS_REMOVE_heartbeat.o = -pg 12 12 CFLAGS_REMOVE_ftrace.o = -pg 13 + CFLAGS_REMOVE_process.o = -pg 13 14 endif 14 15 15 16 extra-y := head.o vmlinux.lds
+6 -4
arch/microblaze/kernel/ftrace.c
··· 51 51 : "r" (parent), "r" (return_hooker) 52 52 ); 53 53 54 + flush_dcache_range((u32)parent, (u32)parent + 4); 55 + flush_icache_range((u32)parent, (u32)parent + 4); 56 + 54 57 if (unlikely(faulted)) { 55 58 ftrace_graph_stop(); 56 59 WARN_ON(1); ··· 97 94 98 95 if (unlikely(faulted)) 99 96 return -EFAULT; 97 + 98 + flush_dcache_range(addr, addr + 4); 99 + flush_icache_range(addr, addr + 4); 100 100 101 101 return 0; 102 102 } ··· 201 195 ret += ftrace_modify_code((unsigned long)&ftrace_caller, 202 196 MICROBLAZE_NOP); 203 197 204 - /* All changes are done - lets do caches consistent */ 205 - flush_icache(); 206 198 return ret; 207 199 } 208 200 ··· 214 210 215 211 old_jump = *(unsigned int *)ip; /* save jump over instruction */ 216 212 ret = ftrace_modify_code(ip, MICROBLAZE_NOP); 217 - flush_icache(); 218 213 219 214 pr_debug("%s: Replace instruction: 0x%x\n", __func__, old_jump); 220 215 return ret; ··· 225 222 unsigned long ip = (unsigned long)(&ftrace_call_graph); 226 223 227 224 ret = ftrace_modify_code(ip, old_jump); 228 - flush_icache(); 229 225 230 226 pr_debug("%s\n", __func__); 231 227 return ret;
+6
arch/microblaze/lib/Makefile
··· 2 2 # Makefile 3 3 # 4 4 5 + ifdef CONFIG_FUNCTION_TRACER 6 + CFLAGS_REMOVE_ashldi3.o = -pg 7 + CFLAGS_REMOVE_ashrdi3.o = -pg 8 + CFLAGS_REMOVE_lshrdi3.o = -pg 9 + endif 10 + 5 11 lib-y := memset.o 6 12 7 13 ifeq ($(CONFIG_OPT_LIB_ASM),y)