Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Details  





2 See also  





3 References  





4 External links  














ftrace






Español
Norsk bokmål
Suomi
 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


ftrace
Developer(s)Steven Rostedt and others
Initial releaseOctober 9, 2008; 15 years ago (2008-10-09)
Operating systemLinux
TypeKernel extension
LicenseGNU GPL version 2[1]
Websitewww.kernel.org/doc/html/latest/trace/index.html

ftrace (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.[2][3]

Details

[edit]

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, and operations related to file systems and virtualization. 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 reports. 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.[2][4][5]: 3–11, 14, 18 

An ftrace-enabled Linux kernel is built by enabling the CONFIG_FUNCTION_TRACER kernel configuration option. The entire runtime interaction with ftrace is performed through readable and writable virtual files contained in a specifically mounted debugfs file system; as a result, ftrace requires no specialized userspace utilities to operate.[2][3][6] However, there are additional userspace utilities that provide more advanced features for data recording, analysis and visualization; examples of such utilities are trace-cmd and KernelShark.[2][5]: 31–47 [7][8]

Internally, ftrace relies on the gcc's profiling mechanism to prepend machine instructions to the compiled versions of all source-level kernel functions, which redirect the execution of functions to the ftrace's trampolines and tracer plugins that perform the actual tracing. These "entry point" instructions created by gcc are altered by ftrace when the kernel is booted, and varied later at runtime by ftrace between NOPs and actual jumps to the tracing trampolines, depending on the tracing types and options configured at runtime.[9][10]

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

See also

[edit]

References

[edit]
  1. ^ "Linux kernel source: kernel/COPYING file". kernel.org. March 13, 1994. Retrieved June 11, 2016.
  • ^ a b c d Jake Edge (March 13, 2009). "A look at ftrace". LWN.net. Retrieved July 23, 2014.
  • ^ a b Steven Rostedt (June 16, 2014). "Linux kernel documentation: Documentation/trace/ftrace.txt". kernel.org. Retrieved July 23, 2014.
  • ^ "Red Hat Enterprise MRG 2 documentation, Section 3.8. Using the ftrace utility for tracing latencies". Red Hat. May 23, 2014. Retrieved July 24, 2014.
  • ^ a b Steven Rostedt (October 18, 2010). "Ftrace: Linux Kernel Tracing" (PDF). linuxfoundation.org. Archived from the original (PDF) on March 8, 2013. Retrieved July 23, 2014.
  • ^ "Red Hat Enterprise Linux 6 documentation, Section 6.5. ftrace". Red Hat. March 14, 2014. Retrieved July 23, 2014.
  • ^ Steven Rostedt (October 20, 2010). "trace-cmd: A front-end for Ftrace". LWN.net. Retrieved January 19, 2015.
  • ^ Steven Rostedt (February 2, 2011). "Using KernelShark to analyze the real-time scheduler". LWN.net. Retrieved June 11, 2016.
  • ^ Steven Rostedt (January 5, 2015). "Ftrace Kernel Hooks: More than just tracing" (PDF). linuxplumbersconf.org. pp. 6–12, 24, 34, 56–58. Retrieved June 11, 2016.
  • ^ Tim Bird (November 1, 2012). "Measuring Function Duration with Ftrace" (PDF). elinux.org. pp. 5–6, 12–14. Retrieved June 11, 2016.
  • ^ "Linux kernel 2.6.27, Section 1.7. ftrace, sysprof support". kernelnewbies.org. October 9, 2008. Retrieved July 23, 2014.
  • [edit]
    Retrieved from "https://en.wikipedia.org/w/index.php?title=Ftrace&oldid=1129404139"

    Categories: 
    Debugging
    Free software programmed in C
    Linux kernel features
    Unix programming tools
    Hidden categories: 
    Articles with short description
    Short description matches Wikidata
    Use mdy dates from August 2014
     



    This page was last edited on 25 December 2022, at 04:56 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki