#include <linux/module.h>
#include <linux/kprobes.h>
#include <linux/security.h>
#include "trace.h"
#include "trace_probe.h"
static char __percpu *perf_trace_buf[PERF_NR_CONTEXTS];
perf_trace_t;
static int total_ref_count;
static int perf_trace_event_perm(struct trace_event_call *tp_event,
struct perf_event *p_event)
{ … }
static int perf_trace_event_reg(struct trace_event_call *tp_event,
struct perf_event *p_event)
{ … }
static void perf_trace_event_unreg(struct perf_event *p_event)
{ … }
static int perf_trace_event_open(struct perf_event *p_event)
{ … }
static void perf_trace_event_close(struct perf_event *p_event)
{ … }
static int perf_trace_event_init(struct trace_event_call *tp_event,
struct perf_event *p_event)
{ … }
int perf_trace_init(struct perf_event *p_event)
{ … }
void perf_trace_destroy(struct perf_event *p_event)
{ … }
#ifdef CONFIG_KPROBE_EVENTS
int perf_kprobe_init(struct perf_event *p_event, bool is_retprobe)
{ … }
void perf_kprobe_destroy(struct perf_event *p_event)
{ … }
#endif
#ifdef CONFIG_UPROBE_EVENTS
int perf_uprobe_init(struct perf_event *p_event,
unsigned long ref_ctr_offset, bool is_retprobe)
{ … }
void perf_uprobe_destroy(struct perf_event *p_event)
{ … }
#endif
int perf_trace_add(struct perf_event *p_event, int flags)
{ … }
void perf_trace_del(struct perf_event *p_event, int flags)
{ … }
void *perf_trace_buf_alloc(int size, struct pt_regs **regs, int *rctxp)
{ … }
EXPORT_SYMBOL_GPL(…);
NOKPROBE_SYMBOL(perf_trace_buf_alloc);
void perf_trace_buf_update(void *record, u16 type)
{ … }
NOKPROBE_SYMBOL(perf_trace_buf_update);
#ifdef CONFIG_FUNCTION_TRACER
static void
perf_ftrace_function_call(unsigned long ip, unsigned long parent_ip,
struct ftrace_ops *ops, struct ftrace_regs *fregs)
{ … }
static int perf_ftrace_function_register(struct perf_event *event)
{ … }
static int perf_ftrace_function_unregister(struct perf_event *event)
{ … }
int perf_ftrace_event_register(struct trace_event_call *call,
enum trace_reg type, void *data)
{ … }
#endif