• Home
  • Raw
  • Download

Lines Matching refs:fp

28 	struct fprobe *fp;  in fprobe_handler()  local
32 fp = container_of(ops, struct fprobe, ops); in fprobe_handler()
33 if (fprobe_disabled(fp)) in fprobe_handler()
38 fp->nmissed++; in fprobe_handler()
42 if (fp->exit_handler) { in fprobe_handler()
43 rh = rethook_try_get(fp->rethook); in fprobe_handler()
45 fp->nmissed++; in fprobe_handler()
50 if (fp->entry_data_size) in fprobe_handler()
54 if (fp->entry_handler) in fprobe_handler()
55 fp->entry_handler(fp, ip, ftrace_get_regs(fregs), entry_data); in fprobe_handler()
68 struct fprobe *fp = container_of(ops, struct fprobe, ops); in fprobe_kprobe_handler() local
71 fp->nmissed++; in fprobe_kprobe_handler()
82 struct fprobe *fp = (struct fprobe *)data; in fprobe_exit_handler() local
85 if (!fp || fprobe_disabled(fp)) in fprobe_exit_handler()
90 fp->exit_handler(fp, fpr->entry_ip, regs, in fprobe_exit_handler()
91 fp->entry_data_size ? (void *)fpr->data : NULL); in fprobe_exit_handler()
123 static void fprobe_init(struct fprobe *fp) in fprobe_init() argument
125 fp->nmissed = 0; in fprobe_init()
126 if (fprobe_shared_with_kprobes(fp)) in fprobe_init()
127 fp->ops.func = fprobe_kprobe_handler; in fprobe_init()
129 fp->ops.func = fprobe_handler; in fprobe_init()
130 fp->ops.flags |= FTRACE_OPS_FL_SAVE_REGS; in fprobe_init()
133 static int fprobe_init_rethook(struct fprobe *fp, int num) in fprobe_init_rethook() argument
140 if (!fp->exit_handler) { in fprobe_init_rethook()
141 fp->rethook = NULL; in fprobe_init_rethook()
146 if (fp->nr_maxactive) in fprobe_init_rethook()
147 size = fp->nr_maxactive; in fprobe_init_rethook()
153 fp->rethook = rethook_alloc((void *)fp, fprobe_exit_handler); in fprobe_init_rethook()
154 if (!fp->rethook) in fprobe_init_rethook()
159 node = kzalloc(sizeof(*node) + fp->entry_data_size, GFP_KERNEL); in fprobe_init_rethook()
161 rethook_free(fp->rethook); in fprobe_init_rethook()
162 fp->rethook = NULL; in fprobe_init_rethook()
165 rethook_add_node(fp->rethook, &node->node); in fprobe_init_rethook()
170 static void fprobe_fail_cleanup(struct fprobe *fp) in fprobe_fail_cleanup() argument
172 if (fp->rethook) { in fprobe_fail_cleanup()
174 rethook_free(fp->rethook); in fprobe_fail_cleanup()
175 fp->rethook = NULL; in fprobe_fail_cleanup()
177 ftrace_free_filter(&fp->ops); in fprobe_fail_cleanup()
191 int register_fprobe(struct fprobe *fp, const char *filter, const char *notfilter) in register_fprobe() argument
197 if (!fp || !filter) in register_fprobe()
200 fprobe_init(fp); in register_fprobe()
204 ret = ftrace_set_filter(&fp->ops, str, len, 0); in register_fprobe()
212 ret = ftrace_set_notrace(&fp->ops, str, len, 0); in register_fprobe()
222 hash = rcu_access_pointer(fp->ops.local_hash.filter_hash); in register_fprobe()
226 ret = fprobe_init_rethook(fp, (int)hash->count); in register_fprobe()
228 ret = register_ftrace_function(&fp->ops); in register_fprobe()
232 fprobe_fail_cleanup(fp); in register_fprobe()
250 int register_fprobe_ips(struct fprobe *fp, unsigned long *addrs, int num) in register_fprobe_ips() argument
254 if (!fp || !addrs || num <= 0) in register_fprobe_ips()
257 fprobe_init(fp); in register_fprobe_ips()
259 ret = ftrace_set_filter_ips(&fp->ops, addrs, num, 0, 0); in register_fprobe_ips()
263 ret = fprobe_init_rethook(fp, num); in register_fprobe_ips()
265 ret = register_ftrace_function(&fp->ops); in register_fprobe_ips()
268 fprobe_fail_cleanup(fp); in register_fprobe_ips()
284 int register_fprobe_syms(struct fprobe *fp, const char **syms, int num) in register_fprobe_syms() argument
289 if (!fp || !syms || num <= 0) in register_fprobe_syms()
296 ret = register_fprobe_ips(fp, addrs, num); in register_fprobe_syms()
312 int unregister_fprobe(struct fprobe *fp) in unregister_fprobe() argument
316 if (!fp || (fp->ops.saved_func != fprobe_handler && in unregister_fprobe()
317 fp->ops.saved_func != fprobe_kprobe_handler)) in unregister_fprobe()
320 if (fp->rethook) in unregister_fprobe()
321 rethook_stop(fp->rethook); in unregister_fprobe()
323 ret = unregister_ftrace_function(&fp->ops); in unregister_fprobe()
327 if (fp->rethook) in unregister_fprobe()
328 rethook_free(fp->rethook); in unregister_fprobe()
330 ftrace_free_filter(&fp->ops); in unregister_fprobe()