Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
trace_output.c File Reference
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/ftrace.h>
#include "trace_output.h"

Go to the source code of this file.

Macros

#define EVENT_HASHSIZE   128
 
#define IP_FMT   "%08lx"
 

Functions

 DECLARE_RWSEM (trace_event_mutex)
 
int trace_print_seq (struct seq_file *m, struct trace_seq *s)
 
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)
 
int trace_seq_printf (struct trace_seq *s, const char *fmt,...)
 
 EXPORT_SYMBOL_GPL (trace_seq_printf)
 
int trace_seq_vprintf (struct trace_seq *s, const char *fmt, va_list args)
 
 EXPORT_SYMBOL_GPL (trace_seq_vprintf)
 
int trace_seq_bprintf (struct trace_seq *s, const char *fmt, const u32 *binary)
 
int trace_seq_puts (struct trace_seq *s, const char *str)
 
int trace_seq_putc (struct trace_seq *s, unsigned char c)
 
 EXPORT_SYMBOL (trace_seq_putc)
 
int trace_seq_putmem (struct trace_seq *s, const void *mem, size_t len)
 
int trace_seq_putmem_hex (struct trace_seq *s, const void *mem, size_t len)
 
voidtrace_seq_reserve (struct trace_seq *s, size_t len)
 
int trace_seq_path (struct trace_seq *s, const struct path *path)
 
const charftrace_print_flags_seq (struct trace_seq *p, const char *delim, unsigned long flags, const struct trace_print_flags *flag_array)
 
 EXPORT_SYMBOL (ftrace_print_flags_seq)
 
const charftrace_print_symbols_seq (struct trace_seq *p, unsigned long val, const struct trace_print_flags *symbol_array)
 
 EXPORT_SYMBOL (ftrace_print_symbols_seq)
 
const charftrace_print_hex_seq (struct trace_seq *p, const unsigned char *buf, int buf_len)
 
 EXPORT_SYMBOL (ftrace_print_hex_seq)
 
int seq_print_user_ip (struct trace_seq *s, struct mm_struct *mm, unsigned long ip, unsigned long sym_flags)
 
int seq_print_userip_objs (const struct userstack_entry *entry, struct trace_seq *s, 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)
 
int trace_print_context (struct trace_iterator *iter)
 
int trace_print_lat_context (struct trace_iterator *iter)
 
struct trace_eventftrace_find_event (int type)
 
void trace_event_read_lock (void)
 
void trace_event_read_unlock (void)
 
int register_ftrace_event (struct trace_event *event)
 
 EXPORT_SYMBOL_GPL (register_ftrace_event)
 
int __unregister_ftrace_event (struct trace_event *event)
 
int unregister_ftrace_event (struct trace_event *event)
 
 EXPORT_SYMBOL_GPL (unregister_ftrace_event)
 
enum print_line_t trace_nop_print (struct trace_iterator *iter, int flags, struct trace_event *event)
 
 early_initcall (init_events)
 

Macro Definition Documentation

#define EVENT_HASHSIZE   128

Definition at line 15 of file trace_output.c.

#define IP_FMT   "%08lx"

Definition at line 450 of file trace_output.c.

Function Documentation

int __unregister_ftrace_event ( struct trace_event event)

Definition at line 851 of file trace_output.c.

DECLARE_RWSEM ( trace_event_mutex  )
early_initcall ( init_events  )
EXPORT_SYMBOL ( trace_seq_putc  )
EXPORT_SYMBOL ( ftrace_print_flags_seq  )
EXPORT_SYMBOL ( ftrace_print_symbols_seq  )
EXPORT_SYMBOL ( ftrace_print_hex_seq  )
EXPORT_SYMBOL_GPL ( trace_seq_printf  )
EXPORT_SYMBOL_GPL ( trace_seq_vprintf  )
EXPORT_SYMBOL_GPL ( register_ftrace_event  )
EXPORT_SYMBOL_GPL ( unregister_ftrace_event  )
struct trace_event* ftrace_find_event ( int  type)
read

ftrace_find_event - find a registered event : the type of event to look for

Returns an event of type otherwise NULL Called with trace_event_read_lock() held.

Definition at line 711 of file trace_output.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  buf_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 seq_print_ip_sym ( struct trace_seq s,
unsigned long  ip,
unsigned long  sym_flags 
)

Definition at line 535 of file trace_output.c.

int seq_print_user_ip ( struct trace_seq s,
struct mm_struct mm,
unsigned long  ip,
unsigned long  sym_flags 
)

Definition at line 455 of file trace_output.c.

int seq_print_userip_objs ( const struct userstack_entry *  entry,
struct trace_seq s,
unsigned long  sym_flags 
)

Definition at line 488 of file trace_output.c.

void trace_event_read_lock ( void  )

Definition at line 757 of file trace_output.c.

void trace_event_read_unlock ( void  )

Definition at line 762 of file trace_output.c.

enum print_line_t trace_nop_print ( struct trace_iterator iter,
int  flags,
struct trace_event event 
)

Definition at line 876 of file trace_output.c.

enum print_line_t trace_print_bprintk_msg_only ( struct trace_iterator iter)

Definition at line 40 of file trace_output.c.

int trace_print_context ( struct trace_iterator iter)

Definition at line 624 of file trace_output.c.

int trace_print_lat_context ( struct trace_iterator iter)

Definition at line 651 of file trace_output.c.

int trace_print_lat_fmt ( struct trace_seq s,
struct trace_entry entry 
)

trace_print_lat_fmt - print the irq, preempt and lockdep fields : trace seq struct to write to : The trace entry field from the ring buffer

Prints the generic fields of irqs off, in hard or softirq, preempt count.

Definition at line 563 of file trace_output.c.

enum print_line_t trace_print_printk_msg_only ( struct trace_iterator iter)

Definition at line 56 of file trace_output.c.

int trace_print_seq ( struct seq_file m,
struct trace_seq s 
)

Definition at line 23 of file trace_output.c.

int trace_seq_bprintf ( struct trace_seq s,
const char fmt,
const u32 binary 
)

Definition at line 146 of file trace_output.c.

int trace_seq_path ( struct trace_seq s,
const struct path path 
)

Definition at line 267 of file trace_output.c.

int trace_seq_printf ( struct trace_seq s,
const char fmt,
  ... 
)

trace_seq_printf - sequence printing of trace information : trace sequence descriptor : printf format string

It returns 0 if the trace oversizes the buffer's free space, 1 otherwise.

The tracer may use either sequence operations or its own copy to user routines. To simplify formating of a trace trace_seq_printf is used to store strings into a special buffer (). Then the output may be either used by the sequencer or pulled into another buffer.

Definition at line 87 of file trace_output.c.

int trace_seq_putc ( struct trace_seq s,
unsigned char  c 
)

Definition at line 195 of file trace_output.c.

int trace_seq_putmem ( struct trace_seq s,
const void mem,
size_t  len 
)

Definition at line 211 of file trace_output.c.

int trace_seq_putmem_hex ( struct trace_seq s,
const void mem,
size_t  len 
)

Definition at line 227 of file trace_output.c.

int trace_seq_puts ( struct trace_seq s,
const char str 
)

trace_seq_puts - trace sequence printing of simple string : trace sequence descriptor : simple string to record

The tracer may use either the sequence operations or its own copy to user routines. This function records a simple string into a special buffer () for later retrieval by a sequencer or other mechanism.

Definition at line 177 of file trace_output.c.

void* trace_seq_reserve ( struct trace_seq s,
size_t  len 
)

Definition at line 249 of file trace_output.c.

int trace_seq_vprintf ( struct trace_seq s,
const char fmt,
va_list  args 
)

trace_seq_vprintf - sequence printing of trace information : trace sequence descriptor : printf format string

The tracer may use either sequence operations or its own copy to user routines. To simplify formating of a trace trace_seq_printf is used to store strings into a special buffer (). Then the output may be either used by the sequencer or pulled into another buffer.

Definition at line 124 of file trace_output.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.