ftrace

From Wikipedia, the free encyclopedia
Jump to: navigation, search

ftrace (abbreviated from Function Tracer) is a tracing framework for the Linux kernel. Although its original name, Function Tracer, came from ftrace's ability to record information related to various function calls performed while the kernel is running, ftrace's tracing capabilities cover a much broader range of kernel's internal operations.[1][2]

With its various tracer plugins, ftrace can be targeted at different static tracepoints, such as scheduling events, interrupts, memory-mapped I/O, CPU power state transitions, file system– and virtualization-related operations. Also, dynamic tracking of kernel function calls is available, optionally restrictable to a subset of functions by using globs, and with the possibility to generate call graphs and provide stack usage. At the same time, ftrace can be used to measure various latencies within the Linux kernel, such as for how long interrupts or preemption are disabled.[1][3][4]:3–11, 14, 18

A ftrace-enabled Linux kernel is built by enabling the CONFIG_FUNCTION_TRACER kernel configuration option. The entire interaction with ftrace is performed through readable and writable virtual files contained in a specifically mounted debugfs file system, thus ftrace requires no userspace utilities to operate.[1][2][5] However, additional userspace utilities—​such as trace-cmd and KernelShark—​exist to provide improved data recording, analysis and visualization features.[1][4]:31–47

ftrace is primarily developed by Steven Rostedt, and it was merged into the Linux kernel mainline in kernel version 2.6.27, released on October 9, 2008.[6]

See also[edit]

  • DTrace – a tracing framework for troubleshooting kernel and application problems, originally developed for Solaris
  • ktrace – a BSD Unix and Mac OS X utility that traces kernel–program interactions
  • ltrace – a Linux debugging utility, displays the calls a userland application makes to shared libraries
  • strace – a debugging utility for Linux and some other Unix-like systems, monitors system calls used by a program and all received signals
  • SystemTap – a scripting language and utility used for instrumenting Linux installations

References[edit]

  1. ^ a b c d Jake Edge (2009-03-13). "A look at ftrace". LWN.net. Retrieved 2014-07-23. 
  2. ^ a b Steven Rostedt (2014-06-16). "Documentation/trace/ftrace.txt". Linux kernel documentation. kernel.org. Retrieved 2014-07-23. 
  3. ^ "3.8. Using the ftrace utility for tracing latencies". "Red Hat Enterprise MRG 2 Documentation". Red Hat. 2014-05-23. Retrieved 2014-07-24. 
  4. ^ a b Steven Rostedt (2010-10-18). "Ftrace: Linux Kernel Tracing" (PDF). linuxfoundation.org. Retrieved 2014-07-23. 
  5. ^ "6.5. ftrace". "Red Hat Enterprise Linux 6 Documentation". Red Hat. 2014-03-14. Retrieved 2014-07-23. 
  6. ^ "1.7. ftrace, sysprof support". "Linux kernel 2.6.27". kernelnewbies.org. 2008-10-09. Retrieved 2014-07-23. 

External links[edit]