aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_functions_graph.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/trace_functions_graph.c')
-rw-r--r--kernel/trace/trace_functions_graph.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 669b9c31861d..db9e06bb766e 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -40,7 +40,7 @@ struct fgraph_data {
40#define TRACE_GRAPH_PRINT_OVERHEAD 0x4 40#define TRACE_GRAPH_PRINT_OVERHEAD 0x4
41#define TRACE_GRAPH_PRINT_PROC 0x8 41#define TRACE_GRAPH_PRINT_PROC 0x8
42#define TRACE_GRAPH_PRINT_DURATION 0x10 42#define TRACE_GRAPH_PRINT_DURATION 0x10
43#define TRACE_GRAPH_PRINT_ABS_TIME 0X20 43#define TRACE_GRAPH_PRINT_ABS_TIME 0x20
44 44
45static struct tracer_opt trace_opts[] = { 45static struct tracer_opt trace_opts[] = {
46 /* Display overruns? (for self-debug purpose) */ 46 /* Display overruns? (for self-debug purpose) */
@@ -1096,6 +1096,12 @@ print_graph_function(struct trace_iterator *iter)
1096 return TRACE_TYPE_HANDLED; 1096 return TRACE_TYPE_HANDLED;
1097} 1097}
1098 1098
1099static enum print_line_t
1100print_graph_function_event(struct trace_iterator *iter, int flags)
1101{
1102 return print_graph_function(iter);
1103}
1104
1099static void print_lat_header(struct seq_file *s) 1105static void print_lat_header(struct seq_file *s)
1100{ 1106{
1101 static const char spaces[] = " " /* 16 spaces */ 1107 static const char spaces[] = " " /* 16 spaces */
@@ -1199,6 +1205,16 @@ static void graph_trace_close(struct trace_iterator *iter)
1199 } 1205 }
1200} 1206}
1201 1207
1208static struct trace_event graph_trace_entry_event = {
1209 .type = TRACE_GRAPH_ENT,
1210 .trace = print_graph_function_event,
1211};
1212
1213static struct trace_event graph_trace_ret_event = {
1214 .type = TRACE_GRAPH_RET,
1215 .trace = print_graph_function_event,
1216};
1217
1202static struct tracer graph_trace __read_mostly = { 1218static struct tracer graph_trace __read_mostly = {
1203 .name = "function_graph", 1219 .name = "function_graph",
1204 .open = graph_trace_open, 1220 .open = graph_trace_open,
@@ -1220,6 +1236,16 @@ static __init int init_graph_trace(void)
1220{ 1236{
1221 max_bytes_for_cpu = snprintf(NULL, 0, "%d", nr_cpu_ids - 1); 1237 max_bytes_for_cpu = snprintf(NULL, 0, "%d", nr_cpu_ids - 1);
1222 1238
1239 if (!register_ftrace_event(&graph_trace_entry_event)) {
1240 pr_warning("Warning: could not register graph trace events\n");
1241 return 1;
1242 }
1243
1244 if (!register_ftrace_event(&graph_trace_ret_event)) {
1245 pr_warning("Warning: could not register graph trace events\n");
1246 return 1;
1247 }
1248
1223 return register_tracer(&graph_trace); 1249 return register_tracer(&graph_trace);
1224} 1250}
1225 1251