tcp: tcp_get_info() should fetch socket fields once
[pandora-kernel.git] / kernel / trace / ftrace.c
index 4f22802..02bece4 100644 (file)
@@ -18,7 +18,7 @@
 #include <linux/kallsyms.h>
 #include <linux/seq_file.h>
 #include <linux/suspend.h>
-#include <linux/debugfs.h>
+#include <linux/tracefs.h>
 #include <linux/hardirq.h>
 #include <linux/kthread.h>
 #include <linux/uaccess.h>
@@ -249,6 +249,19 @@ static void update_function_graph_func(void);
 static inline void update_function_graph_func(void) { }
 #endif
 
+
+static ftrace_func_t ftrace_ops_get_list_func(struct ftrace_ops *ops)
+{
+       /*
+        * If this is a dynamic ops or we force list func,
+        * then it needs to call the list anyway.
+        */
+       if (ops->flags & FTRACE_OPS_FL_DYNAMIC || FTRACE_FORCE_LIST_FUNC)
+               return ftrace_ops_list_func;
+
+       return ftrace_ops_get_func(ops);
+}
+
 static void update_ftrace_function(void)
 {
        ftrace_func_t func;
@@ -270,7 +283,7 @@ static void update_ftrace_function(void)
         * then have the mcount trampoline call the function directly.
         */
        } else if (ftrace_ops_list->next == &ftrace_list_end) {
-               func = ftrace_ops_get_func(ftrace_ops_list);
+               func = ftrace_ops_get_list_func(ftrace_ops_list);
 
        } else {
                /* Just use the default ftrace_ops */
@@ -1008,7 +1021,7 @@ static struct tracer_stat function_stats __initdata = {
        .stat_show      = function_stat_show
 };
 
-static __init void ftrace_profile_debugfs(struct dentry *d_tracer)
+static __init void ftrace_profile_tracefs(struct dentry *d_tracer)
 {
        struct ftrace_profile_stat *stat;
        struct dentry *entry;
@@ -1044,15 +1057,15 @@ static __init void ftrace_profile_debugfs(struct dentry *d_tracer)
                }
        }
 
-       entry = debugfs_create_file("function_profile_enabled", 0644,
+       entry = tracefs_create_file("function_profile_enabled", 0644,
                                    d_tracer, NULL, &ftrace_profile_fops);
        if (!entry)
-               pr_warning("Could not create debugfs "
+               pr_warning("Could not create tracefs "
                           "'function_profile_enabled' entry\n");
 }
 
 #else /* CONFIG_FUNCTION_PROFILER */
-static __init void ftrace_profile_debugfs(struct dentry *d_tracer)
+static __init void ftrace_profile_tracefs(struct dentry *d_tracer)
 {
 }
 #endif /* CONFIG_FUNCTION_PROFILER */
@@ -4712,7 +4725,7 @@ void ftrace_destroy_filter_files(struct ftrace_ops *ops)
        mutex_unlock(&ftrace_lock);
 }
 
-static __init int ftrace_init_dyn_debugfs(struct dentry *d_tracer)
+static __init int ftrace_init_dyn_tracefs(struct dentry *d_tracer)
 {
 
        trace_create_file("available_filter_functions", 0444,
@@ -5020,7 +5033,7 @@ static int __init ftrace_nodyn_init(void)
 }
 core_initcall(ftrace_nodyn_init);
 
-static inline int ftrace_init_dyn_debugfs(struct dentry *d_tracer) { return 0; }
+static inline int ftrace_init_dyn_tracefs(struct dentry *d_tracer) { return 0; }
 static inline void ftrace_startup_enable(int command) { }
 static inline void ftrace_startup_all(int command) { }
 /* Keep as macros so we do not need to define the commands */
@@ -5208,13 +5221,6 @@ static void ftrace_ops_recurs_func(unsigned long ip, unsigned long parent_ip,
  */
 ftrace_func_t ftrace_ops_get_func(struct ftrace_ops *ops)
 {
-       /*
-        * If this is a dynamic ops or we force list func,
-        * then it needs to call the list anyway.
-        */
-       if (ops->flags & FTRACE_OPS_FL_DYNAMIC || FTRACE_FORCE_LIST_FUNC)
-               return ftrace_ops_list_func;
-
        /*
         * If the func handles its own recursion, call it directly.
         * Otherwise call the recursion protected function that
@@ -5473,7 +5479,7 @@ static const struct file_operations ftrace_pid_fops = {
        .release        = ftrace_pid_release,
 };
 
-static __init int ftrace_init_debugfs(void)
+static __init int ftrace_init_tracefs(void)
 {
        struct dentry *d_tracer;
 
@@ -5481,16 +5487,16 @@ static __init int ftrace_init_debugfs(void)
        if (IS_ERR(d_tracer))
                return 0;
 
-       ftrace_init_dyn_debugfs(d_tracer);
+       ftrace_init_dyn_tracefs(d_tracer);
 
        trace_create_file("set_ftrace_pid", 0644, d_tracer,
                            NULL, &ftrace_pid_fops);
 
-       ftrace_profile_debugfs(d_tracer);
+       ftrace_profile_tracefs(d_tracer);
 
        return 0;
 }
-fs_initcall(ftrace_init_debugfs);
+fs_initcall(ftrace_init_tracefs);
 
 /**
  * ftrace_kill - kill ftrace