diff options
author | Keshavamurthy Anil S <anil.s.keshavamurthy@intel.com> | 2005-12-12 03:37:34 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-12-12 11:57:45 -0500 |
commit | bf8d5c52c3b6b27061e3b7d779057fd9a6cac164 (patch) | |
tree | e4371185eba27db47282410dd490b78598d20636 /kernel/kprobes.c | |
parent | 00d7c05ab168c10f9b520e07400923267bc04419 (diff) |
[PATCH] kprobes: increment kprobe missed count for multiprobes
When multiple probes are registered at the same address and if due to some
recursion (probe getting triggered within a probe handler), we skip calling
pre_handlers and just increment nmissed field.
The below patch make sure it walks the list for multiple probes case.
Without the below patch we get incorrect results of nmissed count for
multiple probe case.
Signed-off-by: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/kprobes.c')
-rw-r--r-- | kernel/kprobes.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/kernel/kprobes.c b/kernel/kprobes.c index e4f0fc62bd3e..3bb71e63a37e 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c | |||
@@ -246,6 +246,19 @@ static int __kprobes aggr_break_handler(struct kprobe *p, struct pt_regs *regs) | |||
246 | return ret; | 246 | return ret; |
247 | } | 247 | } |
248 | 248 | ||
249 | /* Walks the list and increments nmissed count for multiprobe case */ | ||
250 | void __kprobes kprobes_inc_nmissed_count(struct kprobe *p) | ||
251 | { | ||
252 | struct kprobe *kp; | ||
253 | if (p->pre_handler != aggr_pre_handler) { | ||
254 | p->nmissed++; | ||
255 | } else { | ||
256 | list_for_each_entry_rcu(kp, &p->list, list) | ||
257 | kp->nmissed++; | ||
258 | } | ||
259 | return; | ||
260 | } | ||
261 | |||
249 | /* Called with kretprobe_lock held */ | 262 | /* Called with kretprobe_lock held */ |
250 | struct kretprobe_instance __kprobes *get_free_rp_inst(struct kretprobe *rp) | 263 | struct kretprobe_instance __kprobes *get_free_rp_inst(struct kretprobe *rp) |
251 | { | 264 | { |