Skip to content

Commit c8dd0f4

Browse files
committed
function_graph: Do not expose the graph_time option when profiler is not configured
When the function profiler is not configured, the "graph_time" option is meaningless, as the function profiler is the only thing that makes use of it. Do not expose it if the profiler is not configured. Link: http://lkml.kernel.org/r/20181123061133.GA195223@google.com Reported-by: Joel Fernandes <joel@joelfernandes.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 parent 3306fc4 commit c8dd0f4

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎kernel/trace/trace.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,12 @@ static __always_inline bool ftrace_hash_empty(struct ftrace_hash *hash)
862862
#define TRACE_GRAPH_PRINT_FILL_MASK (0x3 << TRACE_GRAPH_PRINT_FILL_SHIFT)
863863

864864
extern void ftrace_graph_sleep_time_control(bool enable);
865+
866+
#ifdef CONFIG_FUNCTION_PROFILER
865867
extern void ftrace_graph_graph_time_control(bool enable);
868+
#else
869+
static inline void ftrace_graph_graph_time_control(bool enable) { }
870+
#endif
866871

867872
extern enum print_line_t
868873
print_graph_function_flags(struct trace_iterator *iter, u32 flags);

‎kernel/trace/trace_functions_graph.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,12 @@ static struct tracer_opt trace_opts[] = {
6060
{ TRACER_OPT(funcgraph-tail, TRACE_GRAPH_PRINT_TAIL) },
6161
/* Include sleep time (scheduled out) between entry and return */
6262
{ TRACER_OPT(sleep-time, TRACE_GRAPH_SLEEP_TIME) },
63+
64+
#ifdef CONFIG_FUNCTION_PROFILER
6365
/* Include time within nested functions */
6466
{ TRACER_OPT(graph-time, TRACE_GRAPH_GRAPH_TIME) },
67+
#endif
68+
6569
{ } /* Empty entry */
6670
};
6771

0 commit comments

Comments
 (0)