lkml.org 
[lkml]   [2018]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 2/7] kprobes: Show blacklist addresses as same as kallsyms does
Date
Show kprobes blacklist addresses under same condition of
showing kallsyms addresses.

Since there are several name conflict for local symbols,
kprobe blacklist needs to show each addresses so that
user can identify where is on blacklist by comparing
with kallsyms.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
Changes in v3:
- Updated based on the latest linus tree.
---
kernel/kprobes.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 51096eece801..e7d7e3e8598a 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -2427,9 +2427,17 @@ static int kprobe_blacklist_seq_show(struct seq_file *m, void *v)
{
struct kprobe_blacklist_entry *ent =
list_entry(v, struct kprobe_blacklist_entry, list);
+ void *start = (void *)ent->start_addr, *end = (void *)ent->end_addr;

- seq_printf(m, "0x%px-0x%px\t%ps\n", (void *)ent->start_addr,
- (void *)ent->end_addr, (void *)ent->start_addr);
+ /*
+ * As long as kallsyms shows the address, kprobes blacklist also
+ * show it, Or, it shows null address and symbol.
+ */
+ if (!kallsyms_show_value())
+ start = end = NULL;
+
+ seq_printf(m, "0x%px-0x%px\t%ps\n", start, end,
+ (void *)ent->start_addr);
return 0;
}

\
 
 \ /
  Last update: 2018-04-27 08:41    [W:0.102 / U:1.888 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site