Lines Matching +full:out +full:- +full:functions

8 	This document is out of date. Some of the description below doesn't
12 ------------
27 -------------
30 - STACKTRACE_SUPPORT - implement save_stack_trace()
31 - TRACE_IRQFLAGS_SUPPORT - implement include/asm/irqflags.h
35 --------------------
37 You will need to implement the mcount and the ftrace_stub functions.
40 "mcount", "_mcount", or even "__mcount". You can probably figure it out by
43 $ echo 'main(){}' | gcc -x c -S -o - - -pg | grep mcount
56 be (semi-)relevant.
61 the mcount function normally calls __mcount_internal -- the first argument is
68 - "frompc" - the address bar() will use to return to foo()
69 - "selfpc" - the address bar() (with mcount() size adjustment)
78 Here is some pseudo code that should help (these functions should actually be
103 unsigned long selfpc = <return address> - MCOUNT_INSN_SIZE;
117 --------------------------
121 some functions to save (hijack) and restore the return address.
126 function, call the arch-specific function ftrace_graph_caller which in turn
127 calls the arch-specific function prepare_ftrace_return. Neither of these
129 consistent across the architecture ports -- easier to compare & contrast
136 temporarily to have it point to the arch-specific function return_to_handler.
168 unsigned long selfpc = <return address> - MCOUNT_INSN_SIZE;
169 /* passing frame pointer up is optional -- see below */
178 more information). The only architecture-specific piece in it is the setup of
205 ---------------------------
221 ------------------------
225 - Support HAVE_ARCH_TRACEHOOK (see arch/Kconfig).
226 - Have a NR_syscalls variable in <asm/unistd.h> that provides the number
228 - Support the TIF_SYSCALL_TRACEPOINT thread flags.
229 - Put the trace_sys_enter() and trace_sys_exit() tracepoints calls from ptrace
231 - If the system call table on this arch is more complicated than a simple array
234 - If the symbol names of the system calls do not match the function names on
238 - Tag this arch as HAVE_SYSCALL_TRACEPOINTS.
242 -------------------------
244 See scripts/recordmcount.pl for more info. Just fill in the arch-specific
250 -------------------
255 Once those are out of the way, you will need to implement:
256 - asm/ftrace.h:
257 - MCOUNT_ADDR
258 - ftrace_call_adjust()
259 - struct dyn_arch_ftrace{}
260 - asm code:
261 - mcount() (new stub)
262 - ftrace_caller()
263 - ftrace_call()
264 - ftrace_stub()
265 - C code:
266 - ftrace_dyn_arch_init()
267 - ftrace_make_nop()
268 - ftrace_make_call()
269 - ftrace_update_ftrace_func()
271 First you will need to fill out some arch details in your asm/ftrace.h.
282 will be able to stub it out like so::
299 With the header out of the way, we can fill out the assembly code. While we
302 and then all references to it will be patched out never to return. Instead,
308 Before we get confused anymore, let's check out some pseudo code so you can
321 unsigned long selfpc = <return address> - MCOUNT_INSN_SIZE;
333 patching multiple things. First, only functions that we actually want to trace
351 There are two functions that are used to do runtime patching of arbitrary
352 functions. The first is used to turn the mcount call site into a nop (which
356 linux/ftrace.h for the functions::
361 The rec->ip value is the address of the mcount call site that was collected
375 ------------------------------------------------
380 - update:
381 - ftrace_caller()
382 - ftrace_graph_call()
383 - ftrace_graph_caller()
384 - implement:
385 - ftrace_enable_ftrace_graph_caller()
386 - ftrace_disable_ftrace_graph_caller()
392 - add a nop stub after the ftrace_call location named ftrace_graph_call;
394 - update ftrace_graph_caller() to work with being called by the new
396 - ftrace_enable_ftrace_graph_caller() will runtime patch the
398 - ftrace_disable_ftrace_graph_caller() will runtime patch the