ucalls(8)
β¨ ucalls(8) β¨
ucalls is part of the System Manager's Manual π and it's the bestie for this job. Its manual name is ucalls(8).
π NAME π
ucalls, javacalls, perlcalls, phpcalls, pythoncalls, rubycalls, tclcalls: summarize method calls from high-level languages and Linux syscalls β¨
π«Ά SYNOPSIS π«Ά
javacalls [-h] [-T TOP] [-L] [-S] [-v] [-m] pid [interval]
perlcalls [-h] [-T TOP] [-L] [-S] [-v] [-m] pid [interval]
phpcalls [-h] [-T TOP] [-L] [-S] [-v] [-m] pid [interval]
pythoncalls [-h] [-T TOP] [-L] [-S] [-v] [-m] pid [interval]
rubycalls [-h] [-T TOP] [-L] [-S] [-v] [-m] pid [interval]
tclcalls [-h] [-T TOP] [-L] [-S] [-v] [-m] pid [interval]
ucalls [-l {java,perl,php,python,ruby}] [-h] [-T TOP] [-L] [-S] [-v]
[-m] pid [interval]
π¦ DESCRIPTION π¦
okay so this tool summarizes method calls from high-level languages like Java, Perl, PHP, Python, Ruby, and Tcl π It can also trace Linux system calls too, which is so iconic. Every time a method gets invoked, ucalls records the call count and, if you want, the method's execution time (latency), and then shows you a summary. Main character energy π
This uses in-kernel eBPF maps to store per-process summaries, so it stays efficient β
Real talk, this tool relies on USDT probes that are embedded in lots of high-level languages, like Java, Perl, PHP, Python, Ruby, and Tcl. You need a runtime that's instrumented with these probes π₯ In some cases that means building from source with a USDT-specific flag, like --enable-dtrace or --with-dtrace. For Java, method probes aren't enabled by default, so you have to start the Java process with the -XX:+ExtendedDTraceProbes flag to turn them on. For PHP processes, the environment variable USE_ZEND_DTRACE must be set to 1.
π¨ Since this uses BPF, only the root user can use this tool. No exceptions, bestie.
π REQUIREMENTS π
CONFIG_BPF and bcc. Make sure you've got both β¨
π OPTIONS π
-l {java,perl,php,python,ruby,tcl}β pick the language you want to trace. If you don't give one, only syscalls get traced, and only when you also use the-Soption πΈ-T TOPβ only print the top methods, ranked by frequency or latency π-Lβ collect method invocation latency (duration) π§-Sβ collect Linux syscalls frequency and timing π-vβ print the resulting BPF program. This is for debugging, so use it when you're investigating π-mβ print times in milliseconds. The default is microseconds, so keep that in mind πpidβ the process id you want to trace π¦intervalβ print the summary after this many seconds, then exit. By default it just waits for Ctrl+C to terminate β
πΈ EXAMPLES πΈ
Trace the top 10 Ruby method calls:
# ucalls -T 10 -l ruby 1344
Trace Python method calls and Linux syscalls, including latency in milliseconds:
# ucalls -l python -mL 2020
Trace only syscalls and print a summary after 10 seconds:
# ucalls -S 788 10
π₯΅ OVERHEAD π₯΅
Tracing individual method calls creates a considerable overhead in all high-level languages, so it's giving heavy. For languages with just-in-time compilation, like Java, the overhead can be even bigger than for interpreted languages. On the other hand, syscall tracing is typically tolerable for most processes, unless they have a very unusual rate of system calls π
π§ SOURCE π§
This is from bcc π
https://github.com/iovisor/bcc
Also look in the bcc distribution for a companion _example.txt file. It has example usage, output, and commentary for this tool, and it's honestly so helpful π«Ά
π OS π
Linux π§
π STABILITY π
Unstable - in development. So it's still cooking, bestie π³
π AUTHOR π
Sasha Goldshtein β¨
π¦ SEE ALSO π¦
ustat(8), argdist(8) π
Okay that's the whole tea π« This page is from the System Manager's Manual and was filed under USER COMMANDS, dated 2018-10-09, as ucalls(8). Slay forever π π
π¦ where this page comes from
- centos-stream 10: bcc-tools 0.36.1-1.el10 Β· Apache-2.0
- centos-stream 9: bcc-tools 0.36.1-1.el9 Β· ASL 2.0
- fedora 43: bcc-tools 0.35.0-2.fc43 Β· Apache-2.0
- fedora 44: bcc-tools 0.35.0-5.fc44 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms