#include <linux/ring_buffer.h>
#include <linux/debugfs.h>
#include <linux/uaccess.h>
#include <linux/ftrace.h>
#include <linux/slab.h>
#include <linux/fs.h>
#include "trace.h"
static void tracing_start_function_trace(struct trace_array *tr);
static void tracing_stop_function_trace(struct trace_array *tr);
static void
function_trace_call(unsigned long ip, unsigned long parent_ip,
struct ftrace_ops *op, struct ftrace_regs *fregs);
static void
function_stack_trace_call(unsigned long ip, unsigned long parent_ip,
struct ftrace_ops *op, struct ftrace_regs *fregs);
static void
function_no_repeats_trace_call(unsigned long ip, unsigned long parent_ip,
struct ftrace_ops *op, struct ftrace_regs *fregs);
static void
function_stack_no_repeats_trace_call(unsigned long ip, unsigned long parent_ip,
struct ftrace_ops *op,
struct ftrace_regs *fregs);
static struct tracer_flags func_flags;
enum { … };
#define TRACE_FUNC_OPT_MASK …
int ftrace_allocate_ftrace_ops(struct trace_array *tr)
{ … }
void ftrace_free_ftrace_ops(struct trace_array *tr)
{ … }
int ftrace_create_function_files(struct trace_array *tr,
struct dentry *parent)
{ … }
void ftrace_destroy_function_files(struct trace_array *tr)
{ … }
static ftrace_func_t select_trace_function(u32 flags_val)
{ … }
static bool handle_func_repeats(struct trace_array *tr, u32 flags_val)
{ … }
static int function_trace_init(struct trace_array *tr)
{ … }
static void function_trace_reset(struct trace_array *tr)
{ … }
static void function_trace_start(struct trace_array *tr)
{ … }
static void
function_trace_call(unsigned long ip, unsigned long parent_ip,
struct ftrace_ops *op, struct ftrace_regs *fregs)
{ … }
#ifdef CONFIG_UNWINDER_ORC
#define STACK_SKIP …
#else
#define STACK_SKIP …
#endif
static void
function_stack_trace_call(unsigned long ip, unsigned long parent_ip,
struct ftrace_ops *op, struct ftrace_regs *fregs)
{ … }
static inline bool is_repeat_check(struct trace_array *tr,
struct trace_func_repeats *last_info,
unsigned long ip, unsigned long parent_ip)
{ … }
static inline void process_repeats(struct trace_array *tr,
unsigned long ip, unsigned long parent_ip,
struct trace_func_repeats *last_info,
unsigned int trace_ctx)
{ … }
static void
function_no_repeats_trace_call(unsigned long ip, unsigned long parent_ip,
struct ftrace_ops *op,
struct ftrace_regs *fregs)
{ … }
static void
function_stack_no_repeats_trace_call(unsigned long ip, unsigned long parent_ip,
struct ftrace_ops *op,
struct ftrace_regs *fregs)
{ … }
static struct tracer_opt func_opts[] = …;
static struct tracer_flags func_flags = …;
static void tracing_start_function_trace(struct trace_array *tr)
{ … }
static void tracing_stop_function_trace(struct trace_array *tr)
{ … }
static struct tracer function_trace;
static int
func_set_flag(struct trace_array *tr, u32 old_flags, u32 bit, int set)
{ … }
static struct tracer function_trace __tracer_data = …;
#ifdef CONFIG_DYNAMIC_FTRACE
static void update_traceon_count(struct ftrace_probe_ops *ops,
unsigned long ip,
struct trace_array *tr, bool on,
void *data)
{ … }
static void
ftrace_traceon_count(unsigned long ip, unsigned long parent_ip,
struct trace_array *tr, struct ftrace_probe_ops *ops,
void *data)
{ … }
static void
ftrace_traceoff_count(unsigned long ip, unsigned long parent_ip,
struct trace_array *tr, struct ftrace_probe_ops *ops,
void *data)
{ … }
static void
ftrace_traceon(unsigned long ip, unsigned long parent_ip,
struct trace_array *tr, struct ftrace_probe_ops *ops,
void *data)
{ … }
static void
ftrace_traceoff(unsigned long ip, unsigned long parent_ip,
struct trace_array *tr, struct ftrace_probe_ops *ops,
void *data)
{ … }
#ifdef CONFIG_UNWINDER_ORC
#define FTRACE_STACK_SKIP …
#else
#define FTRACE_STACK_SKIP …
#endif
static __always_inline void trace_stack(struct trace_array *tr)
{ … }
static void
ftrace_stacktrace(unsigned long ip, unsigned long parent_ip,
struct trace_array *tr, struct ftrace_probe_ops *ops,
void *data)
{ … }
static void
ftrace_stacktrace_count(unsigned long ip, unsigned long parent_ip,
struct trace_array *tr, struct ftrace_probe_ops *ops,
void *data)
{ … }
static int update_count(struct ftrace_probe_ops *ops, unsigned long ip,
void *data)
{ … }
static void
ftrace_dump_probe(unsigned long ip, unsigned long parent_ip,
struct trace_array *tr, struct ftrace_probe_ops *ops,
void *data)
{ … }
static void
ftrace_cpudump_probe(unsigned long ip, unsigned long parent_ip,
struct trace_array *tr, struct ftrace_probe_ops *ops,
void *data)
{ … }
static int
ftrace_probe_print(const char *name, struct seq_file *m,
unsigned long ip, struct ftrace_probe_ops *ops,
void *data)
{ … }
static int
ftrace_traceon_print(struct seq_file *m, unsigned long ip,
struct ftrace_probe_ops *ops,
void *data)
{ … }
static int
ftrace_traceoff_print(struct seq_file *m, unsigned long ip,
struct ftrace_probe_ops *ops, void *data)
{ … }
static int
ftrace_stacktrace_print(struct seq_file *m, unsigned long ip,
struct ftrace_probe_ops *ops, void *data)
{ … }
static int
ftrace_dump_print(struct seq_file *m, unsigned long ip,
struct ftrace_probe_ops *ops, void *data)
{ … }
static int
ftrace_cpudump_print(struct seq_file *m, unsigned long ip,
struct ftrace_probe_ops *ops, void *data)
{ … }
static int
ftrace_count_init(struct ftrace_probe_ops *ops, struct trace_array *tr,
unsigned long ip, void *init_data, void **data)
{ … }
static void
ftrace_count_free(struct ftrace_probe_ops *ops, struct trace_array *tr,
unsigned long ip, void *data)
{ … }
static struct ftrace_probe_ops traceon_count_probe_ops = …;
static struct ftrace_probe_ops traceoff_count_probe_ops = …;
static struct ftrace_probe_ops stacktrace_count_probe_ops = …;
static struct ftrace_probe_ops dump_probe_ops = …;
static struct ftrace_probe_ops cpudump_probe_ops = …;
static struct ftrace_probe_ops traceon_probe_ops = …;
static struct ftrace_probe_ops traceoff_probe_ops = …;
static struct ftrace_probe_ops stacktrace_probe_ops = …;
static int
ftrace_trace_probe_callback(struct trace_array *tr,
struct ftrace_probe_ops *ops,
struct ftrace_hash *hash, char *glob,
char *cmd, char *param, int enable)
{ … }
static int
ftrace_trace_onoff_callback(struct trace_array *tr, struct ftrace_hash *hash,
char *glob, char *cmd, char *param, int enable)
{ … }
static int
ftrace_stacktrace_callback(struct trace_array *tr, struct ftrace_hash *hash,
char *glob, char *cmd, char *param, int enable)
{ … }
static int
ftrace_dump_callback(struct trace_array *tr, struct ftrace_hash *hash,
char *glob, char *cmd, char *param, int enable)
{ … }
static int
ftrace_cpudump_callback(struct trace_array *tr, struct ftrace_hash *hash,
char *glob, char *cmd, char *param, int enable)
{ … }
static struct ftrace_func_command ftrace_traceon_cmd = …;
static struct ftrace_func_command ftrace_traceoff_cmd = …;
static struct ftrace_func_command ftrace_stacktrace_cmd = …;
static struct ftrace_func_command ftrace_dump_cmd = …;
static struct ftrace_func_command ftrace_cpudump_cmd = …;
static int __init init_func_cmd_traceon(void)
{ … }
#else
static inline int init_func_cmd_traceon(void)
{
return 0;
}
#endif
__init int init_function_trace(void)
{ … }