mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
[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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
00d7c05ab1
commit
bf8d5c52c3
7 changed files with 19 additions and 5 deletions
|
|
@ -246,6 +246,19 @@ static int __kprobes aggr_break_handler(struct kprobe *p, struct pt_regs *regs)
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* Walks the list and increments nmissed count for multiprobe case */
|
||||
void __kprobes kprobes_inc_nmissed_count(struct kprobe *p)
|
||||
{
|
||||
struct kprobe *kp;
|
||||
if (p->pre_handler != aggr_pre_handler) {
|
||||
p->nmissed++;
|
||||
} else {
|
||||
list_for_each_entry_rcu(kp, &p->list, list)
|
||||
kp->nmissed++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* Called with kretprobe_lock held */
|
||||
struct kretprobe_instance __kprobes *get_free_rp_inst(struct kretprobe *rp)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue