Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 264292
b: refs/heads/master
c: 49de830
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Gleixner authored and Ralf Baechle committed Sep 21, 2011
1 parent 7fe0338 commit c37d2e7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 20ef5d3a23d5aacb85d0a2808d949e3daf83cd20
refs/heads/master: 49de830ad7b94d05f6dbfbae97a03f80169a7462
39 changes: 20 additions & 19 deletions trunk/arch/mips/kernel/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,26 @@

#include <asm-generic/sections.h>

#if defined(KBUILD_MCOUNT_RA_ADDRESS) && defined(CONFIG_32BIT)
#define MCOUNT_OFFSET_INSNS 5
#else
#define MCOUNT_OFFSET_INSNS 4
#endif

/*
* Check if the address is in kernel space
*
* Clone core_kernel_text() from kernel/extable.c, but doesn't call
* init_kernel_text() for Ftrace doesn't trace functions in init sections.
*/
static inline int in_kernel_space(unsigned long ip)
{
if (ip >= (unsigned long)_stext &&
ip <= (unsigned long)_etext)
return 1;
return 0;
}

#ifdef CONFIG_DYNAMIC_FTRACE

#define JAL 0x0c000000 /* jump & link: ip --> ra, jump to target */
Expand Down Expand Up @@ -54,20 +74,6 @@ static inline void ftrace_dyn_arch_init_insns(void)
#endif
}

/*
* Check if the address is in kernel space
*
* Clone core_kernel_text() from kernel/extable.c, but doesn't call
* init_kernel_text() for Ftrace doesn't trace functions in init sections.
*/
static inline int in_kernel_space(unsigned long ip)
{
if (ip >= (unsigned long)_stext &&
ip <= (unsigned long)_etext)
return 1;
return 0;
}

static int ftrace_modify_code(unsigned long ip, unsigned int new_code)
{
int faulted;
Expand Down Expand Up @@ -112,11 +118,6 @@ static int ftrace_modify_code(unsigned long ip, unsigned int new_code)
* 1: offset = 4 instructions
*/

#if defined(KBUILD_MCOUNT_RA_ADDRESS) && defined(CONFIG_32BIT)
#define MCOUNT_OFFSET_INSNS 5
#else
#define MCOUNT_OFFSET_INSNS 4
#endif
#define INSN_B_1F (0x10000000 | MCOUNT_OFFSET_INSNS)

int ftrace_make_nop(struct module *mod,
Expand Down

0 comments on commit c37d2e7

Please sign in to comment.