#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/ftrace.h>
#include <linux/kprobes.h>
#include <linux/sched/clock.h>
#include <linux/sched/mm.h>
#include <linux/idr.h>
#include "trace_output.h"
#define EVENT_HASHSIZE …
DECLARE_RWSEM(…) …;
static struct hlist_head event_hash[EVENT_HASHSIZE] __read_mostly;
enum print_line_t trace_print_bputs_msg_only(struct trace_iterator *iter)
{ … }
enum print_line_t trace_print_bprintk_msg_only(struct trace_iterator *iter)
{ … }
enum print_line_t trace_print_printk_msg_only(struct trace_iterator *iter)
{ … }
const char *
trace_print_flags_seq(struct trace_seq *p, const char *delim,
unsigned long flags,
const struct trace_print_flags *flag_array)
{ … }
EXPORT_SYMBOL(…);
const char *
trace_print_symbols_seq(struct trace_seq *p, unsigned long val,
const struct trace_print_flags *symbol_array)
{ … }
EXPORT_SYMBOL(…);
#if BITS_PER_LONG == 32
const char *
trace_print_flags_seq_u64(struct trace_seq *p, const char *delim,
unsigned long long flags,
const struct trace_print_flags_u64 *flag_array)
{
unsigned long long mask;
const char *str;
const char *ret = trace_seq_buffer_ptr(p);
int i, first = 1;
for (i = 0; flag_array[i].name && flags; i++) {
mask = flag_array[i].mask;
if ((flags & mask) != mask)
continue;
str = flag_array[i].name;
flags &= ~mask;
if (!first && delim)
trace_seq_puts(p, delim);
else
first = 0;
trace_seq_puts(p, str);
}
if (flags) {
if (!first && delim)
trace_seq_puts(p, delim);
trace_seq_printf(p, "0x%llx", flags);
}
trace_seq_putc(p, 0);
return ret;
}
EXPORT_SYMBOL(trace_print_flags_seq_u64);
const char *
trace_print_symbols_seq_u64(struct trace_seq *p, unsigned long long val,
const struct trace_print_flags_u64 *symbol_array)
{
int i;
const char *ret = trace_seq_buffer_ptr(p);
for (i = 0; symbol_array[i].name; i++) {
if (val != symbol_array[i].mask)
continue;
trace_seq_puts(p, symbol_array[i].name);
break;
}
if (ret == (const char *)(trace_seq_buffer_ptr(p)))
trace_seq_printf(p, "0x%llx", val);
trace_seq_putc(p, 0);
return ret;
}
EXPORT_SYMBOL(trace_print_symbols_seq_u64);
#endif
const char *
trace_print_bitmask_seq(struct trace_seq *p, void *bitmask_ptr,
unsigned int bitmask_size)
{ … }
EXPORT_SYMBOL_GPL(…);
const char *
trace_print_hex_seq(struct trace_seq *p, const unsigned char *buf, int buf_len,
bool concatenate)
{ … }
EXPORT_SYMBOL(…);
const char *
trace_print_array_seq(struct trace_seq *p, const void *buf, int count,
size_t el_size)
{ … }
EXPORT_SYMBOL(…);
const char *
trace_print_hex_dump_seq(struct trace_seq *p, const char *prefix_str,
int prefix_type, int rowsize, int groupsize,
const void *buf, size_t len, bool ascii)
{ … }
EXPORT_SYMBOL(…);
int trace_raw_output_prep(struct trace_iterator *iter,
struct trace_event *trace_event)
{ … }
EXPORT_SYMBOL(…);
void trace_event_printf(struct trace_iterator *iter, const char *fmt, ...)
{ … }
EXPORT_SYMBOL(…);
static __printf(3, 0)
int trace_output_raw(struct trace_iterator *iter, char *name,
char *fmt, va_list ap)
{ … }
int trace_output_call(struct trace_iterator *iter, char *name, char *fmt, ...)
{ … }
EXPORT_SYMBOL_GPL(…);
static inline const char *kretprobed(const char *name, unsigned long addr)
{ … }
void
trace_seq_print_sym(struct trace_seq *s, unsigned long address, bool offset)
{ … }
#ifndef CONFIG_64BIT
#define IP_FMT …
#else
#define IP_FMT …
#endif
static int seq_print_user_ip(struct trace_seq *s, struct mm_struct *mm,
unsigned long ip, unsigned long sym_flags)
{ … }
int
seq_print_ip_sym(struct trace_seq *s, unsigned long ip, unsigned long sym_flags)
{ … }
int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry)
{ … }
static int
lat_print_generic(struct trace_seq *s, struct trace_entry *entry, int cpu)
{ … }
#undef MARK
#define MARK …
static const struct trace_mark { … } mark[] = …;
#undef MARK
char trace_find_mark(unsigned long long d)
{ … }
static int
lat_print_timestamp(struct trace_iterator *iter, u64 next_ts)
{ … }
static void trace_print_time(struct trace_seq *s, struct trace_iterator *iter,
unsigned long long ts)
{ … }
int trace_print_context(struct trace_iterator *iter)
{ … }
int trace_print_lat_context(struct trace_iterator *iter)
{ … }
struct trace_event *ftrace_find_event(int type)
{ … }
static DEFINE_IDA(trace_event_ida);
static void free_trace_event_type(int type)
{ … }
static int alloc_trace_event_type(void)
{ … }
void trace_event_read_lock(void)
{ … }
void trace_event_read_unlock(void)
{ … }
int register_trace_event(struct trace_event *event)
{ … }
EXPORT_SYMBOL_GPL(…);
int __unregister_trace_event(struct trace_event *event)
{ … }
int unregister_trace_event(struct trace_event *event)
{ … }
EXPORT_SYMBOL_GPL(…);
static void print_array(struct trace_iterator *iter, void *pos,
struct ftrace_event_field *field)
{ … }
static void print_fields(struct trace_iterator *iter, struct trace_event_call *call,
struct list_head *head)
{ … }
enum print_line_t print_event_fields(struct trace_iterator *iter,
struct trace_event *event)
{ … }
enum print_line_t trace_nop_print(struct trace_iterator *iter, int flags,
struct trace_event *event)
{ … }
static void print_fn_trace(struct trace_seq *s, unsigned long ip,
unsigned long parent_ip, int flags)
{ … }
static enum print_line_t trace_fn_trace(struct trace_iterator *iter, int flags,
struct trace_event *event)
{ … }
static enum print_line_t trace_fn_raw(struct trace_iterator *iter, int flags,
struct trace_event *event)
{ … }
static enum print_line_t trace_fn_hex(struct trace_iterator *iter, int flags,
struct trace_event *event)
{ … }
static enum print_line_t trace_fn_bin(struct trace_iterator *iter, int flags,
struct trace_event *event)
{ … }
static struct trace_event_functions trace_fn_funcs = …;
static struct trace_event trace_fn_event = …;
static enum print_line_t trace_ctxwake_print(struct trace_iterator *iter,
char *delim)
{ … }
static enum print_line_t trace_ctx_print(struct trace_iterator *iter, int flags,
struct trace_event *event)
{ … }
static enum print_line_t trace_wake_print(struct trace_iterator *iter,
int flags, struct trace_event *event)
{ … }
static int trace_ctxwake_raw(struct trace_iterator *iter, char S)
{ … }
static enum print_line_t trace_ctx_raw(struct trace_iterator *iter, int flags,
struct trace_event *event)
{ … }
static enum print_line_t trace_wake_raw(struct trace_iterator *iter, int flags,
struct trace_event *event)
{ … }
static int trace_ctxwake_hex(struct trace_iterator *iter, char S)
{ … }
static enum print_line_t trace_ctx_hex(struct trace_iterator *iter, int flags,
struct trace_event *event)
{ … }
static enum print_line_t trace_wake_hex(struct trace_iterator *iter, int flags,
struct trace_event *event)
{ … }
static enum print_line_t trace_ctxwake_bin(struct trace_iterator *iter,
int flags, struct trace_event *event)
{ … }
static struct trace_event_functions trace_ctx_funcs = …;
static struct trace_event trace_ctx_event = …;
static struct trace_event_functions trace_wake_funcs = …;
static struct trace_event trace_wake_event = …;
static enum print_line_t trace_stack_print(struct trace_iterator *iter,
int flags, struct trace_event *event)
{ … }
static struct trace_event_functions trace_stack_funcs = …;
static struct trace_event trace_stack_event = …;
static enum print_line_t trace_user_stack_print(struct trace_iterator *iter,
int flags, struct trace_event *event)
{ … }
static struct trace_event_functions trace_user_stack_funcs = …;
static struct trace_event trace_user_stack_event = …;
static enum print_line_t
trace_hwlat_print(struct trace_iterator *iter, int flags,
struct trace_event *event)
{ … }
static enum print_line_t
trace_hwlat_raw(struct trace_iterator *iter, int flags,
struct trace_event *event)
{ … }
static struct trace_event_functions trace_hwlat_funcs = …;
static struct trace_event trace_hwlat_event = …;
static enum print_line_t
trace_osnoise_print(struct trace_iterator *iter, int flags,
struct trace_event *event)
{ … }
static enum print_line_t
trace_osnoise_raw(struct trace_iterator *iter, int flags,
struct trace_event *event)
{ … }
static struct trace_event_functions trace_osnoise_funcs = …;
static struct trace_event trace_osnoise_event = …;
static char *timerlat_lat_context[] = …;
static enum print_line_t
trace_timerlat_print(struct trace_iterator *iter, int flags,
struct trace_event *event)
{ … }
static enum print_line_t
trace_timerlat_raw(struct trace_iterator *iter, int flags,
struct trace_event *event)
{ … }
static struct trace_event_functions trace_timerlat_funcs = …;
static struct trace_event trace_timerlat_event = …;
static enum print_line_t
trace_bputs_print(struct trace_iterator *iter, int flags,
struct trace_event *event)
{ … }
static enum print_line_t
trace_bputs_raw(struct trace_iterator *iter, int flags,
struct trace_event *event)
{ … }
static struct trace_event_functions trace_bputs_funcs = …;
static struct trace_event trace_bputs_event = …;
static enum print_line_t
trace_bprint_print(struct trace_iterator *iter, int flags,
struct trace_event *event)
{ … }
static enum print_line_t
trace_bprint_raw(struct trace_iterator *iter, int flags,
struct trace_event *event)
{ … }
static struct trace_event_functions trace_bprint_funcs = …;
static struct trace_event trace_bprint_event = …;
static enum print_line_t trace_print_print(struct trace_iterator *iter,
int flags, struct trace_event *event)
{ … }
static enum print_line_t trace_print_raw(struct trace_iterator *iter, int flags,
struct trace_event *event)
{ … }
static struct trace_event_functions trace_print_funcs = …;
static struct trace_event trace_print_event = …;
static enum print_line_t trace_raw_data(struct trace_iterator *iter, int flags,
struct trace_event *event)
{ … }
static struct trace_event_functions trace_raw_data_funcs = …;
static struct trace_event trace_raw_data_event = …;
static enum print_line_t
trace_func_repeats_raw(struct trace_iterator *iter, int flags,
struct trace_event *event)
{ … }
static enum print_line_t
trace_func_repeats_print(struct trace_iterator *iter, int flags,
struct trace_event *event)
{ … }
static struct trace_event_functions trace_func_repeats_funcs = …;
static struct trace_event trace_func_repeats_event = …;
static struct trace_event *events[] __initdata = …;
__init int init_events(void)
{ … }