Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
3.10. Latency Tracing Using trace-cmd
trace-cmd is a front-end tool to ftrace. It can enable the ftrace interactions described earlier without needing to write into the /sys/kernel/debug/tracing/ directory. It can be installed without the special tracing kernel variants, and it does not add any overhead when it is installed.
- To install the
trace-cmdtool, enter the following command asroot:yum install trace-cmd
~]# yum install trace-cmdCopy to Clipboard Copied! Toggle word wrap Toggle overflow - To start the utility, type
trace-cmdat the shell prompt, along with the options you require, using the following syntax:trace-cmd command
~]# trace-cmd commandCopy to Clipboard Copied! Toggle word wrap Toggle overflow Some examples of commands are:trace-cmd record -p function myapp
~]# trace-cmd record -p function myappCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enable and start recording functions executing within the kernel while myapp runs. It records functions from all CPUS and all tasks, even those not related to myapp.trace-cmd report
~]# trace-cmd reportCopy to Clipboard Copied! Toggle word wrap Toggle overflow Display the result.trace-cmd record -p function -l 'sched*' myapp
~]# trace-cmd record -p function -l 'sched*' myappCopy to Clipboard Copied! Toggle word wrap Toggle overflow Record only functions that start withschedwhile myapp runs.trace-cmd start -e irq
~]# trace-cmd start -e irqCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enable all the IRQ events.trace-cmd start -p wakeup_rt
~]# trace-cmd start -p wakeup_rtCopy to Clipboard Copied! Toggle word wrap Toggle overflow Start thewakeup_rttracer.trace-cmd start -p preemptirqsoff -d
~]# trace-cmd start -p preemptirqsoff -dCopy to Clipboard Copied! Toggle word wrap Toggle overflow Start thepreemptirqsofftracer but disable function tracing in doing so. Note: the version of trace-cmd in Red Hat Enterprise Linux 7 turns offftrace_enabledinstead of using thefunction-traceoption. You can enable it again withtrace-cmd start -p function.trace-cmd start -p nop
~]# trace-cmd start -p nopCopy to Clipboard Copied! Toggle word wrap Toggle overflow Restore the state in which the system was before trace-cmd started modifying it. This is important if you want to use the debugfs file system after using trace-cmd, whether or not the system was restarted in the meantime.
Note
See the trace-cmd(1) man page for a complete list of commands and options. All the individual commands also have their own man pages, trace-cmd-command. For further information about event tracing and function tracer, see Appendix A, Event Tracing and Appendix B, Detailed Description of Ftrace. - In this example, the
trace-cmdutility will trace a single trace point:trace-cmd record -e sched_wakeup ls /bin
~]# trace-cmd record -e sched_wakeup ls /binCopy to Clipboard Copied! Toggle word wrap Toggle overflow