Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 180099
b: refs/heads/master
c: 0368897
h: refs/heads/master
i:
  180097: badeb1a
  180095: 2f7ed94
v: v3
  • Loading branch information
Mike Frysinger authored and Steven Rostedt committed Jan 26, 2010
1 parent 51dbad8 commit cc7de1f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6993b1bb1e62367f500789835a1f747e12259f07
refs/heads/master: 03688970347bfea32823953a7ce5886d1713205f
26 changes: 23 additions & 3 deletions trunk/Documentation/trace/ftrace-design.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
function tracer guts
====================
By Mike Frysinger

Introduction
------------
Expand Down Expand Up @@ -173,14 +174,16 @@ void ftrace_graph_caller(void)

unsigned long *frompc = &...;
unsigned long selfpc = <return address> - MCOUNT_INSN_SIZE;
prepare_ftrace_return(frompc, selfpc);
/* passing frame pointer up is optional -- see below */
prepare_ftrace_return(frompc, selfpc, frame_pointer);

/* restore all state needed by the ABI */
}
#endif

For information on how to implement prepare_ftrace_return(), simply look at
the x86 version. The only architecture-specific piece in it is the setup of
For information on how to implement prepare_ftrace_return(), simply look at the
x86 version (the frame pointer passing is optional; see the next section for
more information). The only architecture-specific piece in it is the setup of
the fault recovery table (the asm(...) code). The rest should be the same
across architectures.

Expand All @@ -205,6 +208,23 @@ void return_to_handler(void)
#endif


HAVE_FUNCTION_GRAPH_FP_TEST
---------------------------

An arch may pass in a unique value (frame pointer) to both the entering and
exiting of a function. On exit, the value is compared and if it does not
match, then it will panic the kernel. This is largely a sanity check for bad
code generation with gcc. If gcc for your port sanely updates the frame
pointer under different opitmization levels, then ignore this option.

However, adding support for it isn't terribly difficult. In your assembly code
that calls prepare_ftrace_return(), pass the frame pointer as the 3rd argument.
Then in the C version of that function, do what the x86 port does and pass it
along to ftrace_push_return_trace() instead of a stub value of 0.

Similarly, when you call ftrace_return_to_handler(), pass it the frame pointer.


HAVE_FTRACE_NMI_ENTER
---------------------

Expand Down
4 changes: 1 addition & 3 deletions trunk/kernel/trace/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ config HAVE_FUNCTION_GRAPH_TRACER
config HAVE_FUNCTION_GRAPH_FP_TEST
bool
help
An arch may pass in a unique value (frame pointer) to both the
entering and exiting of a function. On exit, the value is compared
and if it does not match, then it will panic the kernel.
See Documentation/trace/ftrace-design.txt

config HAVE_FUNCTION_TRACE_MCOUNT_TEST
bool
Expand Down

0 comments on commit cc7de1f

Please sign in to comment.