Lines Matching refs:kp

357 static inline void set_kprobe_instance(struct kprobe *kp)  in set_kprobe_instance()  argument
359 __this_cpu_write(kprobe_instance, kp); in set_kprobe_instance()
421 struct kprobe *kp; in opt_pre_handler() local
423 list_for_each_entry_rcu(kp, &p->list, list) { in opt_pre_handler()
424 if (kp->pre_handler && likely(!kprobe_disabled(kp))) { in opt_pre_handler()
425 set_kprobe_instance(kp); in opt_pre_handler()
426 kp->pre_handler(kp, regs); in opt_pre_handler()
438 op = container_of(p, struct optimized_kprobe, kp); in free_aggr_kprobe()
450 op = container_of(p, struct optimized_kprobe, kp); in kprobe_optready()
466 op = container_of(p, struct optimized_kprobe, kp); in kprobe_disarmed()
477 op = container_of(p, struct optimized_kprobe, kp); in kprobe_queued()
499 op = container_of(p, struct optimized_kprobe, kp); in get_optimized_kprobe()
563 op->kp.flags &= ~KPROBE_FLAG_OPTIMIZED; in do_unoptimize_kprobes()
565 if (kprobe_disabled(&op->kp)) in do_unoptimize_kprobes()
566 arch_disarm_kprobe(&op->kp); in do_unoptimize_kprobes()
567 if (kprobe_unused(&op->kp)) { in do_unoptimize_kprobes()
573 hlist_del_rcu(&op->kp.hlist); in do_unoptimize_kprobes()
586 if (WARN_ON_ONCE(!kprobe_unused(&op->kp))) { in do_free_cleaned_kprobes()
593 free_aggr_kprobe(&op->kp); in do_free_cleaned_kprobes()
688 op = container_of(p, struct optimized_kprobe, kp); in optimize_kprobe()
695 if (op->kp.flags & KPROBE_FLAG_OPTIMIZED) { in optimize_kprobe()
702 op->kp.flags |= KPROBE_FLAG_OPTIMIZED; in optimize_kprobe()
720 op->kp.flags &= ~KPROBE_FLAG_OPTIMIZED; in force_unoptimize_kprobe()
731 op = container_of(p, struct optimized_kprobe, kp); in unoptimize_kprobe()
749 op->kp.flags &= ~KPROBE_FLAG_OPTIMIZED; in unoptimize_kprobe()
773 op = container_of(ap, struct optimized_kprobe, kp); in reuse_unused_kprobe()
790 op = container_of(p, struct optimized_kprobe, kp); in kill_optimized_kprobe()
794 op->kp.flags &= ~KPROBE_FLAG_OPTIMIZED; in kill_optimized_kprobe()
804 hlist_del_rcu(&op->kp.hlist); in kill_optimized_kprobe()
823 op = container_of(p, struct optimized_kprobe, kp); in prepare_optimized_kprobe()
837 op->kp.addr = p->addr; in alloc_aggr_kprobe()
840 return &op->kp; in alloc_aggr_kprobe()
867 op = container_of(ap, struct optimized_kprobe, kp); in try_to_optimize_kprobe()
1142 static int arm_kprobe(struct kprobe *kp) in arm_kprobe() argument
1144 if (unlikely(kprobe_ftrace(kp))) in arm_kprobe()
1145 return arm_kprobe_ftrace(kp); in arm_kprobe()
1149 __arm_kprobe(kp); in arm_kprobe()
1156 static int disarm_kprobe(struct kprobe *kp, bool reopt) in disarm_kprobe() argument
1158 if (unlikely(kprobe_ftrace(kp))) in disarm_kprobe()
1159 return disarm_kprobe_ftrace(kp); in disarm_kprobe()
1163 __disarm_kprobe(kp, reopt); in disarm_kprobe()
1176 struct kprobe *kp; in aggr_pre_handler() local
1178 list_for_each_entry_rcu(kp, &p->list, list) { in aggr_pre_handler()
1179 if (kp->pre_handler && likely(!kprobe_disabled(kp))) { in aggr_pre_handler()
1180 set_kprobe_instance(kp); in aggr_pre_handler()
1181 if (kp->pre_handler(kp, regs)) in aggr_pre_handler()
1193 struct kprobe *kp; in aggr_post_handler() local
1195 list_for_each_entry_rcu(kp, &p->list, list) { in aggr_post_handler()
1196 if (kp->post_handler && likely(!kprobe_disabled(kp))) { in aggr_post_handler()
1197 set_kprobe_instance(kp); in aggr_post_handler()
1198 kp->post_handler(kp, regs, flags); in aggr_post_handler()
1208 struct kprobe *kp; in kprobes_inc_nmissed_count() local
1213 list_for_each_entry_rcu(kp, &p->list, list) in kprobes_inc_nmissed_count()
1214 kp->nmissed++; in kprobes_inc_nmissed_count()
1683 struct kprobe *kp; in aggr_kprobe_disabled() local
1687 list_for_each_entry(kp, &ap->list, list) in aggr_kprobe_disabled()
1688 if (!kprobe_disabled(kp)) in aggr_kprobe_disabled()
1968 __this_cpu_write(current_kprobe, &rp->kp); in __kretprobe_trampoline_handler()
2004 struct kretprobe *rp = container_of(p, struct kretprobe, kp); in NOKPROBE_SYMBOL()
2070 ret = kprobe_on_func_entry(rp->kp.addr, rp->kp.symbol_name, rp->kp.offset); in register_kretprobe()
2075 if (rp->kp.addr && warn_kprobe_rereg(&rp->kp)) in register_kretprobe()
2079 addr = kprobe_addr(&rp->kp); in register_kretprobe()
2092 rp->kp.pre_handler = pre_handler_kretprobe; in register_kretprobe()
2093 rp->kp.post_handler = NULL; in register_kretprobe()
2124 ret = register_kprobe(&rp->kp); in register_kretprobe()
2163 if (__unregister_kprobe_top(&rps[i]->kp) < 0) in unregister_kretprobes()
2164 rps[i]->kp.addr = NULL; in unregister_kretprobes()
2171 if (rps[i]->kp.addr) { in unregister_kretprobes()
2172 __unregister_kprobe_bottom(&rps[i]->kp); in unregister_kretprobes()
2213 struct kprobe *kp; in kill_kprobe() local
2223 list_for_each_entry(kp, &p->list, list) in kill_kprobe()
2224 kp->flags |= KPROBE_FLAG_GONE; in kill_kprobe()
2244 int disable_kprobe(struct kprobe *kp) in disable_kprobe() argument
2252 p = __disable_kprobe(kp); in disable_kprobe()
2262 int enable_kprobe(struct kprobe *kp) in enable_kprobe() argument
2270 p = __get_valid_kprobe(kp); in enable_kprobe()
2276 if (kprobe_gone(kp)) { in enable_kprobe()
2282 if (p != kp) in enable_kprobe()
2283 kp->flags &= ~KPROBE_FLAG_DISABLED; in enable_kprobe()
2298 void dump_kprobe(struct kprobe *kp) in dump_kprobe() argument
2301 kp->symbol_name, kp->offset, kp->addr); in dump_kprobe()
2659 struct kprobe *p, *kp; in show_kprobe_addr() local
2671 list_for_each_entry_rcu(kp, &p->list, list) in show_kprobe_addr()
2672 report_probe(pi, kp, sym, offset, modname, p); in show_kprobe_addr()