]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - kernel/trace/trace_functions_graph.c
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[net-next-2.6.git] / kernel / trace / trace_functions_graph.c
index 3fc2a575664fbc23f8fb40de0ecbd1ea0b7d2315..9aed1a5cf553a720e1568de57cec3610ae88c415 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/debugfs.h>
 #include <linux/uaccess.h>
 #include <linux/ftrace.h>
+#include <linux/slab.h>
 #include <linux/fs.h>
 
 #include "trace.h"
@@ -237,6 +238,14 @@ int trace_graph_entry(struct ftrace_graph_ent *trace)
        return ret;
 }
 
+int trace_graph_thresh_entry(struct ftrace_graph_ent *trace)
+{
+       if (tracing_thresh)
+               return 1;
+       else
+               return trace_graph_entry(trace);
+}
+
 static void __trace_graph_return(struct trace_array *tr,
                                struct ftrace_graph_ret *trace,
                                unsigned long flags,
@@ -290,13 +299,26 @@ void set_graph_array(struct trace_array *tr)
        smp_mb();
 }
 
+void trace_graph_thresh_return(struct ftrace_graph_ret *trace)
+{
+       if (tracing_thresh &&
+           (trace->rettime - trace->calltime < tracing_thresh))
+               return;
+       else
+               trace_graph_return(trace);
+}
+
 static int graph_trace_init(struct trace_array *tr)
 {
        int ret;
 
        set_graph_array(tr);
-       ret = register_ftrace_graph(&trace_graph_return,
-                                   &trace_graph_entry);
+       if (tracing_thresh)
+               ret = register_ftrace_graph(&trace_graph_thresh_return,
+                                           &trace_graph_thresh_entry);
+       else
+               ret = register_ftrace_graph(&trace_graph_return,
+                                           &trace_graph_entry);
        if (ret)
                return ret;
        tracing_start_cmdline_record();
@@ -920,7 +942,7 @@ print_graph_return(struct ftrace_graph_ret *trace, struct trace_seq *s,
                if (!ret)
                        return TRACE_TYPE_PARTIAL_LINE;
        } else {
-               ret = trace_seq_printf(s, "} (%ps)\n", (void *)trace->func);
+               ret = trace_seq_printf(s, "} /* %ps */\n", (void *)trace->func);
                if (!ret)
                        return TRACE_TYPE_PARTIAL_LINE;
        }