From cf26dee3080a42f69536d5a030aa26d56e75dc39 Mon Sep 17 00:00:00 2001 From: Valentin Schneider Date: Tue, 26 Nov 2019 17:52:16 +0000 Subject: [PATCH] trace/ftrace: Support the 'function' tracer This tracer is similar to the 'function_graph' tracer in that it helps us trace function calls. It is however more lightweight, and only traces functions entries (along with the caller of the function). It can also happen that the kernel has support for the 'function' tracer but not for 'function_graph' (the opposite cannot be true, however). --- devlib/trace/ftrace.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/devlib/trace/ftrace.py b/devlib/trace/ftrace.py index 20cc935..b36f10f 100644 --- a/devlib/trace/ftrace.py +++ b/devlib/trace/ftrace.py @@ -184,6 +184,12 @@ class FtraceCollector(TraceCollector): # times. if not selected_events: selected_events = ['sched_wakeup_new'] + + # Function tracing + elif self.tracer == 'function': + self.function_string = _build_graph_functions(selected_functions, False) + + # Function graphing elif self.tracer == 'function_graph': self.function_string = _build_graph_functions(selected_functions, trace_children_functions)