From: Masami Hiramatsu <mhiramat@kernel.org>
To: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Cc: Ingo Molnar <mingo@redhat.com>, "H . Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, Masami Hiramatsu <mhiramat@kernel.org>,
Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>,
"David S . Miller" <davem@davemloft.net>,
Jon Medhurst <tixy@linaro.org>, Will Deacon <will.deacon@arm.com>,
Arnd Bergmann <arnd@arndb.de>,
David Howells <dhowells@redhat.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
"Tobin C . Harding" <me@tobin.cc>,
Linus Torvalds <torvalds@linux-foundation.org>,
Thomas Richter <tmricht@linux.ibm.com>,
akpm@linux-foundation.org, acme@kernel.org, rostedt@goodmis.org,
brueckner@linux.vnet.ibm.com, schwidefsky@de.ibm.com,
stable@vger.kernel.org
Subject: [PATCH -tip v2 4/7] kprobes: Replace %p with other pointer types
Date: Thu, 26 Apr 2018 17:10:03 +0900 [thread overview]
Message-ID: <152473020349.8819.11597612324633031612.stgit@devbox> (raw)
In-Reply-To: <152473007907.8819.10449983839199591406.stgit@devbox>
Replace %p with appropriate pointer types (or just remove it)
- Use %pS if possible
- Use %px only for the function right before BUG().
- Remove unneeded error message.
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
Changes in v2:
- Rebased on linux-next
---
kernel/kprobes.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 94af7c99cf81..58f9e313cf08 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -712,7 +712,7 @@ static void reuse_unused_kprobe(struct kprobe *ap)
op = container_of(ap, struct optimized_kprobe, kp);
if (unlikely(list_empty(&op->list)))
printk(KERN_WARNING "Warning: found a stray unused "
- "aggrprobe@%p\n", ap->addr);
+ "aggrprobe@%pS\n", ap->addr);
/* Enable the probe again */
ap->flags &= ~KPROBE_FLAG_DISABLED;
/* Optimize it again (remove from op->list) */
@@ -985,7 +985,8 @@ static int arm_kprobe_ftrace(struct kprobe *p)
ret = ftrace_set_filter_ip(&kprobe_ftrace_ops,
(unsigned long)p->addr, 0, 0);
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;
}
@@ -1025,7 +1026,8 @@ static int disarm_kprobe_ftrace(struct kprobe *p)
ret = ftrace_set_filter_ip(&kprobe_ftrace_ops,
(unsigned long)p->addr, 1, 0);
- WARN(ret < 0, "Failed to disarm kprobe-ftrace at %p (%d)\n", p->addr, ret);
+ WARN(ret < 0, "Failed to disarm kprobe-ftrace at %pS (%d)\n",
+ p->addr, ret);
return ret;
}
#else /* !CONFIG_KPROBES_ON_FTRACE */
@@ -2169,10 +2171,11 @@ int enable_kprobe(struct kprobe *kp)
}
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)
{
- printk(KERN_WARNING "Dumping kprobe:\n");
- printk(KERN_WARNING "Name: %s\nAddress: %p\nOffset: %x\n",
+ pr_err("Dumping kprobe:\n");
+ pr_err("Name: %s\nAddress: %px\nOffset: %x\n",
kp->symbol_name, kp->addr, kp->offset);
}
NOKPROBE_SYMBOL(dump_kprobe);
@@ -2196,11 +2199,8 @@ static int __init populate_kprobe_blacklist(unsigned long *start,
entry = arch_deref_entry_point((void *)*iter);
if (!kernel_text_address(entry) ||
- !kallsyms_lookup_size_offset(entry, &size, &offset)) {
- pr_err("Failed to find blacklist at %p\n",
- (void *)entry);
+ !kallsyms_lookup_size_offset(entry, &size, &offset))
continue;
- }
ent = kmalloc(sizeof(*ent), GFP_KERNEL);
if (!ent)
next prev parent reply other threads:[~2018-04-26 8:10 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-26 8:08 [PATCH -tip v2 0/7] kprobes: Fix %p in kprobes Masami Hiramatsu
2018-04-26 8:08 ` Masami Hiramatsu
2018-04-26 8:08 ` [PATCH -tip v2 1/7] kprobes: Make blacklist root user read only Masami Hiramatsu
2018-04-26 8:08 ` Masami Hiramatsu
2018-04-26 8:09 ` [PATCH -tip v2 2/7] kprobes: Show blacklist addresses as same as kallsyms does Masami Hiramatsu
2018-04-26 8:09 ` Masami Hiramatsu
2018-04-26 8:09 ` [PATCH -tip v2 3/7] kprobes: Show address of kprobes if " Masami Hiramatsu
2018-04-26 8:09 ` Masami Hiramatsu
2018-04-26 8:10 ` Masami Hiramatsu [this message]
2018-04-26 8:10 ` [PATCH -tip v2 4/7] kprobes: Replace %p with other pointer types Masami Hiramatsu
2018-04-27 1:13 ` Steven Rostedt
2018-04-27 1:13 ` Steven Rostedt
2018-04-27 2:39 ` Masami Hiramatsu
2018-04-27 2:39 ` Masami Hiramatsu
2018-04-27 2:48 ` Steven Rostedt
2018-04-27 2:48 ` Steven Rostedt
2018-04-27 5:07 ` Masami Hiramatsu
2018-04-27 5:07 ` Masami Hiramatsu
2018-04-26 8:10 ` [PATCH -tip v2 5/7] kprobes/x86: Fix %p uses in error messages Masami Hiramatsu
2018-04-26 8:10 ` Masami Hiramatsu
2018-04-26 8:11 ` [PATCH -tip v2 6/7] kprobes/arm: " Masami Hiramatsu
2018-04-26 8:11 ` Masami Hiramatsu
2018-04-26 8:11 ` [PATCH -tip v2 7/7] kprobes/arm64: " Masami Hiramatsu
2018-04-26 8:11 ` Masami Hiramatsu
2018-04-26 8:13 ` [PATCH -tip v2 0/7] kprobes: Fix %p in kprobes Masami Hiramatsu
2018-04-26 8:13 ` Masami Hiramatsu
2018-04-26 8:40 ` Greg KH
2018-04-26 8:40 ` Greg KH
2018-04-27 1:14 ` Steven Rostedt
2018-04-27 1:14 ` Steven Rostedt
2018-04-27 6:08 ` Masami Hiramatsu
2018-04-27 6:08 ` Masami Hiramatsu
2018-04-27 6:56 ` Greg KH
2018-04-27 6:56 ` Greg KH
2018-04-27 14:51 ` Masami Hiramatsu
2018-04-27 14:51 ` Masami Hiramatsu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=152473020349.8819.11597612324633031612.stgit@devbox \
--to=mhiramat@kernel.org \
--cc=acme@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=ananth@in.ibm.com \
--cc=anil.s.keshavamurthy@intel.com \
--cc=arnd@arndb.de \
--cc=brueckner@linux.vnet.ibm.com \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=heiko.carstens@de.ibm.com \
--cc=hpa@zytor.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=me@tobin.cc \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=schwidefsky@de.ibm.com \
--cc=stable@vger.kernel.org \
--cc=tixy@linaro.org \
--cc=tmricht@linux.ibm.com \
--cc=torvalds@linux-foundation.org \
--cc=will.deacon@arm.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox