FAILED: patch "[PATCH] function_graph: Have profiler use curr_ret_stack and not" failed to apply to 4.4-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
b1b35f2e218a5b57d03bbc3b0667d5064570dc60Mon Sep 17 00:00:00 2001
From: "Steven Rostedt (VMware)" <[email protected]>
Date: Tue, 20 Nov 2018 12:51:07 -0500
Subject: [PATCH] function_graph: Have profiler use curr_ret_stack and not
depth
The profiler uses trace->depth to find its entry on the ret_stack, but the depth may not match the actual location of where its entry is (if an interrupt were to preempt the processing of the profiler for another function, the depth and the curr_ret_stack will be different).
Have it use the curr_ret_stack as the index to find its ret_stack entry instead of using the depth variable, as that is no longer guaranteed to be the same.
kernel/trace/ftrace.c +2 -2
@@ -817,7 +817,7 @@ function_profile_call(unsigned long ip, unsigned long parent_ip,#ifdef CONFIG_FUNCTION_GRAPH_TRACER static int profile_graph_entry (struct ftrace_graph_ent *trace) { -int index = trace->depth; +int index = current->curr_ret_stack;function_profile_call (trace->func,0 ,NULL ,NULL );
@@ -852,7 +852,7 @@ static void profile_graph_return(struct ftrace_graph_ret *trace)if (!fgraph_graph_time) {int index; - index = trace->depth; + index = current->curr_ret_stack;/* Append this call time to the parent time to subtract */ if (index)