Commit 4458515b authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Ingo Molnar

kprobes: Replace %p with other pointer types

Replace %p with %pS or just remove it if unneeded.
And use WARN_ONCE() if it is a single bug.
Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David Howells <dhowells@redhat.com>
Cc: David S . Miller <davem@davemloft.net>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Jon Medhurst <tixy@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Cc: Tobin C . Harding <me@tobin.cc>
Cc: Will Deacon <will.deacon@arm.com>
Cc: acme@kernel.org
Cc: akpm@linux-foundation.org
Cc: brueckner@linux.vnet.ibm.com
Cc: linux-arch@vger.kernel.org
Cc: rostedt@goodmis.org
Cc: schwidefsky@de.ibm.com
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/lkml/152491899284.9916.5350534544808158621.stgit@devboxSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 81365a94
...@@ -710,9 +710,7 @@ static void reuse_unused_kprobe(struct kprobe *ap) ...@@ -710,9 +710,7 @@ static void reuse_unused_kprobe(struct kprobe *ap)
* there is still a relative jump) and disabled. * there is still a relative jump) and disabled.
*/ */
op = container_of(ap, struct optimized_kprobe, kp); op = container_of(ap, struct optimized_kprobe, kp);
if (unlikely(list_empty(&op->list))) WARN_ON_ONCE(list_empty(&op->list));
printk(KERN_WARNING "Warning: found a stray unused "
"aggrprobe@%p\n", ap->addr);
/* Enable the probe again */ /* Enable the probe again */
ap->flags &= ~KPROBE_FLAG_DISABLED; ap->flags &= ~KPROBE_FLAG_DISABLED;
/* Optimize it again (remove from op->list) */ /* Optimize it again (remove from op->list) */
...@@ -985,7 +983,8 @@ static int arm_kprobe_ftrace(struct kprobe *p) ...@@ -985,7 +983,8 @@ static int arm_kprobe_ftrace(struct kprobe *p)
ret = ftrace_set_filter_ip(&kprobe_ftrace_ops, ret = ftrace_set_filter_ip(&kprobe_ftrace_ops,
(unsigned long)p->addr, 0, 0); (unsigned long)p->addr, 0, 0);
if (ret) { if (ret) {
pr_debug("Failed to arm kprobe-ftrace at %p (%d)\n", p->addr, ret); pr_debug("Failed to arm kprobe-ftrace at %pS (%d)\n",
p->addr, ret);
return ret; return ret;
} }
...@@ -1025,7 +1024,8 @@ static int disarm_kprobe_ftrace(struct kprobe *p) ...@@ -1025,7 +1024,8 @@ static int disarm_kprobe_ftrace(struct kprobe *p)
ret = ftrace_set_filter_ip(&kprobe_ftrace_ops, ret = ftrace_set_filter_ip(&kprobe_ftrace_ops,
(unsigned long)p->addr, 1, 0); (unsigned long)p->addr, 1, 0);
WARN(ret < 0, "Failed to disarm kprobe-ftrace at %p (%d)\n", p->addr, ret); WARN_ONCE(ret < 0, "Failed to disarm kprobe-ftrace at %pS (%d)\n",
p->addr, ret);
return ret; return ret;
} }
#else /* !CONFIG_KPROBES_ON_FTRACE */ #else /* !CONFIG_KPROBES_ON_FTRACE */
...@@ -2069,11 +2069,12 @@ int enable_kprobe(struct kprobe *kp) ...@@ -2069,11 +2069,12 @@ int enable_kprobe(struct kprobe *kp)
} }
EXPORT_SYMBOL_GPL(enable_kprobe); EXPORT_SYMBOL_GPL(enable_kprobe);
/* Caller must NOT call this in usual path. This is only for critical case */
void dump_kprobe(struct kprobe *kp) void dump_kprobe(struct kprobe *kp)
{ {
printk(KERN_WARNING "Dumping kprobe:\n"); pr_err("Dumping kprobe:\n");
printk(KERN_WARNING "Name: %s\nAddress: %p\nOffset: %x\n", pr_err("Name: %s\nOffset: %x\nAddress: %pS\n",
kp->symbol_name, kp->addr, kp->offset); kp->symbol_name, kp->offset, kp->addr);
} }
NOKPROBE_SYMBOL(dump_kprobe); NOKPROBE_SYMBOL(dump_kprobe);
...@@ -2096,11 +2097,8 @@ static int __init populate_kprobe_blacklist(unsigned long *start, ...@@ -2096,11 +2097,8 @@ static int __init populate_kprobe_blacklist(unsigned long *start,
entry = arch_deref_entry_point((void *)*iter); entry = arch_deref_entry_point((void *)*iter);
if (!kernel_text_address(entry) || if (!kernel_text_address(entry) ||
!kallsyms_lookup_size_offset(entry, &size, &offset)) { !kallsyms_lookup_size_offset(entry, &size, &offset))
pr_err("Failed to find blacklist at %p\n",
(void *)entry);
continue; continue;
}
ent = kmalloc(sizeof(*ent), GFP_KERNEL); ent = kmalloc(sizeof(*ent), GFP_KERNEL);
if (!ent) if (!ent)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment