Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
ftrace.c File Reference
#include <linux/stop_machine.h>
#include <linux/clocksource.h>
#include <linux/kallsyms.h>
#include <linux/seq_file.h>
#include <linux/suspend.h>
#include <linux/debugfs.h>
#include <linux/hardirq.h>
#include <linux/kthread.h>
#include <linux/uaccess.h>
#include <linux/bsearch.h>
#include <linux/module.h>
#include <linux/ftrace.h>
#include <linux/sysctl.h>
#include <linux/slab.h>
#include <linux/ctype.h>
#include <linux/sort.h>
#include <linux/list.h>
#include <linux/hash.h>
#include <linux/rcupdate.h>
#include <trace/events/sched.h>
#include <asm/setup.h>
#include "trace_output.h"
#include "trace_stat.h"

Go to the source code of this file.

Data Structures

struct  ftrace_pid
 

Macros

#define FTRACE_WARN_ON(cond)
 
#define FTRACE_WARN_ON_ONCE(cond)
 
#define FTRACE_HASH_BITS   7
 
#define FTRACE_FUNC_HASHSIZE   (1 << FTRACE_HASH_BITS)
 
#define FTRACE_HASH_DEFAULT_BITS   10
 
#define FTRACE_HASH_MAX_BITS   12
 
#define FL_GLOBAL_CONTROL_MASK   (FTRACE_OPS_FL_GLOBAL | FTRACE_OPS_FL_CONTROL)
 
#define ftrace_ops_list_func   ((ftrace_func_t)ftrace_ops_no_ops)
 
#define ftrace_startup(ops, command)
 
#define ftrace_shutdown(ops, command)   do { } while (0)
 
#define ftrace_startup_sysctl()   do { } while (0)
 
#define ftrace_shutdown_sysctl()   do { } while (0)
 

Functions

 LIST_HEAD (ftrace_pids)
 
int ftrace_nr_registered_ops (void)
 
void clear_ftrace_function (void)
 
 device_initcall (ftrace_nodyn_init)
 
 fs_initcall (ftrace_init_debugfs)
 
void ftrace_kill (void)
 
int ftrace_is_dead (void)
 
int register_ftrace_function (struct ftrace_ops *ops)
 
 EXPORT_SYMBOL_GPL (register_ftrace_function)
 
int unregister_ftrace_function (struct ftrace_ops *ops)
 
 EXPORT_SYMBOL_GPL (unregister_ftrace_function)
 
int ftrace_enable_sysctl (struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
 

Macro Definition Documentation

#define FL_GLOBAL_CONTROL_MASK   (FTRACE_OPS_FL_GLOBAL | FTRACE_OPS_FL_CONTROL)

Definition at line 65 of file ftrace.c.

#define FTRACE_FUNC_HASHSIZE   (1 << FTRACE_HASH_BITS)

Definition at line 61 of file ftrace.c.

#define FTRACE_HASH_BITS   7

Definition at line 60 of file ftrace.c.

#define FTRACE_HASH_DEFAULT_BITS   10

Definition at line 62 of file ftrace.c.

#define FTRACE_HASH_MAX_BITS   12

Definition at line 63 of file ftrace.c.

#define ftrace_ops_list_func   ((ftrace_func_t)ftrace_ops_no_ops)

Definition at line 111 of file ftrace.c.

#define ftrace_shutdown (   ops,
  command 
)    do { } while (0)

Definition at line 4068 of file ftrace.c.

#define ftrace_shutdown_sysctl ( )    do { } while (0)

Definition at line 4070 of file ftrace.c.

#define ftrace_startup (   ops,
  command 
)
Value:
({ \
(ops)->flags |= FTRACE_OPS_FL_ENABLED; \
0; \
})

Definition at line 4063 of file ftrace.c.

#define ftrace_startup_sysctl ( )    do { } while (0)

Definition at line 4069 of file ftrace.c.

#define FTRACE_WARN_ON (   cond)
Value:
({ \
int ___r = cond; \
if (WARN_ON(___r)) \
ftrace_kill(); \
___r; \
})

Definition at line 43 of file ftrace.c.

#define FTRACE_WARN_ON_ONCE (   cond)
Value:
({ \
int ___r = cond; \
if (WARN_ON_ONCE(___r)) \
ftrace_kill(); \
___r; \
})

Definition at line 51 of file ftrace.c.

Function Documentation

void clear_ftrace_function ( void  )

clear_ftrace_function - reset the ftrace function

This NULLs the ftrace function and in essence stops tracing. There may be lag

Definition at line 182 of file ftrace.c.

device_initcall ( ftrace_nodyn_init  )
EXPORT_SYMBOL_GPL ( register_ftrace_function  )
EXPORT_SYMBOL_GPL ( unregister_ftrace_function  )
fs_initcall ( ftrace_init_debugfs  )
int ftrace_enable_sysctl ( struct ctl_table table,
int  write,
void __user buffer,
size_t lenp,
loff_t *  ppos 
)

Definition at line 4499 of file ftrace.c.

int ftrace_is_dead ( void  )

Test if ftrace is dead or not.

Definition at line 4446 of file ftrace.c.

void ftrace_kill ( void  )

ftrace_kill - kill ftrace

This function should be used by panic code. It stops ftrace but in a not so nice way. If you need to simply kill ftrace from a non-atomic section, use ftrace_kill.

Definition at line 4436 of file ftrace.c.

int ftrace_nr_registered_ops ( void  )

ftrace_nr_registered_ops - return number of ops registered

Returns the number of ftrace_ops registered and tracing functions

Definition at line 119 of file ftrace.c.

LIST_HEAD ( ftrace_pids  )
int register_ftrace_function ( struct ftrace_ops *  ops)

register_ftrace_function - register a function for profiling - ops structure that holds the function for profiling.

Register a function to be called by all functions in the kernel.

Note: ->func and all the functions it calls must be labeled with "notrace", otherwise it will go into a recursive loop.

Definition at line 4462 of file ftrace.c.

int unregister_ftrace_function ( struct ftrace_ops *  ops)

unregister_ftrace_function - unregister a function for profiling. - ops structure that holds the function to unregister

Unregister a function that was added to be called by ftrace profiling.

Definition at line 4484 of file ftrace.c.