Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a port of BCC's funclatency. Usage: --------- Time functions and print latency as a histogram Usage: funclatency [-h] [-m|-u] [-p PID] [-d DURATION] [ -i INTERVAL ] [-T] FUNCTION Choices for FUNCTION: FUNCTION (kprobe) LIBRARY:FUNCTION (uprobe a library in -p PID) :FUNCTION (uprobe the binary of -p PID) -m, --milliseconds Output in milliseconds -u, --microseconds Output in microseconds -p, --pid=PID Process ID to trace -d, --duration=DURATION Duration to trace -i, --interval=INTERVAL Summary interval in seconds -T, --timestamp Print timestamp -?, --help Give this help list --usage Give a short usage message -V, --version Print program version Mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options. Examples: ./funclatency do_sys_open # time the do_sys_open() kernel function ./funclatency -m do_nanosleep # time do_nanosleep(), in milliseconds ./funclatency -u vfs_read # time vfs_read(), in microseconds ./funclatency -p 181 vfs_read # time process 181 only ./funclatency -p 181 c:read # time the read() C library function ./funclatency -p 181 :foo # time foo() from pid 181's userspace ./funclatency -i 2 -d 10 vfs_read # output every 2 seconds, for 10s ./funclatency -mTi 5 vfs_read # output every 5 seconds, with timestamps --------- It supports kprobes and has limited support for uprobes. Currently, you cannot uprobe a library unless you provide a PID. It does not support wildcard patterns. Some of the functions for uprobes are useful for other programs, so I put those in uprobe_helpers.{c,h}. Signed-off-by: Barret Rhoden <[email protected]>
- Loading branch information