kprobes: Rename [arch_]function_offset_within_entry() to [arch_]kprobe_on_func_entry()
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Fri, 7 Jul 2017 17:07:24 +0000 (22:37 +0530)
committerIngo Molnar <mingo@kernel.org>
Sat, 8 Jul 2017 09:05:34 +0000 (11:05 +0200)
Rename function_offset_within_entry() to scope it to kprobe namespace by
using kprobe_ prefix, and to also simplify it.

Suggested-by: Ingo Molnar <mingo@kernel.org>
Suggested-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/3aa6c7e2e4fb6e00f3c24fa306496a66edb558ea.1499443367.git.naveen.n.rao@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/powerpc/kernel/kprobes.c
include/linux/kprobes.h
kernel/kprobes.c
kernel/trace/trace_kprobe.c

index 01addfb0ed0a42216d64c7692c3fea4694c528fb..586508e949f0ef677b1f1d2878ce3a48536a47a0 100644 (file)
@@ -221,7 +221,7 @@ static nokprobe_inline void set_current_kprobe(struct kprobe *p, struct pt_regs
        kcb->kprobe_saved_msr = regs->msr;
 }
 
-bool arch_function_offset_within_entry(unsigned long offset)
+bool arch_kprobe_on_func_entry(unsigned long offset)
 {
 #ifdef PPC64_ELF_ABI_v2
 #ifdef CONFIG_KPROBES_ON_FTRACE
index 541df0b5b81530741586d6eaf382e9d1a425ac06..bd2684700b74cd5c97ada00a53fbea3242a15397 100644 (file)
@@ -267,8 +267,8 @@ extern int arch_init_kprobes(void);
 extern void show_registers(struct pt_regs *regs);
 extern void kprobes_inc_nmissed_count(struct kprobe *p);
 extern bool arch_within_kprobe_blacklist(unsigned long addr);
-extern bool arch_function_offset_within_entry(unsigned long offset);
-extern bool function_offset_within_entry(kprobe_opcode_t *addr, const char *sym, unsigned long offset);
+extern bool arch_kprobe_on_func_entry(unsigned long offset);
+extern bool kprobe_on_func_entry(kprobe_opcode_t *addr, const char *sym, unsigned long offset);
 
 extern bool within_kprobe_blacklist(unsigned long addr);
 
index 6756d750b31b5c8d044d793fe68f43f19f5bb3d1..a519219169fd7cd4148c373953b6d8f1a9c99402 100644 (file)
@@ -1888,12 +1888,12 @@ static int pre_handler_kretprobe(struct kprobe *p, struct pt_regs *regs)
 }
 NOKPROBE_SYMBOL(pre_handler_kretprobe);
 
-bool __weak arch_function_offset_within_entry(unsigned long offset)
+bool __weak arch_kprobe_on_func_entry(unsigned long offset)
 {
        return !offset;
 }
 
-bool function_offset_within_entry(kprobe_opcode_t *addr, const char *sym, unsigned long offset)
+bool kprobe_on_func_entry(kprobe_opcode_t *addr, const char *sym, unsigned long offset)
 {
        kprobe_opcode_t *kp_addr = _kprobe_addr(addr, sym, offset);
 
@@ -1901,7 +1901,7 @@ bool function_offset_within_entry(kprobe_opcode_t *addr, const char *sym, unsign
                return false;
 
        if (!kallsyms_lookup_size_offset((unsigned long)kp_addr, NULL, &offset) ||
-                                               !arch_function_offset_within_entry(offset))
+                                               !arch_kprobe_on_func_entry(offset))
                return false;
 
        return true;
@@ -1914,7 +1914,7 @@ int register_kretprobe(struct kretprobe *rp)
        int i;
        void *addr;
 
-       if (!function_offset_within_entry(rp->kp.addr, rp->kp.symbol_name, rp->kp.offset))
+       if (!kprobe_on_func_entry(rp->kp.addr, rp->kp.symbol_name, rp->kp.offset))
                return -EINVAL;
 
        if (kretprobe_blacklist_size) {
index b53c8d36916351156d8042b05b13bc5b8b717388..2c5221819be51e79f504235c131ee4dc93138a91 100644 (file)
@@ -720,7 +720,7 @@ static int create_trace_kprobe(int argc, char **argv)
                        return ret;
                }
                if (offset && is_return &&
-                   !function_offset_within_entry(NULL, symbol, offset)) {
+                   !kprobe_on_func_entry(NULL, symbol, offset)) {
                        pr_info("Given offset is not valid for return probe.\n");
                        return -EINVAL;
                }