linux/kernel/trace/trace_eprobe.c

// SPDX-License-Identifier: GPL-2.0
/*
 * event probes
 *
 * Part of this code was copied from kernel/trace/trace_kprobe.c written by
 * Masami Hiramatsu <[email protected]>
 *
 * Copyright (C) 2021, VMware Inc, Steven Rostedt <[email protected]>
 * Copyright (C) 2021, VMware Inc, Tzvetomir Stoyanov [email protected]>
 *
 */
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/ftrace.h>

#include "trace_dynevent.h"
#include "trace_probe.h"
#include "trace_probe_tmpl.h"
#include "trace_probe_kernel.h"

#define EPROBE_EVENT_SYSTEM

struct trace_eprobe {};

struct eprobe_data {};


#define for_each_trace_eprobe_tp(ep, _tp)

static int __trace_eprobe_create(int argc, const char *argv[]);

static void trace_event_probe_cleanup(struct trace_eprobe *ep)
{}

static struct trace_eprobe *to_trace_eprobe(struct dyn_event *ev)
{}

static int eprobe_dyn_event_create(const char *raw_command)
{}

static int eprobe_dyn_event_show(struct seq_file *m, struct dyn_event *ev)
{}

static int unregister_trace_eprobe(struct trace_eprobe *ep)
{}

static int eprobe_dyn_event_release(struct dyn_event *ev)
{}

static bool eprobe_dyn_event_is_busy(struct dyn_event *ev)
{}

static bool eprobe_dyn_event_match(const char *system, const char *event,
			int argc, const char **argv, struct dyn_event *ev)
{}

static struct dyn_event_operations eprobe_dyn_event_ops =;

static struct trace_eprobe *alloc_event_probe(const char *group,
					      const char *this_event,
					      struct trace_event_call *event,
					      int nargs)
{}

static int eprobe_event_define_fields(struct trace_event_call *event_call)
{}

static struct trace_event_fields eprobe_fields_array[] =;

/* Event entry printers */
static enum print_line_t
print_eprobe_event(struct trace_iterator *iter, int flags,
		   struct trace_event *event)
{}

static nokprobe_inline unsigned long
get_event_field(struct fetch_insn *code, void *rec)
{}

static int get_eprobe_size(struct trace_probe *tp, void *rec)
{}

/* Kprobe specific fetch functions */

/* Note that we don't verify it, since the code does not come from user space */
static int
process_fetch_insn(struct fetch_insn *code, void *rec, void *edata,
		   void *dest, void *base)
{}
NOKPROBE_SYMBOL()

/* eprobe handler */
static inline void
__eprobe_trace_func(struct eprobe_data *edata, void *rec)
{}

/*
 * The event probe implementation uses event triggers to get access to
 * the event it is attached to, but is not an actual trigger. The below
 * functions are just stubs to fulfill what is needed to use the trigger
 * infrastructure.
 */
static int eprobe_trigger_init(struct event_trigger_data *data)
{}

static void eprobe_trigger_free(struct event_trigger_data *data)
{}

static int eprobe_trigger_print(struct seq_file *m,
				struct event_trigger_data *data)
{}

static void eprobe_trigger_func(struct event_trigger_data *data,
				struct trace_buffer *buffer, void *rec,
				struct ring_buffer_event *rbe)
{}

static struct event_trigger_ops eprobe_trigger_ops =;

static int eprobe_trigger_cmd_parse(struct event_command *cmd_ops,
				    struct trace_event_file *file,
				    char *glob, char *cmd,
				    char *param_and_filter)
{}

static int eprobe_trigger_reg_func(char *glob,
				   struct event_trigger_data *data,
				   struct trace_event_file *file)
{}

static void eprobe_trigger_unreg_func(char *glob,
				      struct event_trigger_data *data,
				      struct trace_event_file *file)
{}

static struct event_trigger_ops *eprobe_trigger_get_ops(char *cmd,
							char *param)
{}

static struct event_command event_trigger_cmd =;

static struct event_trigger_data *
new_eprobe_trigger(struct trace_eprobe *ep, struct trace_event_file *file)
{}

static int enable_eprobe(struct trace_eprobe *ep,
			 struct trace_event_file *eprobe_file)
{}

static struct trace_event_functions eprobe_funcs =;

static int disable_eprobe(struct trace_eprobe *ep,
			  struct trace_array *tr)
{}

static int enable_trace_eprobe(struct trace_event_call *call,
			       struct trace_event_file *file)
{}

static int disable_trace_eprobe(struct trace_event_call *call,
				struct trace_event_file *file)
{}

static int eprobe_register(struct trace_event_call *event,
			   enum trace_reg type, void *data)
{}

static inline void init_trace_eprobe_call(struct trace_eprobe *ep)
{}

static struct trace_event_call *
find_and_get_event(const char *system, const char *event_name)
{}

static int trace_eprobe_tp_update_arg(struct trace_eprobe *ep, const char *argv[], int i)
{}

static int trace_eprobe_parse_filter(struct trace_eprobe *ep, int argc, const char *argv[])
{}

static int __trace_eprobe_create(int argc, const char *argv[])
{}

/*
 * Register dynevent at core_initcall. This allows kernel to setup eprobe
 * events in postcore_initcall without tracefs.
 */
static __init int trace_events_eprobe_init_early(void)
{}
core_initcall(trace_events_eprobe_init_early);