Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1466320

[PATCH 2/8] ftrace: only allocate the ret_stack 'fp' field when needed

From Josh Poimboeuf <jpoimboe@redhat.com>
Newsgroups linux.kernel
Subject [PATCH 2/8] ftrace: only allocate the ret_stack 'fp' field when needed
Date 2016-08-19 14:00 +0200
Message-ID <s7QCT-594-47@gated-at.bofh.it> (permalink)
References <s7QCS-594-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


This saves some memory when HAVE_FUNCTION_GRAPH_FP_TEST isn't defined.
On x86_64 with newer versions of gcc which have -mfentry, it saves 400
bytes per task.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
 include/linux/ftrace.h               | 2 ++
 kernel/trace/trace_functions_graph.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 7d565af..4ad9ccc 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -795,7 +795,9 @@ struct ftrace_ret_stack {
 	unsigned long func;
 	unsigned long long calltime;
 	unsigned long long subtime;
+#ifdef HAVE_FUNCTION_GRAPH_FP_TEST
 	unsigned long fp;
+#endif
 };
 
 /*
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index fc173cd..0e03ed0 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -171,7 +171,9 @@ ftrace_push_return_trace(unsigned long ret, unsigned long func, int *depth,
 	current->ret_stack[index].func = func;
 	current->ret_stack[index].calltime = calltime;
 	current->ret_stack[index].subtime = 0;
+#ifdef HAVE_FUNCTION_GRAPH_FP_TEST
 	current->ret_stack[index].fp = frame_pointer;
+#endif
 	*depth = current->curr_ret_stack;
 
 	return 0;
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/8] ftrace/x86: function_graph stack dump fixes Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-19 14:00 +0200
  [PATCH 5/8] x86/dumpstack/ftrace: convert dump_trace() callbacks to use ftrace_graph_ret_addr() Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-19 14:00 +0200
    [tip:x86/asm] x86/dumpstack/ftrace: Convert dump_trace() callbacks  to use ftrace_graph_ret_addr() tip-bot for Josh Poimboeuf <tipbot@zytor.com> - 2016-08-24 15:50 +0200
  [PATCH 1/8] ftrace: remove CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST from config Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-19 14:00 +0200
    [tip:x86/asm] ftrace: Remove CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST  from config tip-bot for Josh Poimboeuf <tipbot@zytor.com> - 2016-08-24 15:10 +0200
  [PATCH 7/8] x86/dumpstack/ftrace: mark function graph handler function as unreliable Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-19 14:00 +0200
    [tip:x86/asm] x86/dumpstack/ftrace: Mark function graph handler  function as unreliable tip-bot for Josh Poimboeuf <tipbot@zytor.com> - 2016-08-24 15:50 +0200
  [PATCH 8/8] x86/dumpstack/ftrace: don't print unreliable addresses in print_context_stack_bp() Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-19 14:00 +0200
    [tip:x86/asm] x86/dumpstack/ftrace: Don't print unreliable  addresses in print_context_stack_bp() tip-bot for Josh Poimboeuf <tipbot@zytor.com> - 2016-08-24 15:50 +0200
  [PATCH 2/8] ftrace: only allocate the ret_stack 'fp' field when needed Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-19 14:00 +0200
    [tip:x86/asm] ftrace: Only allocate the ret_stack 'fp' field when  needed tip-bot for Josh Poimboeuf <tipbot@zytor.com> - 2016-08-24 15:10 +0200
  [PATCH 6/8] ftrace/x86: implement HAVE_FUNCTION_GRAPH_RET_ADDR_PTR Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-19 14:00 +0200
    [tip:x86/asm] ftrace/x86: Implement  HAVE_FUNCTION_GRAPH_RET_ADDR_PTR tip-bot for Josh Poimboeuf <tipbot@zytor.com> - 2016-08-24 15:10 +0200
  [PATCH 4/8] ftrace: add ftrace_graph_ret_addr() stack unwinding helpers Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-19 14:00 +0200
    [tip:x86/asm] ftrace: Add ftrace_graph_ret_addr() stack unwinding  helpers tip-bot for Josh Poimboeuf <tipbot@zytor.com> - 2016-08-24 15:10 +0200
  Re: [PATCH 0/8] ftrace/x86: function_graph stack dump fixes Steven Rostedt <rostedt@goodmis.org> - 2016-08-23 16:30 +0200
    Re: [PATCH 0/8] ftrace/x86: function_graph stack dump fixes Ingo Molnar <mingo@kernel.org> - 2016-08-24 12:20 +0200

csiph-web