Skip to content

Commit 659b957

Browse files
rnavIngo Molnar
authored andcommitted
kprobes: Rename [arch_]function_offset_within_entry() to [arch_]kprobe_on_func_entry()
Rename function_offset_within_entry() to scope it to kprobe namespace by using kprobe_ prefix, and to also simplify it. Suggested-by: Ingo Molnar <[email protected]> Suggested-by: Masami Hiramatsu <[email protected]> Signed-off-by: Naveen N. Rao <[email protected]> Cc: Ananth N Mavinakayanahalli <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/3aa6c7e2e4fb6e00f3c24fa306496a66edb558ea.1499443367.git.naveen.n.rao@linux.vnet.ibm.com Signed-off-by: Ingo Molnar <[email protected]>
1 parent 524b62f commit 659b957

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

arch/powerpc/kernel/kprobes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ static nokprobe_inline void set_current_kprobe(struct kprobe *p, struct pt_regs
221221
kcb->kprobe_saved_msr = regs->msr;
222222
}
223223

224-
bool arch_function_offset_within_entry(unsigned long offset)
224+
bool arch_kprobe_on_func_entry(unsigned long offset)
225225
{
226226
#ifdef PPC64_ELF_ABI_v2
227227
#ifdef CONFIG_KPROBES_ON_FTRACE

include/linux/kprobes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ extern int arch_init_kprobes(void);
267267
extern void show_registers(struct pt_regs *regs);
268268
extern void kprobes_inc_nmissed_count(struct kprobe *p);
269269
extern bool arch_within_kprobe_blacklist(unsigned long addr);
270-
extern bool arch_function_offset_within_entry(unsigned long offset);
271-
extern bool function_offset_within_entry(kprobe_opcode_t *addr, const char *sym, unsigned long offset);
270+
extern bool arch_kprobe_on_func_entry(unsigned long offset);
271+
extern bool kprobe_on_func_entry(kprobe_opcode_t *addr, const char *sym, unsigned long offset);
272272

273273
extern bool within_kprobe_blacklist(unsigned long addr);
274274

kernel/kprobes.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,20 +1888,20 @@ static int pre_handler_kretprobe(struct kprobe *p, struct pt_regs *regs)
18881888
}
18891889
NOKPROBE_SYMBOL(pre_handler_kretprobe);
18901890

1891-
bool __weak arch_function_offset_within_entry(unsigned long offset)
1891+
bool __weak arch_kprobe_on_func_entry(unsigned long offset)
18921892
{
18931893
return !offset;
18941894
}
18951895

1896-
bool function_offset_within_entry(kprobe_opcode_t *addr, const char *sym, unsigned long offset)
1896+
bool kprobe_on_func_entry(kprobe_opcode_t *addr, const char *sym, unsigned long offset)
18971897
{
18981898
kprobe_opcode_t *kp_addr = _kprobe_addr(addr, sym, offset);
18991899

19001900
if (IS_ERR(kp_addr))
19011901
return false;
19021902

19031903
if (!kallsyms_lookup_size_offset((unsigned long)kp_addr, NULL, &offset) ||
1904-
!arch_function_offset_within_entry(offset))
1904+
!arch_kprobe_on_func_entry(offset))
19051905
return false;
19061906

19071907
return true;
@@ -1914,7 +1914,7 @@ int register_kretprobe(struct kretprobe *rp)
19141914
int i;
19151915
void *addr;
19161916

1917-
if (!function_offset_within_entry(rp->kp.addr, rp->kp.symbol_name, rp->kp.offset))
1917+
if (!kprobe_on_func_entry(rp->kp.addr, rp->kp.symbol_name, rp->kp.offset))
19181918
return -EINVAL;
19191919

19201920
if (kretprobe_blacklist_size) {

kernel/trace/trace_kprobe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ static int create_trace_kprobe(int argc, char **argv)
720720
return ret;
721721
}
722722
if (offset && is_return &&
723-
!function_offset_within_entry(NULL, symbol, offset)) {
723+
!kprobe_on_func_entry(NULL, symbol, offset)) {
724724
pr_info("Given offset is not valid for return probe.\n");
725725
return -EINVAL;
726726
}

0 commit comments

Comments
 (0)