Lines Matching refs:tk

85 static nokprobe_inline bool trace_kprobe_is_return(struct trace_kprobe *tk)  in trace_kprobe_is_return()  argument
87 return tk->rp.handler != NULL; in trace_kprobe_is_return()
90 static nokprobe_inline const char *trace_kprobe_symbol(struct trace_kprobe *tk) in trace_kprobe_symbol() argument
92 return tk->symbol ? tk->symbol : "unknown"; in trace_kprobe_symbol()
95 static nokprobe_inline unsigned long trace_kprobe_offset(struct trace_kprobe *tk) in trace_kprobe_offset() argument
97 return tk->rp.kp.offset; in trace_kprobe_offset()
100 static nokprobe_inline bool trace_kprobe_has_gone(struct trace_kprobe *tk) in trace_kprobe_has_gone() argument
102 return kprobe_gone(&tk->rp.kp); in trace_kprobe_has_gone()
105 static nokprobe_inline bool trace_kprobe_within_module(struct trace_kprobe *tk, in trace_kprobe_within_module() argument
109 const char *name = trace_kprobe_symbol(tk); in trace_kprobe_within_module()
115 static nokprobe_inline bool trace_kprobe_module_exist(struct trace_kprobe *tk) in trace_kprobe_module_exist() argument
120 if (!tk->symbol) in trace_kprobe_module_exist()
122 p = strchr(tk->symbol, ':'); in trace_kprobe_module_exist()
127 ret = !!find_module(tk->symbol); in trace_kprobe_module_exist()
134 static inline bool trace_kprobe_module_exist(struct trace_kprobe *tk) in trace_kprobe_module_exist() argument
142 struct trace_kprobe *tk = to_trace_kprobe(ev); in trace_kprobe_is_busy() local
144 return trace_probe_is_enabled(&tk->tp); in trace_kprobe_is_busy()
147 static bool trace_kprobe_match_command_head(struct trace_kprobe *tk, in trace_kprobe_match_command_head() argument
155 if (!tk->symbol) in trace_kprobe_match_command_head()
156 snprintf(buf, sizeof(buf), "0x%p", tk->rp.kp.addr); in trace_kprobe_match_command_head()
157 else if (tk->rp.kp.offset) in trace_kprobe_match_command_head()
159 trace_kprobe_symbol(tk), tk->rp.kp.offset); in trace_kprobe_match_command_head()
161 snprintf(buf, sizeof(buf), "%s", trace_kprobe_symbol(tk)); in trace_kprobe_match_command_head()
166 return trace_probe_match_command_args(&tk->tp, argc, argv); in trace_kprobe_match_command_head()
172 struct trace_kprobe *tk = to_trace_kprobe(ev); in trace_kprobe_match() local
175 strcmp(trace_probe_name(&tk->tp), event) == 0) && in trace_kprobe_match()
176 (!system || strcmp(trace_probe_group_name(&tk->tp), system) == 0) && in trace_kprobe_match()
177 trace_kprobe_match_command_head(tk, argc, argv); in trace_kprobe_match()
180 static nokprobe_inline unsigned long trace_kprobe_nhit(struct trace_kprobe *tk) in trace_kprobe_nhit() argument
186 nhit += *per_cpu_ptr(tk->nhit, cpu); in trace_kprobe_nhit()
191 static nokprobe_inline bool trace_kprobe_is_registered(struct trace_kprobe *tk) in trace_kprobe_is_registered() argument
193 return !(list_empty(&tk->rp.kp.list) && in trace_kprobe_is_registered()
194 hlist_unhashed(&tk->rp.kp.hlist)); in trace_kprobe_is_registered()
199 unsigned long trace_kprobe_address(struct trace_kprobe *tk) in trace_kprobe_address() argument
203 if (tk->symbol) { in trace_kprobe_address()
205 kallsyms_lookup_name(trace_kprobe_symbol(tk)); in trace_kprobe_address()
207 addr += tk->rp.kp.offset; in trace_kprobe_address()
209 addr = (unsigned long)tk->rp.kp.addr; in trace_kprobe_address()
228 struct trace_kprobe *tk = trace_kprobe_primary_from_call(call); in trace_kprobe_on_func_entry() local
230 return tk ? (kprobe_on_func_entry(tk->rp.kp.addr, in trace_kprobe_on_func_entry()
231 tk->rp.kp.addr ? NULL : tk->rp.kp.symbol_name, in trace_kprobe_on_func_entry()
232 tk->rp.kp.addr ? 0 : tk->rp.kp.offset) == 0) : false; in trace_kprobe_on_func_entry()
237 struct trace_kprobe *tk = trace_kprobe_primary_from_call(call); in trace_kprobe_error_injectable() local
239 return tk ? within_error_injection_list(trace_kprobe_address(tk)) : in trace_kprobe_error_injectable()
243 static int register_kprobe_event(struct trace_kprobe *tk);
244 static int unregister_kprobe_event(struct trace_kprobe *tk);
250 static void free_trace_kprobe(struct trace_kprobe *tk) in free_trace_kprobe() argument
252 if (tk) { in free_trace_kprobe()
253 trace_probe_cleanup(&tk->tp); in free_trace_kprobe()
254 kfree(tk->symbol); in free_trace_kprobe()
255 free_percpu(tk->nhit); in free_trace_kprobe()
256 kfree(tk); in free_trace_kprobe()
271 struct trace_kprobe *tk; in alloc_trace_kprobe() local
274 tk = kzalloc(struct_size(tk, tp.args, nargs), GFP_KERNEL); in alloc_trace_kprobe()
275 if (!tk) in alloc_trace_kprobe()
278 tk->nhit = alloc_percpu(unsigned long); in alloc_trace_kprobe()
279 if (!tk->nhit) in alloc_trace_kprobe()
283 tk->symbol = kstrdup(symbol, GFP_KERNEL); in alloc_trace_kprobe()
284 if (!tk->symbol) in alloc_trace_kprobe()
286 tk->rp.kp.symbol_name = tk->symbol; in alloc_trace_kprobe()
287 tk->rp.kp.offset = offs; in alloc_trace_kprobe()
289 tk->rp.kp.addr = addr; in alloc_trace_kprobe()
292 tk->rp.handler = kretprobe_dispatcher; in alloc_trace_kprobe()
294 tk->rp.kp.pre_handler = kprobe_dispatcher; in alloc_trace_kprobe()
296 tk->rp.maxactive = maxactive; in alloc_trace_kprobe()
297 INIT_HLIST_NODE(&tk->rp.kp.hlist); in alloc_trace_kprobe()
298 INIT_LIST_HEAD(&tk->rp.kp.list); in alloc_trace_kprobe()
300 ret = trace_probe_init(&tk->tp, event, group, false, nargs); in alloc_trace_kprobe()
304 dyn_event_init(&tk->devent, &trace_kprobe_ops); in alloc_trace_kprobe()
305 return tk; in alloc_trace_kprobe()
307 free_trace_kprobe(tk); in alloc_trace_kprobe()
315 struct trace_kprobe *tk; in find_trace_kprobe() local
317 for_each_trace_kprobe(tk, pos) in find_trace_kprobe()
318 if (strcmp(trace_probe_name(&tk->tp), event) == 0 && in find_trace_kprobe()
319 strcmp(trace_probe_group_name(&tk->tp), group) == 0) in find_trace_kprobe()
320 return tk; in find_trace_kprobe()
324 static inline int __enable_trace_kprobe(struct trace_kprobe *tk) in __enable_trace_kprobe() argument
328 if (trace_kprobe_is_registered(tk) && !trace_kprobe_has_gone(tk)) { in __enable_trace_kprobe()
329 if (trace_kprobe_is_return(tk)) in __enable_trace_kprobe()
330 ret = enable_kretprobe(&tk->rp); in __enable_trace_kprobe()
332 ret = enable_kprobe(&tk->rp.kp); in __enable_trace_kprobe()
340 struct trace_kprobe *tk; in __disable_trace_kprobe() local
342 list_for_each_entry(tk, trace_probe_probe_list(tp), tp.list) { in __disable_trace_kprobe()
343 if (!trace_kprobe_is_registered(tk)) in __disable_trace_kprobe()
345 if (trace_kprobe_is_return(tk)) in __disable_trace_kprobe()
346 disable_kretprobe(&tk->rp); in __disable_trace_kprobe()
348 disable_kprobe(&tk->rp.kp); in __disable_trace_kprobe()
360 struct trace_kprobe *tk; in enable_trace_kprobe() local
380 list_for_each_entry(tk, trace_probe_probe_list(tp), tp.list) { in enable_trace_kprobe()
381 if (trace_kprobe_has_gone(tk)) in enable_trace_kprobe()
383 ret = __enable_trace_kprobe(tk); in enable_trace_kprobe()
459 static bool within_notrace_func(struct trace_kprobe *tk) in within_notrace_func() argument
461 unsigned long addr = trace_kprobe_address(tk); in within_notrace_func()
481 #define within_notrace_func(tk) (false) argument
485 static int __register_trace_kprobe(struct trace_kprobe *tk) in __register_trace_kprobe() argument
493 if (trace_kprobe_is_registered(tk)) in __register_trace_kprobe()
496 if (within_notrace_func(tk)) { in __register_trace_kprobe()
498 (void *)trace_kprobe_address(tk)); in __register_trace_kprobe()
502 for (i = 0; i < tk->tp.nr_args; i++) { in __register_trace_kprobe()
503 ret = traceprobe_update_arg(&tk->tp.args[i]); in __register_trace_kprobe()
509 if (trace_probe_is_enabled(&tk->tp)) in __register_trace_kprobe()
510 tk->rp.kp.flags &= ~KPROBE_FLAG_DISABLED; in __register_trace_kprobe()
512 tk->rp.kp.flags |= KPROBE_FLAG_DISABLED; in __register_trace_kprobe()
514 if (trace_kprobe_is_return(tk)) in __register_trace_kprobe()
515 ret = register_kretprobe(&tk->rp); in __register_trace_kprobe()
517 ret = register_kprobe(&tk->rp.kp); in __register_trace_kprobe()
523 static void __unregister_trace_kprobe(struct trace_kprobe *tk) in __unregister_trace_kprobe() argument
525 if (trace_kprobe_is_registered(tk)) { in __unregister_trace_kprobe()
526 if (trace_kprobe_is_return(tk)) in __unregister_trace_kprobe()
527 unregister_kretprobe(&tk->rp); in __unregister_trace_kprobe()
529 unregister_kprobe(&tk->rp.kp); in __unregister_trace_kprobe()
531 INIT_HLIST_NODE(&tk->rp.kp.hlist); in __unregister_trace_kprobe()
532 INIT_LIST_HEAD(&tk->rp.kp.list); in __unregister_trace_kprobe()
533 if (tk->rp.kp.symbol_name) in __unregister_trace_kprobe()
534 tk->rp.kp.addr = NULL; in __unregister_trace_kprobe()
539 static int unregister_trace_kprobe(struct trace_kprobe *tk) in unregister_trace_kprobe() argument
542 if (trace_probe_has_sibling(&tk->tp)) in unregister_trace_kprobe()
546 if (trace_probe_is_enabled(&tk->tp)) in unregister_trace_kprobe()
550 if (trace_event_dyn_busy(trace_probe_event_call(&tk->tp))) in unregister_trace_kprobe()
554 if (unregister_kprobe_event(tk)) in unregister_trace_kprobe()
558 __unregister_trace_kprobe(tk); in unregister_trace_kprobe()
559 dyn_event_remove(&tk->devent); in unregister_trace_kprobe()
560 trace_probe_unlink(&tk->tp); in unregister_trace_kprobe()
594 static int append_trace_kprobe(struct trace_kprobe *tk, struct trace_kprobe *to) in append_trace_kprobe() argument
598 ret = trace_probe_compare_arg_type(&tk->tp, &to->tp); in append_trace_kprobe()
605 if (trace_kprobe_has_same_kprobe(to, tk)) { in append_trace_kprobe()
612 ret = trace_probe_append(&tk->tp, &to->tp); in append_trace_kprobe()
617 ret = __register_trace_kprobe(tk); in append_trace_kprobe()
618 if (ret == -ENOENT && !trace_kprobe_module_exist(tk)) { in append_trace_kprobe()
624 trace_probe_unlink(&tk->tp); in append_trace_kprobe()
626 dyn_event_add(&tk->devent, trace_probe_event_call(&tk->tp)); in append_trace_kprobe()
632 static int register_trace_kprobe(struct trace_kprobe *tk) in register_trace_kprobe() argument
639 old_tk = find_trace_kprobe(trace_probe_name(&tk->tp), in register_trace_kprobe()
640 trace_probe_group_name(&tk->tp)); in register_trace_kprobe()
642 if (trace_kprobe_is_return(tk) != trace_kprobe_is_return(old_tk)) { in register_trace_kprobe()
647 ret = append_trace_kprobe(tk, old_tk); in register_trace_kprobe()
653 ret = register_kprobe_event(tk); in register_trace_kprobe()
664 ret = __register_trace_kprobe(tk); in register_trace_kprobe()
665 if (ret == -ENOENT && !trace_kprobe_module_exist(tk)) { in register_trace_kprobe()
671 unregister_kprobe_event(tk); in register_trace_kprobe()
673 dyn_event_add(&tk->devent, trace_probe_event_call(&tk->tp)); in register_trace_kprobe()
683 static int register_module_trace_kprobe(struct module *mod, struct trace_kprobe *tk) in register_module_trace_kprobe() argument
688 p = strchr(trace_kprobe_symbol(tk), ':'); in register_module_trace_kprobe()
692 ret = __register_trace_kprobe(tk); in register_module_trace_kprobe()
702 struct trace_kprobe *tk; in trace_kprobe_module_callback() local
710 for_each_trace_kprobe(tk, pos) { in trace_kprobe_module_callback()
711 if (trace_kprobe_within_module(tk, mod)) { in trace_kprobe_module_callback()
713 __unregister_trace_kprobe(tk); in trace_kprobe_module_callback()
714 ret = register_module_trace_kprobe(mod, tk); in trace_kprobe_module_callback()
717 trace_probe_name(&tk->tp), in trace_kprobe_module_callback()
869 struct trace_kprobe *tk = NULL; in __trace_kprobe_create() local
1026 tk = alloc_trace_kprobe(group, event, addr, symbol, offset, maxactive, in __trace_kprobe_create()
1028 if (IS_ERR(tk)) { in __trace_kprobe_create()
1029 ret = PTR_ERR(tk); in __trace_kprobe_create()
1039 ret = traceprobe_parse_probe_arg(&tk->tp, i, argv[i], &ctx); in __trace_kprobe_create()
1044 if (is_return && tk->tp.entry_arg) { in __trace_kprobe_create()
1045 tk->rp.entry_handler = trace_kprobe_entry_handler; in __trace_kprobe_create()
1046 tk->rp.data_size = traceprobe_get_entry_data_size(&tk->tp); in __trace_kprobe_create()
1050 ret = traceprobe_set_print_fmt(&tk->tp, ptype); in __trace_kprobe_create()
1054 ret = register_trace_kprobe(tk); in __trace_kprobe_create()
1077 free_trace_kprobe(tk); in __trace_kprobe_create()
1266 struct trace_kprobe *tk = to_trace_kprobe(ev); in trace_kprobe_release() local
1267 int ret = unregister_trace_kprobe(tk); in trace_kprobe_release()
1270 free_trace_kprobe(tk); in trace_kprobe_release()
1276 struct trace_kprobe *tk = to_trace_kprobe(ev); in trace_kprobe_show() local
1279 seq_putc(m, trace_kprobe_is_return(tk) ? 'r' : 'p'); in trace_kprobe_show()
1280 if (trace_kprobe_is_return(tk) && tk->rp.maxactive) in trace_kprobe_show()
1281 seq_printf(m, "%d", tk->rp.maxactive); in trace_kprobe_show()
1282 seq_printf(m, ":%s/%s", trace_probe_group_name(&tk->tp), in trace_kprobe_show()
1283 trace_probe_name(&tk->tp)); in trace_kprobe_show()
1285 if (!tk->symbol) in trace_kprobe_show()
1286 seq_printf(m, " 0x%p", tk->rp.kp.addr); in trace_kprobe_show()
1287 else if (tk->rp.kp.offset) in trace_kprobe_show()
1288 seq_printf(m, " %s+%u", trace_kprobe_symbol(tk), in trace_kprobe_show()
1289 tk->rp.kp.offset); in trace_kprobe_show()
1291 seq_printf(m, " %s", trace_kprobe_symbol(tk)); in trace_kprobe_show()
1293 for (i = 0; i < tk->tp.nr_args; i++) in trace_kprobe_show()
1294 seq_printf(m, " %s=%s", tk->tp.args[i].name, tk->tp.args[i].comm); in trace_kprobe_show()
1350 static unsigned long trace_kprobe_missed(struct trace_kprobe *tk) in trace_kprobe_missed() argument
1352 return trace_kprobe_is_return(tk) ? in trace_kprobe_missed()
1353 tk->rp.kp.nmissed + tk->rp.nmissed : tk->rp.kp.nmissed; in trace_kprobe_missed()
1360 struct trace_kprobe *tk; in probes_profile_seq_show() local
1366 tk = to_trace_kprobe(ev); in probes_profile_seq_show()
1367 nmissed = trace_kprobe_missed(tk); in probes_profile_seq_show()
1369 trace_probe_name(&tk->tp), in probes_profile_seq_show()
1370 trace_kprobe_nhit(tk), in probes_profile_seq_show()
1450 __kprobe_trace_func(struct trace_kprobe *tk, struct pt_regs *regs, in NOKPROBE_SYMBOL()
1454 struct trace_event_call *call = trace_probe_event_call(&tk->tp); in NOKPROBE_SYMBOL()
1463 dsize = __get_data_size(&tk->tp, regs, NULL); in NOKPROBE_SYMBOL()
1466 sizeof(*entry) + tk->tp.size + dsize); in NOKPROBE_SYMBOL()
1471 entry->ip = (unsigned long)tk->rp.kp.addr; in NOKPROBE_SYMBOL()
1472 store_trace_args(&entry[1], &tk->tp, regs, NULL, sizeof(*entry), dsize); in NOKPROBE_SYMBOL()
1478 kprobe_trace_func(struct trace_kprobe *tk, struct pt_regs *regs) in kprobe_trace_func() argument
1482 trace_probe_for_each_link_rcu(link, &tk->tp) in kprobe_trace_func()
1483 __kprobe_trace_func(tk, regs, link->file); in kprobe_trace_func()
1493 struct trace_kprobe *tk; in trace_kprobe_entry_handler() local
1503 tk = container_of(rp, struct trace_kprobe, rp); in trace_kprobe_entry_handler()
1506 if (tk->tp.entry_arg) in trace_kprobe_entry_handler()
1507 store_trace_entry_data(ri->data, &tk->tp, regs); in trace_kprobe_entry_handler()
1514 __kretprobe_trace_func(struct trace_kprobe *tk, struct kretprobe_instance *ri, in __kretprobe_trace_func() argument
1520 struct trace_event_call *call = trace_probe_event_call(&tk->tp); in __kretprobe_trace_func()
1528 dsize = __get_data_size(&tk->tp, regs, ri->data); in __kretprobe_trace_func()
1531 sizeof(*entry) + tk->tp.size + dsize); in __kretprobe_trace_func()
1536 entry->func = (unsigned long)tk->rp.kp.addr; in __kretprobe_trace_func()
1538 store_trace_args(&entry[1], &tk->tp, regs, ri->data, sizeof(*entry), dsize); in __kretprobe_trace_func()
1544 kretprobe_trace_func(struct trace_kprobe *tk, struct kretprobe_instance *ri, in kretprobe_trace_func() argument
1549 trace_probe_for_each_link_rcu(link, &tk->tp) in kretprobe_trace_func()
1550 __kretprobe_trace_func(tk, ri, regs, link->file); in kretprobe_trace_func()
1657 kprobe_perf_func(struct trace_kprobe *tk, struct pt_regs *regs) in kprobe_perf_func() argument
1659 struct trace_event_call *call = trace_probe_event_call(&tk->tp); in kprobe_perf_func()
1686 dsize = __get_data_size(&tk->tp, regs, NULL); in kprobe_perf_func()
1687 __size = sizeof(*entry) + tk->tp.size + dsize; in kprobe_perf_func()
1695 entry->ip = (unsigned long)tk->rp.kp.addr; in kprobe_perf_func()
1697 store_trace_args(&entry[1], &tk->tp, regs, NULL, sizeof(*entry), dsize); in kprobe_perf_func()
1706 kretprobe_perf_func(struct trace_kprobe *tk, struct kretprobe_instance *ri, in kretprobe_perf_func() argument
1709 struct trace_event_call *call = trace_probe_event_call(&tk->tp); in kretprobe_perf_func()
1722 dsize = __get_data_size(&tk->tp, regs, ri->data); in kretprobe_perf_func()
1723 __size = sizeof(*entry) + tk->tp.size + dsize; in kretprobe_perf_func()
1731 entry->func = (unsigned long)tk->rp.kp.addr; in kretprobe_perf_func()
1733 store_trace_args(&entry[1], &tk->tp, regs, ri->data, sizeof(*entry), dsize); in kretprobe_perf_func()
1746 struct trace_kprobe *tk; in bpf_get_kprobe_info() local
1749 tk = find_trace_kprobe(pevent, group); in bpf_get_kprobe_info()
1751 tk = trace_kprobe_primary_from_call(event->tp_event); in bpf_get_kprobe_info()
1752 if (!tk) in bpf_get_kprobe_info()
1755 *fd_type = trace_kprobe_is_return(tk) ? BPF_FD_TYPE_KRETPROBE in bpf_get_kprobe_info()
1757 *probe_offset = tk->rp.kp.offset; in bpf_get_kprobe_info()
1759 (unsigned long)tk->rp.kp.addr : 0; in bpf_get_kprobe_info()
1760 *symbol = tk->symbol; in bpf_get_kprobe_info()
1762 *missed = trace_kprobe_missed(tk); in bpf_get_kprobe_info()
1801 struct trace_kprobe *tk = container_of(kp, struct trace_kprobe, rp.kp); in kprobe_dispatcher() local
1804 raw_cpu_inc(*tk->nhit); in kprobe_dispatcher()
1806 if (trace_probe_test_flag(&tk->tp, TP_FLAG_TRACE)) in kprobe_dispatcher()
1807 kprobe_trace_func(tk, regs); in kprobe_dispatcher()
1809 if (trace_probe_test_flag(&tk->tp, TP_FLAG_PROFILE)) in kprobe_dispatcher()
1810 ret = kprobe_perf_func(tk, regs); in kprobe_dispatcher()
1820 struct trace_kprobe *tk; in kretprobe_dispatcher() local
1830 tk = container_of(rp, struct trace_kprobe, rp); in kretprobe_dispatcher()
1831 raw_cpu_inc(*tk->nhit); in kretprobe_dispatcher()
1833 if (trace_probe_test_flag(&tk->tp, TP_FLAG_TRACE)) in kretprobe_dispatcher()
1834 kretprobe_trace_func(tk, ri, regs); in kretprobe_dispatcher()
1836 if (trace_probe_test_flag(&tk->tp, TP_FLAG_PROFILE)) in kretprobe_dispatcher()
1837 kretprobe_perf_func(tk, ri, regs); in kretprobe_dispatcher()
1863 static inline void init_trace_event_call(struct trace_kprobe *tk) in init_trace_event_call() argument
1865 struct trace_event_call *call = trace_probe_event_call(&tk->tp); in init_trace_event_call()
1867 if (trace_kprobe_is_return(tk)) { in init_trace_event_call()
1879 static int register_kprobe_event(struct trace_kprobe *tk) in register_kprobe_event() argument
1881 init_trace_event_call(tk); in register_kprobe_event()
1883 return trace_probe_register_event_call(&tk->tp); in register_kprobe_event()
1886 static int unregister_kprobe_event(struct trace_kprobe *tk) in unregister_kprobe_event() argument
1888 return trace_probe_unregister_event_call(&tk->tp); in unregister_kprobe_event()
1899 struct trace_kprobe *tk; in create_local_trace_kprobe() local
1916 tk = alloc_trace_kprobe(KPROBE_EVENT_SYSTEM, event, (void *)addr, func, in create_local_trace_kprobe()
1920 if (IS_ERR(tk)) { in create_local_trace_kprobe()
1922 (int)PTR_ERR(tk)); in create_local_trace_kprobe()
1923 return ERR_CAST(tk); in create_local_trace_kprobe()
1926 init_trace_event_call(tk); in create_local_trace_kprobe()
1928 ptype = trace_kprobe_is_return(tk) ? in create_local_trace_kprobe()
1930 if (traceprobe_set_print_fmt(&tk->tp, ptype) < 0) { in create_local_trace_kprobe()
1935 ret = __register_trace_kprobe(tk); in create_local_trace_kprobe()
1939 return trace_probe_event_call(&tk->tp); in create_local_trace_kprobe()
1941 free_trace_kprobe(tk); in create_local_trace_kprobe()
1947 struct trace_kprobe *tk; in destroy_local_trace_kprobe() local
1949 tk = trace_kprobe_primary_from_call(event_call); in destroy_local_trace_kprobe()
1950 if (unlikely(!tk)) in destroy_local_trace_kprobe()
1953 if (trace_probe_is_enabled(&tk->tp)) { in destroy_local_trace_kprobe()
1958 __unregister_trace_kprobe(tk); in destroy_local_trace_kprobe()
1960 free_trace_kprobe(tk); in destroy_local_trace_kprobe()
1968 struct trace_kprobe *tk; in enable_boot_kprobe_events() local
1972 for_each_trace_kprobe(tk, pos) { in enable_boot_kprobe_events()
1974 if (file->event_call == trace_probe_event_call(&tk->tp)) in enable_boot_kprobe_events()
2047 find_trace_probe_file(struct trace_kprobe *tk, struct trace_array *tr) in find_trace_probe_file() argument
2052 if (file->event_call == trace_probe_event_call(&tk->tp)) in find_trace_probe_file()
2066 struct trace_kprobe *tk; in kprobe_trace_self_tests_init() local
2084 tk = find_trace_kprobe("testprobe", KPROBE_EVENT_SYSTEM); in kprobe_trace_self_tests_init()
2085 if (WARN_ONCE(tk == NULL, "error on probing function entry.")) { in kprobe_trace_self_tests_init()
2088 file = find_trace_probe_file(tk, top_trace_array()); in kprobe_trace_self_tests_init()
2093 trace_probe_event_call(&tk->tp), file); in kprobe_trace_self_tests_init()
2102 tk = find_trace_kprobe("testprobe2", KPROBE_EVENT_SYSTEM); in kprobe_trace_self_tests_init()
2103 if (WARN_ONCE(tk == NULL, "error on getting 2nd new probe.")) { in kprobe_trace_self_tests_init()
2106 file = find_trace_probe_file(tk, top_trace_array()); in kprobe_trace_self_tests_init()
2111 trace_probe_event_call(&tk->tp), file); in kprobe_trace_self_tests_init()
2129 tk = find_trace_kprobe("testprobe", KPROBE_EVENT_SYSTEM); in kprobe_trace_self_tests_init()
2130 if (WARN_ONCE(tk == NULL, "error on getting test probe.")) { in kprobe_trace_self_tests_init()
2133 if (WARN_ONCE(trace_kprobe_nhit(tk) != 1, in kprobe_trace_self_tests_init()
2137 file = find_trace_probe_file(tk, top_trace_array()); in kprobe_trace_self_tests_init()
2142 trace_probe_event_call(&tk->tp), file); in kprobe_trace_self_tests_init()
2145 tk = find_trace_kprobe("testprobe2", KPROBE_EVENT_SYSTEM); in kprobe_trace_self_tests_init()
2146 if (WARN_ONCE(tk == NULL, "error on getting 2nd test probe.")) { in kprobe_trace_self_tests_init()
2149 if (WARN_ONCE(trace_kprobe_nhit(tk) != 1, in kprobe_trace_self_tests_init()
2153 file = find_trace_probe_file(tk, top_trace_array()); in kprobe_trace_self_tests_init()
2158 trace_probe_event_call(&tk->tp), file); in kprobe_trace_self_tests_init()