#include <linux/uaccess.h>
#include <linux/ftrace.h>
#include <linux/interrupt.h>
#include <linux/slab.h>
#include <linux/fs.h>
#include "trace.h"
#include "trace_output.h"
static int ftrace_graph_skip_irqs;
struct fgraph_cpu_data { … };
struct fgraph_data { … };
#define TRACE_GRAPH_INDENT …
unsigned int fgraph_max_depth;
static struct tracer_opt trace_opts[] = …;
static struct tracer_flags tracer_flags = …;
enum { … };
static void
print_graph_duration(struct trace_array *tr, unsigned long long duration,
struct trace_seq *s, u32 flags);
int __trace_graph_entry(struct trace_array *tr,
struct ftrace_graph_ent *trace,
unsigned int trace_ctx)
{ … }
static inline int ftrace_graph_ignore_irqs(void)
{ … }
int trace_graph_entry(struct ftrace_graph_ent *trace,
struct fgraph_ops *gops)
{ … }
static void
__trace_graph_function(struct trace_array *tr,
unsigned long ip, unsigned int trace_ctx)
{ … }
void
trace_graph_function(struct trace_array *tr,
unsigned long ip, unsigned long parent_ip,
unsigned int trace_ctx)
{ … }
void __trace_graph_return(struct trace_array *tr,
struct ftrace_graph_ret *trace,
unsigned int trace_ctx)
{ … }
void trace_graph_return(struct ftrace_graph_ret *trace,
struct fgraph_ops *gops)
{ … }
static void trace_graph_thresh_return(struct ftrace_graph_ret *trace,
struct fgraph_ops *gops)
{ … }
static struct fgraph_ops funcgraph_ops = …;
int allocate_fgraph_ops(struct trace_array *tr, struct ftrace_ops *ops)
{ … }
void free_fgraph_ops(struct trace_array *tr)
{ … }
__init void init_array_fgraph_ops(struct trace_array *tr, struct ftrace_ops *ops)
{ … }
static int graph_trace_init(struct trace_array *tr)
{ … }
static void graph_trace_reset(struct trace_array *tr)
{ … }
static int graph_trace_update_thresh(struct trace_array *tr)
{ … }
static int max_bytes_for_cpu;
static void print_graph_cpu(struct trace_seq *s, int cpu)
{ … }
#define TRACE_GRAPH_PROCINFO_LENGTH …
static void print_graph_proc(struct trace_seq *s, pid_t pid)
{ … }
static void print_graph_lat_fmt(struct trace_seq *s, struct trace_entry *entry)
{ … }
static void
verif_pid(struct trace_seq *s, pid_t pid, int cpu, struct fgraph_data *data)
{ … }
static struct ftrace_graph_ret_entry *
get_return_for_leaf(struct trace_iterator *iter,
struct ftrace_graph_ent_entry *curr)
{ … }
static void print_graph_abs_time(u64 t, struct trace_seq *s)
{ … }
static void
print_graph_rel_time(struct trace_iterator *iter, struct trace_seq *s)
{ … }
static void
print_graph_irq(struct trace_iterator *iter, unsigned long addr,
enum trace_type type, int cpu, pid_t pid, u32 flags)
{ … }
void
trace_print_graph_duration(unsigned long long duration, struct trace_seq *s)
{ … }
static void
print_graph_duration(struct trace_array *tr, unsigned long long duration,
struct trace_seq *s, u32 flags)
{ … }
#ifdef CONFIG_FUNCTION_GRAPH_RETVAL
#define __TRACE_GRAPH_PRINT_RETVAL …
static void print_graph_retval(struct trace_seq *s, unsigned long retval,
bool leaf, void *func, bool hex_format)
{ … }
#else
#define __TRACE_GRAPH_PRINT_RETVAL …
#define print_graph_retval …
#endif
static enum print_line_t
print_graph_entry_leaf(struct trace_iterator *iter,
struct ftrace_graph_ent_entry *entry,
struct ftrace_graph_ret_entry *ret_entry,
struct trace_seq *s, u32 flags)
{ … }
static enum print_line_t
print_graph_entry_nested(struct trace_iterator *iter,
struct ftrace_graph_ent_entry *entry,
struct trace_seq *s, int cpu, u32 flags)
{ … }
static void
print_graph_prologue(struct trace_iterator *iter, struct trace_seq *s,
int type, unsigned long addr, u32 flags)
{ … }
static int
check_irq_entry(struct trace_iterator *iter, u32 flags,
unsigned long addr, int depth)
{ … }
static int
check_irq_return(struct trace_iterator *iter, u32 flags, int depth)
{ … }
static enum print_line_t
print_graph_entry(struct ftrace_graph_ent_entry *field, struct trace_seq *s,
struct trace_iterator *iter, u32 flags)
{ … }
static enum print_line_t
print_graph_return(struct ftrace_graph_ret *trace, struct trace_seq *s,
struct trace_entry *ent, struct trace_iterator *iter,
u32 flags)
{ … }
static enum print_line_t
print_graph_comment(struct trace_seq *s, struct trace_entry *ent,
struct trace_iterator *iter, u32 flags)
{ … }
enum print_line_t
print_graph_function_flags(struct trace_iterator *iter, u32 flags)
{ … }
static enum print_line_t
print_graph_function(struct trace_iterator *iter)
{ … }
static enum print_line_t
print_graph_function_event(struct trace_iterator *iter, int flags,
struct trace_event *event)
{ … }
static void print_lat_header(struct seq_file *s, u32 flags)
{ … }
static void __print_graph_headers_flags(struct trace_array *tr,
struct seq_file *s, u32 flags)
{ … }
static void print_graph_headers(struct seq_file *s)
{ … }
void print_graph_headers_flags(struct seq_file *s, u32 flags)
{ … }
void graph_trace_open(struct trace_iterator *iter)
{ … }
void graph_trace_close(struct trace_iterator *iter)
{ … }
static int
func_graph_set_flag(struct trace_array *tr, u32 old_flags, u32 bit, int set)
{ … }
static struct trace_event_functions graph_functions = …;
static struct trace_event graph_trace_entry_event = …;
static struct trace_event graph_trace_ret_event = …;
static struct tracer graph_trace __tracer_data = …;
static ssize_t
graph_depth_write(struct file *filp, const char __user *ubuf, size_t cnt,
loff_t *ppos)
{ … }
static ssize_t
graph_depth_read(struct file *filp, char __user *ubuf, size_t cnt,
loff_t *ppos)
{ … }
static const struct file_operations graph_depth_fops = …;
static __init int init_graph_tracefs(void)
{ … }
fs_initcall(init_graph_tracefs);
static __init int init_graph_trace(void)
{ … }
core_initcall(init_graph_trace);