DOKK / manpages / debian 11 / perf-tools-unstable / funccount-perf.8.en
funccount(8) System Manager's Manual funccount(8)

funccount - count kernel function calls matching specified wildcards. Uses Linux ftrace.

funccount [-hT] [-i secs] [-d secs] [-t top] funcstring

This tool is a quick way to determine which kernel functions are being called, and at what rate. It uses ftrace function profiling capabilities.

WARNING: This uses dynamic tracing of (what can be many) kernel functions, and could cause kernel panics or freezes. Test, and know what you are doing, before use.

Since this uses ftrace, only the root user can use this tool.

CONFIG_FUNCTION_PROFILER, which you may already have enabled and available on recent kernels, and awk.

-d seconds Total duration of the trace.

Print usage message.
Print an interval summary every so many seconds.
Print top number of entries only.
Include timestamp on each summary.
A function name to trace, which may include file glob style wildcards ("*") at the beginning or ending of a string only. Eg, "vfs*" means match "vfs" followed by anything.

# funccount 'bio_*'
# funccount -i 1 -d 5 'tcp_*'
# funccount -t 20 'ext4*'

Kernel function name.
Number of times this function was called during the tracing interval.

This uses the ftrace profiling framework, which does in-kernel counts, lowering the overhead (compared to tracing each event).

This is from the perf-tools collection:

https://github.com/brendangregg/perf-tools

Also look under the examples directory for a text file containing example usage, output, and commentary for this tool.

Linux

Unstable - in development.

Brendan Gregg

functrace(8)

2014-07-19 USER COMMANDS