1 // SPDX-License-Identifier: GPL-2.0
5 * Part of this code was copied from kernel/trace/trace_kprobe.c written by
6 * Masami Hiramatsu <mhiramat@kernel.org>
8 * Copyright (C) 2021, VMware Inc, Steven Rostedt <rostedt@goodmis.org>
9 * Copyright (C) 2021, VMware Inc, Tzvetomir Stoyanov tz.stoyanov@gmail.com>
12 #include <linux/module.h>
13 #include <linux/mutex.h>
14 #include <linux/ftrace.h>
16 #include "trace_dynevent.h"
17 #include "trace_probe.h"
18 #include "trace_probe_tmpl.h"
20 #define EPROBE_EVENT_SYSTEM "eprobes"
23 /* tracepoint system */
24 const char *event_system;
26 /* tracepoint event */
27 const char *event_name;
29 struct trace_event_call *event;
31 struct dyn_event devent;
32 struct trace_probe tp;
36 struct trace_event_file *file;
37 struct trace_eprobe *ep;
40 static int __trace_eprobe_create(int argc, const char *argv[]);
42 static void trace_event_probe_cleanup(struct trace_eprobe *ep)
46 trace_probe_cleanup(&ep->tp);
47 kfree(ep->event_name);
48 kfree(ep->event_system);
50 trace_event_put_ref(ep->event);
54 static struct trace_eprobe *to_trace_eprobe(struct dyn_event *ev)
56 return container_of(ev, struct trace_eprobe, devent);
59 static int eprobe_dyn_event_create(const char *raw_command)
61 return trace_probe_create(raw_command, __trace_eprobe_create);
64 static int eprobe_dyn_event_show(struct seq_file *m, struct dyn_event *ev)
66 struct trace_eprobe *ep = to_trace_eprobe(ev);
69 seq_printf(m, "e:%s/%s", trace_probe_group_name(&ep->tp),
70 trace_probe_name(&ep->tp));
71 seq_printf(m, " %s.%s", ep->event_system, ep->event_name);
73 for (i = 0; i < ep->tp.nr_args; i++)
74 seq_printf(m, " %s=%s", ep->tp.args[i].name, ep->tp.args[i].comm);
80 static int unregister_trace_eprobe(struct trace_eprobe *ep)
82 /* If other probes are on the event, just unregister eprobe */
83 if (trace_probe_has_sibling(&ep->tp))
86 /* Enabled event can not be unregistered */
87 if (trace_probe_is_enabled(&ep->tp))
90 /* Will fail if probe is being used by ftrace or perf */
91 if (trace_probe_unregister_event_call(&ep->tp))
95 dyn_event_remove(&ep->devent);
96 trace_probe_unlink(&ep->tp);
101 static int eprobe_dyn_event_release(struct dyn_event *ev)
103 struct trace_eprobe *ep = to_trace_eprobe(ev);
104 int ret = unregister_trace_eprobe(ep);
107 trace_event_probe_cleanup(ep);
111 static bool eprobe_dyn_event_is_busy(struct dyn_event *ev)
113 struct trace_eprobe *ep = to_trace_eprobe(ev);
115 return trace_probe_is_enabled(&ep->tp);
118 static bool eprobe_dyn_event_match(const char *system, const char *event,
119 int argc, const char **argv, struct dyn_event *ev)
121 struct trace_eprobe *ep = to_trace_eprobe(ev);
125 * We match the following:
126 * event only - match all eprobes with event name
127 * system and event only - match all system/event probes
128 * system only - match all system probes
130 * The below has the above satisfied with more arguments:
132 * attached system/event - If the arg has the system and event
133 * the probe is attached to, match
134 * probes with the attachment.
136 * If any more args are given, then it requires a full match.
140 * If system exists, but this probe is not part of that system
143 if (system && strcmp(trace_probe_group_name(&ep->tp), system) != 0)
146 /* Must match the event name */
147 if (event[0] != '\0' && strcmp(trace_probe_name(&ep->tp), event) != 0)
150 /* No arguments match all */
154 /* First argument is the system/event the probe is attached to */
156 slash = strchr(argv[0], '/');
158 slash = strchr(argv[0], '.');
162 if (strncmp(ep->event_system, argv[0], slash - argv[0]))
164 if (strcmp(ep->event_name, slash + 1))
170 /* If there are no other args, then match */
174 return trace_probe_match_command_args(&ep->tp, argc, argv);
177 static struct dyn_event_operations eprobe_dyn_event_ops = {
178 .create = eprobe_dyn_event_create,
179 .show = eprobe_dyn_event_show,
180 .is_busy = eprobe_dyn_event_is_busy,
181 .free = eprobe_dyn_event_release,
182 .match = eprobe_dyn_event_match,
185 static struct trace_eprobe *alloc_event_probe(const char *group,
186 const char *this_event,
187 struct trace_event_call *event,
190 struct trace_eprobe *ep;
191 const char *event_name;
192 const char *sys_name;
196 return ERR_PTR(-ENODEV);
198 sys_name = event->class->system;
199 event_name = trace_event_name(event);
201 ep = kzalloc(struct_size(ep, tp.args, nargs), GFP_KERNEL);
203 trace_event_put_ref(event);
207 ep->event_name = kstrdup(event_name, GFP_KERNEL);
210 ep->event_system = kstrdup(sys_name, GFP_KERNEL);
211 if (!ep->event_system)
214 ret = trace_probe_init(&ep->tp, this_event, group, false);
218 dyn_event_init(&ep->devent, &eprobe_dyn_event_ops);
221 trace_event_probe_cleanup(ep);
225 static int trace_eprobe_tp_arg_update(struct trace_eprobe *ep, int i)
227 struct probe_arg *parg = &ep->tp.args[i];
228 struct ftrace_event_field *field;
229 struct list_head *head;
232 head = trace_get_fields(ep->event);
233 list_for_each_entry(field, head, link) {
234 if (!strcmp(parg->code->data, field->name)) {
235 kfree(parg->code->data);
236 parg->code->data = field;
242 * Argument not found on event. But allow for comm and COMM
243 * to be used to get the current->comm.
245 if (strcmp(parg->code->data, "COMM") == 0 ||
246 strcmp(parg->code->data, "comm") == 0) {
247 parg->code->op = FETCH_OP_COMM;
251 kfree(parg->code->data);
252 parg->code->data = NULL;
256 static int eprobe_event_define_fields(struct trace_event_call *event_call)
258 struct eprobe_trace_entry_head field;
259 struct trace_probe *tp;
261 tp = trace_probe_primary_from_call(event_call);
262 if (WARN_ON_ONCE(!tp))
265 return traceprobe_define_arg_fields(event_call, sizeof(field), tp);
268 static struct trace_event_fields eprobe_fields_array[] = {
269 { .type = TRACE_FUNCTION_TYPE,
270 .define_fields = eprobe_event_define_fields },
274 /* Event entry printers */
275 static enum print_line_t
276 print_eprobe_event(struct trace_iterator *iter, int flags,
277 struct trace_event *event)
279 struct eprobe_trace_entry_head *field;
280 struct trace_event_call *pevent;
281 struct trace_event *probed_event;
282 struct trace_seq *s = &iter->seq;
283 struct trace_eprobe *ep;
284 struct trace_probe *tp;
287 field = (struct eprobe_trace_entry_head *)iter->ent;
288 tp = trace_probe_primary_from_call(
289 container_of(event, struct trace_event_call, event));
290 if (WARN_ON_ONCE(!tp))
293 ep = container_of(tp, struct trace_eprobe, tp);
294 type = ep->event->event.type;
296 trace_seq_printf(s, "%s: (", trace_probe_name(tp));
298 probed_event = ftrace_find_event(type);
300 pevent = container_of(probed_event, struct trace_event_call, event);
301 trace_seq_printf(s, "%s.%s", pevent->class->system,
302 trace_event_name(pevent));
304 trace_seq_printf(s, "%u", type);
307 trace_seq_putc(s, ')');
309 if (print_probe_args(s, tp->args, tp->nr_args,
310 (u8 *)&field[1], field) < 0)
313 trace_seq_putc(s, '\n');
315 return trace_handle_return(s);
318 static unsigned long get_event_field(struct fetch_insn *code, void *rec)
320 struct ftrace_event_field *field = code->data;
324 addr = rec + field->offset;
326 if (is_string_field(field)) {
327 switch (field->filter_type) {
328 case FILTER_DYN_STRING:
329 val = (unsigned long)(rec + (*(unsigned int *)addr & 0xffff));
331 case FILTER_RDYN_STRING:
332 val = (unsigned long)(addr + (*(unsigned int *)addr & 0xffff));
334 case FILTER_STATIC_STRING:
335 val = (unsigned long)addr;
337 case FILTER_PTR_STRING:
338 val = (unsigned long)(*(char *)addr);
347 switch (field->size) {
349 if (field->is_signed)
352 val = *(unsigned char *)addr;
355 if (field->is_signed)
356 val = *(short *)addr;
358 val = *(unsigned short *)addr;
361 if (field->is_signed)
364 val = *(unsigned int *)addr;
367 if (field->is_signed)
370 val = *(unsigned long *)addr;
376 static int get_eprobe_size(struct trace_probe *tp, void *rec)
378 struct fetch_insn *code;
379 struct probe_arg *arg;
382 for (i = 0; i < tp->nr_args; i++) {
390 case FETCH_OP_TP_ARG:
391 val = get_event_field(code, rec);
394 val = code->immediate;
397 val = (unsigned long)current->comm;
400 val = (unsigned long)code->data;
402 case FETCH_NOP_SYMBOL: /* Ignore a place holder */
409 len = process_fetch_insn_bottom(code, val, NULL, NULL);
418 /* Kprobe specific fetch functions */
420 /* Note that we don't verify it, since the code does not come from user space */
422 process_fetch_insn(struct fetch_insn *code, void *rec, void *dest,
429 case FETCH_OP_TP_ARG:
430 val = get_event_field(code, rec);
433 val = code->immediate;
436 val = (unsigned long)current->comm;
439 val = (unsigned long)code->data;
441 case FETCH_NOP_SYMBOL: /* Ignore a place holder */
448 return process_fetch_insn_bottom(code, val, dest, base);
450 NOKPROBE_SYMBOL(process_fetch_insn)
452 /* Return the length of string -- including null terminal byte */
453 static nokprobe_inline int
454 fetch_store_strlen_user(unsigned long addr)
456 const void __user *uaddr = (__force const void __user *)addr;
458 return strnlen_user_nofault(uaddr, MAX_STRING_SIZE);
461 /* Return the length of string -- including null terminal byte */
462 static nokprobe_inline int
463 fetch_store_strlen(unsigned long addr)
468 #ifdef CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
469 if (addr < TASK_SIZE)
470 return fetch_store_strlen_user(addr);
474 ret = copy_from_kernel_nofault(&c, (u8 *)addr + len, 1);
476 } while (c && ret == 0 && len < MAX_STRING_SIZE);
478 return (ret < 0) ? ret : len;
482 * Fetch a null-terminated string from user. Caller MUST set *(u32 *)buf
483 * with max length and relative data location.
485 static nokprobe_inline int
486 fetch_store_string_user(unsigned long addr, void *dest, void *base)
488 const void __user *uaddr = (__force const void __user *)addr;
489 int maxlen = get_loc_len(*(u32 *)dest);
493 if (unlikely(!maxlen))
496 __dest = get_loc_data(dest, base);
498 ret = strncpy_from_user_nofault(__dest, uaddr, maxlen);
500 *(u32 *)dest = make_data_loc(ret, __dest - base);
506 * Fetch a null-terminated string. Caller MUST set *(u32 *)buf with max
507 * length and relative data location.
509 static nokprobe_inline int
510 fetch_store_string(unsigned long addr, void *dest, void *base)
512 int maxlen = get_loc_len(*(u32 *)dest);
516 #ifdef CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
517 if ((unsigned long)addr < TASK_SIZE)
518 return fetch_store_string_user(addr, dest, base);
521 if (unlikely(!maxlen))
524 __dest = get_loc_data(dest, base);
527 * Try to get string again, since the string can be changed while
530 ret = strncpy_from_kernel_nofault(__dest, (void *)addr, maxlen);
532 *(u32 *)dest = make_data_loc(ret, __dest - base);
537 static nokprobe_inline int
538 probe_mem_read_user(void *dest, void *src, size_t size)
540 const void __user *uaddr = (__force const void __user *)src;
542 return copy_from_user_nofault(dest, uaddr, size);
545 static nokprobe_inline int
546 probe_mem_read(void *dest, void *src, size_t size)
548 #ifdef CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
549 if ((unsigned long)src < TASK_SIZE)
550 return probe_mem_read_user(dest, src, size);
552 return copy_from_kernel_nofault(dest, src, size);
557 __eprobe_trace_func(struct eprobe_data *edata, void *rec)
559 struct eprobe_trace_entry_head *entry;
560 struct trace_event_call *call = trace_probe_event_call(&edata->ep->tp);
561 struct trace_event_buffer fbuffer;
564 if (WARN_ON_ONCE(call != edata->file->event_call))
567 if (trace_trigger_soft_disabled(edata->file))
570 dsize = get_eprobe_size(&edata->ep->tp, rec);
572 entry = trace_event_buffer_reserve(&fbuffer, edata->file,
573 sizeof(*entry) + edata->ep->tp.size + dsize);
578 entry = fbuffer.entry = ring_buffer_event_data(fbuffer.event);
579 store_trace_args(&entry[1], &edata->ep->tp, rec, sizeof(*entry), dsize);
581 trace_event_buffer_commit(&fbuffer);
585 * The event probe implementation uses event triggers to get access to
586 * the event it is attached to, but is not an actual trigger. The below
587 * functions are just stubs to fulfill what is needed to use the trigger
590 static int eprobe_trigger_init(struct event_trigger_data *data)
595 static void eprobe_trigger_free(struct event_trigger_data *data)
600 static int eprobe_trigger_print(struct seq_file *m,
601 struct event_trigger_data *data)
603 /* Do not print eprobe event triggers */
607 static void eprobe_trigger_func(struct event_trigger_data *data,
608 struct trace_buffer *buffer, void *rec,
609 struct ring_buffer_event *rbe)
611 struct eprobe_data *edata = data->private_data;
613 __eprobe_trace_func(edata, rec);
616 static struct event_trigger_ops eprobe_trigger_ops = {
617 .trigger = eprobe_trigger_func,
618 .print = eprobe_trigger_print,
619 .init = eprobe_trigger_init,
620 .free = eprobe_trigger_free,
623 static int eprobe_trigger_cmd_parse(struct event_command *cmd_ops,
624 struct trace_event_file *file,
625 char *glob, char *cmd,
626 char *param_and_filter)
631 static int eprobe_trigger_reg_func(char *glob,
632 struct event_trigger_data *data,
633 struct trace_event_file *file)
638 static void eprobe_trigger_unreg_func(char *glob,
639 struct event_trigger_data *data,
640 struct trace_event_file *file)
645 static struct event_trigger_ops *eprobe_trigger_get_ops(char *cmd,
648 return &eprobe_trigger_ops;
651 static struct event_command event_trigger_cmd = {
653 .trigger_type = ETT_EVENT_EPROBE,
654 .flags = EVENT_CMD_FL_NEEDS_REC,
655 .parse = eprobe_trigger_cmd_parse,
656 .reg = eprobe_trigger_reg_func,
657 .unreg = eprobe_trigger_unreg_func,
659 .get_trigger_ops = eprobe_trigger_get_ops,
663 static struct event_trigger_data *
664 new_eprobe_trigger(struct trace_eprobe *ep, struct trace_event_file *file)
666 struct event_trigger_data *trigger;
667 struct eprobe_data *edata;
669 edata = kzalloc(sizeof(*edata), GFP_KERNEL);
670 trigger = kzalloc(sizeof(*trigger), GFP_KERNEL);
671 if (!trigger || !edata) {
674 return ERR_PTR(-ENOMEM);
677 trigger->flags = EVENT_TRIGGER_FL_PROBE;
679 trigger->ops = &eprobe_trigger_ops;
682 * EVENT PROBE triggers are not registered as commands with
683 * register_event_command(), as they are not controlled by the user
684 * from the trigger file
686 trigger->cmd_ops = &event_trigger_cmd;
688 INIT_LIST_HEAD(&trigger->list);
689 RCU_INIT_POINTER(trigger->filter, NULL);
693 trigger->private_data = edata;
698 static int enable_eprobe(struct trace_eprobe *ep,
699 struct trace_event_file *eprobe_file)
701 struct event_trigger_data *trigger;
702 struct trace_event_file *file;
703 struct trace_array *tr = eprobe_file->tr;
705 file = find_event_file(tr, ep->event_system, ep->event_name);
708 trigger = new_eprobe_trigger(ep, eprobe_file);
710 return PTR_ERR(trigger);
712 list_add_tail_rcu(&trigger->list, &file->triggers);
714 trace_event_trigger_enable_disable(file, 1);
715 update_cond_flag(file);
720 static struct trace_event_functions eprobe_funcs = {
721 .trace = print_eprobe_event
724 static int disable_eprobe(struct trace_eprobe *ep,
725 struct trace_array *tr)
727 struct event_trigger_data *trigger = NULL, *iter;
728 struct trace_event_file *file;
729 struct eprobe_data *edata;
731 file = find_event_file(tr, ep->event_system, ep->event_name);
735 list_for_each_entry(iter, &file->triggers, list) {
736 if (!(iter->flags & EVENT_TRIGGER_FL_PROBE))
738 edata = iter->private_data;
739 if (edata->ep == ep) {
747 list_del_rcu(&trigger->list);
749 trace_event_trigger_enable_disable(file, 0);
750 update_cond_flag(file);
752 /* Make sure nothing is using the edata or trigger */
753 tracepoint_synchronize_unregister();
761 static int enable_trace_eprobe(struct trace_event_call *call,
762 struct trace_event_file *file)
764 struct trace_probe *pos, *tp;
765 struct trace_eprobe *ep;
769 tp = trace_probe_primary_from_call(call);
770 if (WARN_ON_ONCE(!tp))
772 enabled = trace_probe_is_enabled(tp);
774 /* This also changes "enabled" state */
776 ret = trace_probe_add_file(tp, file);
780 trace_probe_set_flag(tp, TP_FLAG_PROFILE);
785 list_for_each_entry(pos, trace_probe_probe_list(tp), list) {
786 ep = container_of(pos, struct trace_eprobe, tp);
787 ret = enable_eprobe(ep, file);
794 /* Failed to enable one of them. Roll back all */
796 disable_eprobe(ep, file->tr);
798 trace_probe_remove_file(tp, file);
800 trace_probe_clear_flag(tp, TP_FLAG_PROFILE);
806 static int disable_trace_eprobe(struct trace_event_call *call,
807 struct trace_event_file *file)
809 struct trace_probe *pos, *tp;
810 struct trace_eprobe *ep;
812 tp = trace_probe_primary_from_call(call);
813 if (WARN_ON_ONCE(!tp))
817 if (!trace_probe_get_file_link(tp, file))
819 if (!trace_probe_has_single_file(tp))
821 trace_probe_clear_flag(tp, TP_FLAG_TRACE);
823 trace_probe_clear_flag(tp, TP_FLAG_PROFILE);
825 if (!trace_probe_is_enabled(tp)) {
826 list_for_each_entry(pos, trace_probe_probe_list(tp), list) {
827 ep = container_of(pos, struct trace_eprobe, tp);
828 disable_eprobe(ep, file->tr);
835 * Synchronization is done in below function. For perf event,
836 * file == NULL and perf_trace_event_unreg() calls
837 * tracepoint_synchronize_unregister() to ensure synchronize
838 * event. We don't need to care about it.
840 trace_probe_remove_file(tp, file);
845 static int eprobe_register(struct trace_event_call *event,
846 enum trace_reg type, void *data)
848 struct trace_event_file *file = data;
851 case TRACE_REG_REGISTER:
852 return enable_trace_eprobe(event, file);
853 case TRACE_REG_UNREGISTER:
854 return disable_trace_eprobe(event, file);
855 #ifdef CONFIG_PERF_EVENTS
856 case TRACE_REG_PERF_REGISTER:
857 case TRACE_REG_PERF_UNREGISTER:
858 case TRACE_REG_PERF_OPEN:
859 case TRACE_REG_PERF_CLOSE:
860 case TRACE_REG_PERF_ADD:
861 case TRACE_REG_PERF_DEL:
868 static inline void init_trace_eprobe_call(struct trace_eprobe *ep)
870 struct trace_event_call *call = trace_probe_event_call(&ep->tp);
872 call->flags = TRACE_EVENT_FL_EPROBE;
873 call->event.funcs = &eprobe_funcs;
874 call->class->fields_array = eprobe_fields_array;
875 call->class->reg = eprobe_register;
878 static struct trace_event_call *
879 find_and_get_event(const char *system, const char *event_name)
881 struct trace_event_call *tp_event;
884 list_for_each_entry(tp_event, &ftrace_events, list) {
885 /* Skip other probes and ftrace events */
886 if (tp_event->flags &
887 (TRACE_EVENT_FL_IGNORE_ENABLE |
888 TRACE_EVENT_FL_KPROBE |
889 TRACE_EVENT_FL_UPROBE |
890 TRACE_EVENT_FL_EPROBE))
892 if (!tp_event->class->system ||
893 strcmp(system, tp_event->class->system))
895 name = trace_event_name(tp_event);
896 if (!name || strcmp(event_name, name))
898 if (!trace_event_try_get_ref(tp_event)) {
908 static int trace_eprobe_tp_update_arg(struct trace_eprobe *ep, const char *argv[], int i)
910 unsigned int flags = TPARG_FL_KERNEL | TPARG_FL_TPOINT;
913 ret = traceprobe_parse_probe_arg(&ep->tp, i, argv[i], flags);
917 if (ep->tp.args[i].code->op == FETCH_OP_TP_ARG) {
918 ret = trace_eprobe_tp_arg_update(ep, i);
920 trace_probe_log_err(0, BAD_ATTACH_ARG);
923 /* Handle symbols "@" */
925 ret = traceprobe_update_arg(&ep->tp.args[i]);
930 static int __trace_eprobe_create(int argc, const char *argv[])
934 * e[:[GRP/][ENAME]] SYSTEM.EVENT [FETCHARGS]
936 * <name>=$<field>[:TYPE]
938 const char *event = NULL, *group = EPROBE_EVENT_SYSTEM;
939 const char *sys_event = NULL, *sys_name = NULL;
940 struct trace_event_call *event_call;
941 struct trace_eprobe *ep = NULL;
942 char buf1[MAX_EVENT_NAME_LEN];
943 char buf2[MAX_EVENT_NAME_LEN];
944 char gbuf[MAX_EVENT_NAME_LEN];
948 if (argc < 2 || argv[0][0] != 'e')
951 trace_probe_log_init("event_probe", argc, argv);
953 event = strchr(&argv[0][1], ':');
956 ret = traceprobe_parse_event_name(&event, &group, gbuf,
962 trace_probe_log_set_index(1);
964 ret = traceprobe_parse_event_name(&sys_event, &sys_name, buf2, 0);
965 if (ret || !sys_event || !sys_name) {
966 trace_probe_log_err(0, NO_EVENT_INFO);
971 strscpy(buf1, argv[1], MAX_EVENT_NAME_LEN);
972 sanitize_event_name(buf1);
976 mutex_lock(&event_mutex);
977 event_call = find_and_get_event(sys_name, sys_event);
978 ep = alloc_event_probe(group, event, event_call, argc - 2);
979 mutex_unlock(&event_mutex);
984 trace_probe_log_err(0, BAD_ATTACH_EVENT);
985 /* This must return -ENOMEM or missing event, else there is a bug */
986 WARN_ON_ONCE(ret != -ENOMEM && ret != -ENODEV);
991 argc -= 2; argv += 2;
992 /* parse arguments */
993 for (i = 0; i < argc && i < MAX_TRACE_ARGS; i++) {
994 trace_probe_log_set_index(i + 2);
995 ret = trace_eprobe_tp_update_arg(ep, argv, i);
999 ret = traceprobe_set_print_fmt(&ep->tp, PROBE_PRINT_EVENT);
1002 init_trace_eprobe_call(ep);
1003 mutex_lock(&event_mutex);
1004 ret = trace_probe_register_event_call(&ep->tp);
1006 if (ret == -EEXIST) {
1007 trace_probe_log_set_index(0);
1008 trace_probe_log_err(0, EVENT_EXIST);
1010 mutex_unlock(&event_mutex);
1013 ret = dyn_event_add(&ep->devent, &ep->tp.event->call);
1014 mutex_unlock(&event_mutex);
1019 trace_event_probe_cleanup(ep);
1024 * Register dynevent at core_initcall. This allows kernel to setup eprobe
1025 * events in postcore_initcall without tracefs.
1027 static __init int trace_events_eprobe_init_early(void)
1031 err = dyn_event_register(&eprobe_dyn_event_ops);
1033 pr_warn("Could not register eprobe_dyn_event_ops\n");
1037 core_initcall(trace_events_eprobe_init_early);