funccount(8)
β¨ funccount π
okay bestie, so this is funccount, and she's a System Manager's Manual girlie (section 8, we love a system admin icon). She counts kernel function calls that match whatever wildcards you throw at her, and she does it using Linux ftrace. π¦
πΈ SYNOPSIS πΈ
funccount [-hT] [-i secs] [-d secs] [-t top] funcstring
π DESCRIPTION π
So basically? This tool is the quickest little way to figure out which kernel functions are getting called, and how fast they're getting called. She runs on ftrace's function profiling capabilities, and honestly? It's giving effortless. π
β οΈ WARNING, and I need you to actually read this part bestie: this uses dynamic tracing of (what can be, like, SO many) kernel functions, and it could cause kernel panics or freezes. π Test it first. Know what you're doing before you use it. This is not a vibes-only situation.
And since she rides on ftrace, only the root user can use this tool. No root, no funccount. That's just the rules. π
π REQUIREMENTS π
CONFIG_FUNCTION_PROFILERβ which you might already have enabled, she's available on recent kernels, no capawk
β¨ OPTIONS β¨
-dseconds β total duration of the trace. She stops when the clock says so. β°-hβ prints the usage message. Your girl is helpful like that. π«Ά-iseconds β print an interval summary every so many seconds. Recurring check-ins, we love consistency.-ttop β print only the top number of entries. Main character entries only, we're not scrolling through everything. π-Tβ include a timestamp on each summary. For the girlies who need to know when. βfuncstringβ a function name to trace! She can include file glob style wildcards ("*") at the beginning or ending of a string only. Like,"vfs*"means match"vfs"followed by anything. Wildcards in the middle? Not the move. π
π EXAMPLES π
Count every kernel function beginning with "bio_", until Ctrl-C is hit:
# funccount 'bio_*'
Count every "tcp_*" kernel function, and print a summary every one second, five in total:
# funccount -i 1 -d 5 'tcp_*'
Count every "ext4*" kernel function, and print the top 20 when Ctrl-C is hit:
# funccount -t 20 'ext4*'
π FIELDS π
FUNCβ kernel function name. That's the one being counted, bestie.COUNTβ number of times this function was called during the tracing interval. The receipts. π§Ύ
π₯ OVERHEAD π₯
This uses the ftrace profiling framework, which does in-kernel counts β so the overhead is lower compared to tracing each event. It's giving efficiency, it's giving "she's not doing the most." π
πΈ SOURCE πΈ
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. Go read it, it's good for you. π
π¦ OS π¦
Linux. Obviously. That's the whole point. π§
β STABILITY β
Unstable - in development. She's a work in progress and that's fine, we support her journey. π
π AUTHOR π
Brendan Gregg
π SEE ALSO π
okay that's the whole page bestie, you're officially funccount-pilled π β¨
this icon was brought to you by the USER COMMANDS girlies, dated 2014-07-19 β yes she's been serving since 2014 and she's still that girl π
π¦ where this page comes from
- debian bookworm: perf-tools-unstable 1.0.1~20200130+git49b8cdf-1 Β· GPL-2.0-or-later
- debian trixie: perf-tools-unstable 1.0.1~20200130+git49b8cdf-1 Β· GPL-2.0-or-later
- ubuntu jammy: perf-tools-unstable 1.0.1~20200130+git49b8cdf-1ubuntu1 Β· GPL-2.0-or-later
- ubuntu noble: perf-tools-unstable 1.0.1~20200130+git49b8cdf-1ubuntu1 Β· GPL-2.0-or-later
- ubuntu resolute: perf-tools-unstable 1.0.1~20200130+git49b8cdf-1ubuntu2 Β· GPL-2.0-or-later
- ubuntu stonking: perf-tools-unstable 1.0.1~20200130+git49b8cdf-1ubuntu2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms