/* * Infrastructure for profiling code inserted by 'gcc -pg'. * * Copyright (C) 2007-2008 Steven Rostedt <srostedt@redhat.com> * Copyright (C) 2004-2008 Ingo Molnar <mingo@redhat.com> * * Originally ported from the -rt patch by: * Copyright (C) 2007 Arnaldo Carvalho de Melo <acme@redhat.com> * * Based on code in the latency_tracer, that is: * * Copyright (C) 2004-2006 Ingo Molnar * Copyright (C) 2004 William Lee Irwin III */#include<linux/stop_machine.h>#include<linux/clocksource.h>#include<linux/kallsyms.h>#include<linux/seq_file.h>#include<linux/debugfs.h>#include<linux/hardirq.h>#include<linux/kthread.h>#include<linux/uaccess.h>#include<linux/kprobes.h>#include<linux/ftrace.h>#include<linux/sysctl.h>#include<linux/ctype.h>#include<linux/list.h>#include<asm/ftrace.h>#include"trace.h"#define FTRACE_WARN_ON(cond) \ do { \ if (WARN_ON(cond)) \ ftrace_kill(); \ } while (0)#define FTRACE_WARN_ON_ONCE(cond) \ do { \ if (WARN_ON_ONCE(cond)) \ ftrace_kill(); \ } while (0)/* ftrace_enabled is a method to turn ftrace on or off */intftrace_enabled__read_mostly;staticintlast_ftrace_enabled;/* * ftrace_disabled is set when an anomaly is discovered. * ftrace_disabled is much stronger than ftrace_enabled. */staticintftrace_disabled__read_mostly;staticDEFINE_SPINLOCK(ftrace_lock);staticDEFINE_MUTEX(ftrace_sysctl_lock);staticstructftrace_opsftrace_list_end__read_mostly={.func=ftrace_stub,};staticstructftrace_ops*ftrace_list__read_mostly=&ftrace_list_end;ftrace_func_tftrace_trace_function__read_mostly=ftrace_stub;staticvoidftrace_list_func(unsignedlongip,unsignedlongparent_ip){structftrace_ops*op=ftrace_list;