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.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index f97244a41a4f..3f4a251b7d16 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -927,9 +927,16 @@ print_graph_function(struct trace_iterator *iter)
927 927
928 switch (entry->type) { 928 switch (entry->type) {
929 case TRACE_GRAPH_ENT: { 929 case TRACE_GRAPH_ENT: {
930 struct ftrace_graph_ent_entry *field; 930 /*
931 * print_graph_entry() may consume the current event,
932 * thus @field may become invalid, so we need to save it.
933 * sizeof(struct ftrace_graph_ent_entry) is very small,
934 * it can be safely saved at the stack.
935 */
936 struct ftrace_graph_ent_entry *field, saved;
931 trace_assign_type(field, entry); 937 trace_assign_type(field, entry);
932 return print_graph_entry(field, s, iter); 938 saved = *field;
939 return print_graph_entry(&saved, s, iter);
933 } 940 }
934 case TRACE_GRAPH_RET: { 941 case TRACE_GRAPH_RET: {
935 struct ftrace_graph_ret_entry *field; 942 struct ftrace_graph_ret_entry *field;