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 --------------------------------
224 prevents potential stack unwinding issues where the unwinder gets out of
233 ------------------------
237 - Support HAVE_ARCH_TRACEHOOK (see arch/Kconfig).
238 - Have a NR_syscalls variable in <asm/unistd.h> that provides the number
240 - Support the TIF_SYSCALL_TRACEPOINT thread flags.
241 - Put the trace_sys_enter() and trace_sys_exit() tracepoints calls from ptrace
243 - If the system call table on this arch is more complicated than a simple array
246 - If the symbol names of the system calls do not match the function names on
250 - Tag this arch as HAVE_SYSCALL_TRACEPOINTS.
254 -------------------------
256 See scripts/recordmcount.pl for more info. Just fill in the arch-specific
262 -------------------
267 Once those are out of the way, you will need to implement:
268 - asm/ftrace.h:
269 - MCOUNT_ADDR
270 - ftrace_call_adjust()
271 - struct dyn_arch_ftrace{}
272 - asm code:
273 - mcount() (new stub)
274 - ftrace_caller()
275 - ftrace_call()
276 - ftrace_stub()
277 - C code:
278 - ftrace_dyn_arch_init()
279 - ftrace_make_nop()
280 - ftrace_make_call()
281 - ftrace_update_ftrace_func()
283 First you will need to fill out some arch details in your asm/ftrace.h.
294 will be able to stub it out like so::
311 With the header out of the way, we can fill out the assembly code. While we
314 and then all references to it will be patched out never to return. Instead,
320 Before we get confused anymore, let's check out some pseudo code so you can
333 unsigned long selfpc = <return address> - MCOUNT_INSN_SIZE;
345 patching multiple things. First, only functions that we actually want to trace
363 There are two functions that are used to do runtime patching of arbitrary
364 functions. The first is used to turn the mcount call site into a nop (which
368 linux/ftrace.h for the functions::
373 The rec->ip value is the address of the mcount call site that was collected
387 ------------------------------------------------
392 - update:
393 - ftrace_caller()
394 - ftrace_graph_call()
395 - ftrace_graph_caller()
396 - implement:
397 - ftrace_enable_ftrace_graph_caller()
398 - ftrace_disable_ftrace_graph_caller()
404 - add a nop stub after the ftrace_call location named ftrace_graph_call;
406 - update ftrace_graph_caller() to work with being called by the new
408 - ftrace_enable_ftrace_graph_caller() will runtime patch the
410 - ftrace_disable_ftrace_graph_caller() will runtime patch the