Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
ftrace_event.h File Reference
#include <linux/ring_buffer.h>
#include <linux/trace_seq.h>
#include <linux/percpu.h>
#include <linux/hardirq.h>
#include <linux/perf_event.h>

Go to the source code of this file.

Data Structures

struct  trace_print_flags
 
struct  trace_print_flags_u64
 
struct  trace_entry
 
struct  trace_iterator
 
struct  trace_event_functions
 
struct  trace_event
 
struct  ftrace_event_class
 
struct  ftrace_event_call
 

Macros

#define FTRACE_MAX_EVENT   ((1 << (sizeof(((struct trace_entry *)0)->type) * 8)) - 1)
 
#define __TRACE_EVENT_FLAGS(name, value)
 
#define PERF_MAX_TRACE_SIZE   2048
 
#define MAX_FILTER_STR_VAL   256 /* Should handle KSYM_SYMBOL_LEN */
 
#define EVENT_STORAGE_SIZE   128
 
#define is_signed_type(type)   (((type)(-1)) < 0)
 
#define event_trace_printk(ip, fmt, args...)
 

Typedefs

typedef enum print_line_t(* trace_print_func )(struct trace_iterator *iter, int flags, struct trace_event *event)
 

Enumerations

enum  print_line_t { TRACE_TYPE_PARTIAL_LINE = 0, TRACE_TYPE_HANDLED = 1, TRACE_TYPE_UNHANDLED = 2, TRACE_TYPE_NO_CONSUME = 3 }
 
enum  trace_reg { TRACE_REG_REGISTER, TRACE_REG_UNREGISTER }
 
enum  {
  TRACE_EVENT_FL_ENABLED_BIT, TRACE_EVENT_FL_FILTERED_BIT, TRACE_EVENT_FL_RECORDED_CMD_BIT, TRACE_EVENT_FL_CAP_ANY_BIT,
  TRACE_EVENT_FL_NO_SET_FILTER_BIT, TRACE_EVENT_FL_IGNORE_ENABLE_BIT
}
 
enum  {
  TRACE_EVENT_FL_ENABLED = (1 << TRACE_EVENT_FL_ENABLED_BIT), TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), TRACE_EVENT_FL_RECORDED_CMD = (1 << TRACE_EVENT_FL_RECORDED_CMD_BIT), TRACE_EVENT_FL_CAP_ANY = (1 << TRACE_EVENT_FL_CAP_ANY_BIT),
  TRACE_EVENT_FL_NO_SET_FILTER = (1 << TRACE_EVENT_FL_NO_SET_FILTER_BIT), TRACE_EVENT_FL_IGNORE_ENABLE = (1 << TRACE_EVENT_FL_IGNORE_ENABLE_BIT)
}
 
enum  {
  FILTER_OTHER = 0, FILTER_STATIC_STRING, FILTER_DYN_STRING, FILTER_PTR_STRING,
  FILTER_TRACE_FN
}
 

Functions

const charftrace_print_flags_seq (struct trace_seq *p, const char *delim, unsigned long flags, const struct trace_print_flags *flag_array)
 
const charftrace_print_symbols_seq (struct trace_seq *p, unsigned long val, const struct trace_print_flags *symbol_array)
 
const charftrace_print_hex_seq (struct trace_seq *p, const unsigned char *buf, int len)
 
int register_ftrace_event (struct trace_event *event)
 
int unregister_ftrace_event (struct trace_event *event)
 
void tracing_generic_entry_update (struct trace_entry *entry, unsigned long flags, int pc)
 
struct ring_buffer_eventtrace_current_buffer_lock_reserve (struct ring_buffer **current_buffer, int type, unsigned long len, unsigned long flags, int pc)
 
void trace_current_buffer_unlock_commit (struct ring_buffer *buffer, struct ring_buffer_event *event, unsigned long flags, int pc)
 
void trace_nowake_buffer_unlock_commit (struct ring_buffer *buffer, struct ring_buffer_event *event, unsigned long flags, int pc)
 
void trace_nowake_buffer_unlock_commit_regs (struct ring_buffer *buffer, struct ring_buffer_event *event, unsigned long flags, int pc, struct pt_regs *regs)
 
void trace_current_buffer_discard_commit (struct ring_buffer *buffer, struct ring_buffer_event *event)
 
void tracing_record_cmdline (struct task_struct *tsk)
 
int ftrace_event_reg (struct ftrace_event_call *event, enum trace_reg type, void *data)
 
void destroy_preds (struct ftrace_event_call *call)
 
int filter_match_preds (struct event_filter *filter, void *rec)
 
int filter_current_check_discard (struct ring_buffer *buffer, struct ftrace_event_call *call, void *rec, struct ring_buffer_event *event)
 
int trace_event_raw_init (struct ftrace_event_call *call)
 
int trace_define_field (struct ftrace_event_call *call, const char *type, const char *name, int offset, int size, int is_signed, int filter_type)
 
int trace_add_event_call (struct ftrace_event_call *call)
 
void trace_remove_event_call (struct ftrace_event_call *call)
 
int trace_set_clr_event (const char *system, const char *event, int set)
 

Variables

struct mutex event_storage_mutex
 
char event_storage [EVENT_STORAGE_SIZE]
 

Macro Definition Documentation

#define __TRACE_EVENT_FLAGS (   name,
  value 
)
Value:
static int __init trace_init_flags_##name(void) \
{ \
event_##name.flags = value; \
return 0; \
} \
early_initcall(trace_init_flags_##name);

Definition at line 231 of file ftrace_event.h.

#define EVENT_STORAGE_SIZE   128

Definition at line 258 of file ftrace_event.h.

#define event_trace_printk (   ip,
  fmt,
  args... 
)
Value:
do { \
__trace_printk_check_format(fmt, ##args); \
tracing_record_cmdline(current); \
if (__builtin_constant_p(fmt)) { \
static const char *trace_printk_fmt \
__attribute__((section("__trace_printk_fmt"))) = \
__builtin_constant_p(fmt) ? fmt : NULL; \
__trace_bprintk(ip, trace_printk_fmt, ##args); \
__trace_printk(ip, fmt, ##args); \
} while (0)

Definition at line 278 of file ftrace_event.h.

#define FTRACE_MAX_EVENT   ((1 << (sizeof(((struct trace_entry *)0)->type) * 8)) - 1)

Definition at line 55 of file ftrace_event.h.

#define is_signed_type (   type)    (((type)(-1)) < 0)

Definition at line 269 of file ftrace_event.h.

#define MAX_FILTER_STR_VAL   256 /* Should handle KSYM_SYMBOL_LEN */

Definition at line 241 of file ftrace_event.h.

#define PERF_MAX_TRACE_SIZE   2048

Definition at line 239 of file ftrace_event.h.

Typedef Documentation

typedef enum print_line_t(* trace_print_func)(struct trace_iterator *iter, int flags, struct trace_event *event)

Definition at line 92 of file ftrace_event.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
TRACE_EVENT_FL_ENABLED_BIT 
TRACE_EVENT_FL_FILTERED_BIT 
TRACE_EVENT_FL_RECORDED_CMD_BIT 
TRACE_EVENT_FL_CAP_ANY_BIT 
TRACE_EVENT_FL_NO_SET_FILTER_BIT 
TRACE_EVENT_FL_IGNORE_ENABLE_BIT 

Definition at line 176 of file ftrace_event.h.

anonymous enum
Enumerator:
TRACE_EVENT_FL_ENABLED 
TRACE_EVENT_FL_FILTERED 
TRACE_EVENT_FL_RECORDED_CMD 
TRACE_EVENT_FL_CAP_ANY 
TRACE_EVENT_FL_NO_SET_FILTER 
TRACE_EVENT_FL_IGNORE_ENABLE 

Definition at line 185 of file ftrace_event.h.

anonymous enum
Enumerator:
FILTER_OTHER 
FILTER_STATIC_STRING 
FILTER_DYN_STRING 
FILTER_PTR_STRING 
FILTER_TRACE_FN 

Definition at line 250 of file ftrace_event.h.

Enumerator:
TRACE_TYPE_PARTIAL_LINE 
TRACE_TYPE_HANDLED 
TRACE_TYPE_UNHANDLED 
TRACE_TYPE_NO_CONSUME 

Definition at line 113 of file ftrace_event.h.

enum trace_reg
Enumerator:
TRACE_REG_REGISTER 
TRACE_REG_UNREGISTER 

Definition at line 144 of file ftrace_event.h.

Function Documentation

void destroy_preds ( struct ftrace_event_call call)

Definition at line 809 of file trace_events_filter.c.

int filter_current_check_discard ( struct ring_buffer buffer,
struct ftrace_event_call call,
void rec,
struct ring_buffer_event event 
)

Definition at line 165 of file trace.c.

int filter_match_preds ( struct event_filter filter,
void rec 
)

Definition at line 533 of file trace_events_filter.c.

int ftrace_event_reg ( struct ftrace_event_call event,
enum trace_reg  type,
void data 
)

Definition at line 150 of file trace_events.c.

const char* ftrace_print_flags_seq ( struct trace_seq p,
const char delim,
unsigned long  flags,
const struct trace_print_flags flag_array 
)

Definition at line 296 of file trace_output.c.

const char* ftrace_print_hex_seq ( struct trace_seq p,
const unsigned char buf,
int  len 
)

Definition at line 386 of file trace_output.c.

const char* ftrace_print_symbols_seq ( struct trace_seq p,
unsigned long  val,
const struct trace_print_flags symbol_array 
)

Definition at line 334 of file trace_output.c.

int register_ftrace_event ( struct trace_event event)

register_ftrace_event - register output for an event type : the event type to register

Event types are stored in a hash and this hash is used to find a way to print an event. If the ->type is set then it will use that type, otherwise it will assign a type to use.

If you assign your own type, please make sure it is added to the trace_type enum in trace.h, to avoid collisions with the dynamic types.

Returns the event type number or zero on error.

Definition at line 782 of file trace_output.c.

int trace_add_event_call ( struct ftrace_event_call call)

Definition at line 1254 of file trace_events.c.

void trace_current_buffer_discard_commit ( struct ring_buffer buffer,
struct ring_buffer_event event 
)

Definition at line 1242 of file trace.c.

struct ring_buffer_event* trace_current_buffer_lock_reserve ( struct ring_buffer **  current_buffer,
int  type,
unsigned long  len,
unsigned long  flags,
int  pc 
)
read

Definition at line 1204 of file trace.c.

void trace_current_buffer_unlock_commit ( struct ring_buffer buffer,
struct ring_buffer_event event,
unsigned long  flags,
int  pc 
)

Definition at line 1214 of file trace.c.

int trace_define_field ( struct ftrace_event_call call,
const char type,
const char name,
int  offset,
int  size,
int  is_signed,
int  filter_type 
)

Definition at line 86 of file trace_events.c.

int trace_event_raw_init ( struct ftrace_event_call call)

Definition at line 138 of file trace_events.c.

void trace_nowake_buffer_unlock_commit ( struct ring_buffer buffer,
struct ring_buffer_event event,
unsigned long  flags,
int  pc 
)

Definition at line 1222 of file trace.c.

void trace_nowake_buffer_unlock_commit_regs ( struct ring_buffer buffer,
struct ring_buffer_event event,
unsigned long  flags,
int  pc,
struct pt_regs regs 
)

Definition at line 1230 of file trace.c.

void trace_remove_event_call ( struct ftrace_event_call call)

Definition at line 1298 of file trace_events.c.

int trace_set_clr_event ( const char system,
const char event,
int  set 
)

trace_set_clr_event - enable or disable an event : system name to match (NULL for any system) : event name to match (NULL for all events, within system) : 1 to enable, 0 to disable

This is a way for other parts of the kernel to enable or disable event recording.

Returns 0 on success, -EINVAL if the parameters do not match any registered events.

Definition at line 363 of file trace_events.c.

void tracing_generic_entry_update ( struct trace_entry entry,
unsigned long  flags,
int  pc 
)

Definition at line 1142 of file trace.c.

void tracing_record_cmdline ( struct task_struct tsk)

Definition at line 1132 of file trace.c.

int unregister_ftrace_event ( struct trace_event event)

unregister_ftrace_event - remove a no longer used event : the event to remove

Definition at line 862 of file trace_output.c.

Variable Documentation

char event_storage[EVENT_STORAGE_SIZE]

Definition at line 33 of file trace_events.c.

struct mutex event_storage_mutex