Este contenido no está disponible en el idioma seleccionado.
4.3. Profiling
4.3.1. Counting Function Calls Made Copiar enlaceEnlace copiado en el portapapeles!
Example 4.21. functioncallcount.stp
stap functioncallcount.stp "*@mm/*.c"
:
Example 4.22. Example 4.21, “functioncallcount.stp” Sample Output
4.3.2. Call Graph Tracing Copiar enlaceEnlace copiado en el portapapeles!
Example 4.23. para-callgraph.stp
- The function(s) whose entry/exit you'd like to trace (
$1
). - A second optional trigger function (
$2
), which enables or disables tracing on a per-thread basis. Tracing in each thread will continue as long as the trigger function has not exited yet.
thread_indent()
; as such, its output contains the timestamp, process name, and thread ID of $1
(the probe function you are tracing). For more information about thread_indent()
, see its entry in SystemTap Functions.
stap para-callgraph.stp 'kernel.function("*@fs/*.c")' 'kernel.function("sys_read")'
:
Example 4.24. Example 4.23, “para-callgraph.stp” Sample Output
4.3.3. Determining Time Spent in Kernel and User Space Copiar enlaceEnlace copiado en el portapapeles!
Example 4.25. thread-times.stp
Example 4.26. Example 4.25, “thread-times.stp” Sample Output
4.3.4. Monitoring Polling Applications Copiar enlaceEnlace copiado en el portapapeles!
Example 4.27. timeout.stp
poll
select
epoll
itimer
futex
nanosleep
signal
Example 4.28. Example 4.27, “timeout.stp” Sample Output
timer.s()
). The output of Example 4.21, “functioncallcount.stp” contains the name and UID of the top 20 polling applications, along with how many times each application performed each polling system call (over time). Example 4.28, “Example 4.27, “timeout.stp” Sample Output” contains an excerpt of the script:
4.3.5. Tracking Most Frequently Used System Calls Copiar enlaceEnlace copiado en el portapapeles!
poll
select
epoll
itimer
futex
nanosleep
signal
Example 4.29. topsys.stp
Example 4.30. Example 4.29, “topsys.stp” Sample Output
4.3.6. Tracking System Call Volume Per Process Copiar enlaceEnlace copiado en el portapapeles!
Example 4.31. syscalls_by_proc.stp
Example 4.32. Example 4.29, “topsys.stp” Sample Output
Example 4.33. syscalls_by_pid.stp
timer.s()
probe; for example, to instruct the script to expire after 5 seconds, add the following probe to the script:
probe timer.s(5) { exit() }
probe timer.s(5)
{
exit()
}