ustat(8)
๐ USTAT(8) ๐ System Manager's Manual
โจ NAME โจ
ustat, javastat, nodestat, perlstat, phpstat, pythonstat, rubystat, tclstat โ activity stats from high-level languages ๐
๐ฆ SYNOPSIS ๐ฆ
javastat [-C] [-S {cload,excp,gc,method,objnew,thread}] [-r MAXROWS]
[-d] [interval [count]]
nodestat [-C] [-S {cload,excp,gc,method,objnew,thread}] [-r MAXROWS]
[-d] [interval [count]]
perlstat [-C] [-S {cload,excp,gc,method,objnew,thread}] [-r MAXROWS]
[-d] [interval [count]]
phpstat [-C] [-S {cload,excp,gc,method,objnew,thread}] [-r MAXROWS] [-d]
[interval [count]]
pythonstat [-C] [-S {cload,excp,gc,method,objnew,thread}] [-r MAXROWS]
[-d] [interval [count]]
rubystat [-C] [-S {cload,excp,gc,method,objnew,thread}] [-r MAXROWS]
[-d] [interval [count]]
tclstat [-C] [-S {cload,excp,gc,method,objnew,thread}] [-r MAXROWS] [-d]
[interval [count]]
ustat [-l {java,node,perl,php,python,ruby,tcl}] [-C] [-S
{cload,excp,gc,method,objnew,thread}] [-r MAXROWS] [-d] [interval
[count]]
๐ DESCRIPTION ๐
okay so this is basically "top" but for high-level language events ๐ฅ we're talking garbage collections, exceptions, thread creations, object allocations, method calls, and more, bestie. ๐ญ The events get aggregated for each process and printed in a top-like table, which you can sort by different fields. Heads up though: not every language runtime gives you the same set of details ๐
This uses in-kernel eBPF maps to store per-process summaries, which is so efficient it's giving ๐ง
This tool relies on USDT probes embedded in a bunch of high-level languages, like Java, Node, Perl, PHP, Python, Ruby, and Tcl โจ It needs 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, some probes aren't enabled by default, but you can turn them on by running the Java process with the -XX:+ExtendedDTraceProbes flag. For PHP processes, the environment variable USE_ZEND_DTRACE must be set to 1. ๐ธ
Newly-created processes only get traced at the next interval. If you run this with a short interval (say, 1-5 seconds), it should be virtually unnoticeable ๐ซถ For longer intervals, you might miss processes that started and terminated during the interval window ๐
Since this uses BPF, only the root user can use this tool. Not me being strict, it's just the rule ๐
๐ง REQUIREMENTS ๐ง
CONFIG_BPF and bcc.
๐ OPTIONS ๐
-l {java,node,perl,php,python,ruby,tcl}โ the language you want to trace. By default, all languages get traced ๐-Cโ don't clear the screen between updates ๐-S {cload,excp,gc,method,objnew,thread}โ sort the output by the field you pick ๐-r MAXROWSโ don't print more than this many rows ๐-dโ prints the resulting BPF program, for debugging purposes ๐ฅ- interval โ the gap between updates, in seconds โญ
- count โ how many interval summaries you get ๐ฆ
๐ EXAMPLES ๐
Summarize activity in high-level languages, 1 second refresh:
# ustat
Don't clear the screen, and only show the top 8 rows:
# ustat -Cr 8
5 second summaries, 10 times only:
# ustat 5 10
๐ฎ FIELDS ๐ฎ
loadavgโ the contents of/proc/loadavgโจPIDโ process ID ๐CMDLINEโ the process command line. Honestly the second and following arguments often give you a hint as to which application is being run ๐METHOD/sโ count of method invocations during the interval ๐GC/sโ count of garbage collections during the interval ๐๏ธOBJNEW/sโ count of objects allocated during the interval ๐ธCLOAD/sโ count of classes loaded during the interval ๐ฆEXC/sโ count of exceptions thrown during the interval ๐THR/sโ count of threads created during the interval ๐งต
๐ซง OVERHEAD ๐ซง
โ ๏ธ Real talk: when you use this with high-frequency events, like method calls, you can expect a very significant slow-down ๐ญ
That said, a lot of the high-level languages covered here already have a pretty high per-method invocation cost, especially in interpreted mode, so it's not all on this tool ๐ For the lower-frequency events, like garbage collections or thread creations, the overhead should not be significant ๐ Specifically, when probing Java processes without the -XX:+ExtendedDTraceProbes flag, the most expensive probes aren't emitted, so the overhead should be acceptable โจ
๐ SOURCE ๐
This is from bcc. ๐
https://github.com/iovisor/bcc
Also look in the bcc distribution for a companion _example.txt file containing example usage, output, and commentary for this tool ๐
๐ป OS ๐ป
Linux ๐ง
๐งช STABILITY ๐งช
Unstable - in development. ๐ง
๐ฉโ๐ป AUTHOR ๐ฉโ๐ป
Sasha Goldshtein ๐
๐ SEE ALSO ๐
trace(8), argdist(8), tplist(8) ๐
Okay bestie, that's the whole page! ๐ It's the ustat(8) manual from the USER COMMANDS section, dated 2018-10-09 ๐ Now go trace some garbage collections and slay your way through your Unix era ๐ญโจ๐ซถ
๐ฆ where this page comes from
- alpine 3.24: bcc-doc 0.36.1-r1 ยท Apache-2.0
- debian bookworm: bpfcc-tools 0.26.0+ds-1 ยท Apache-2.0
- debian trixie: bpfcc-tools 0.31.0+ds-7 ยท Apache-2.0
- nixpkgs unstable: bcc 0.37.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 ยท Apache-2.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 ยท Apache-2.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 ยท Apache-2.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 ยท Apache-2.0
- ubuntu jammy: bpfcc-tools 0.18.0+ds-2 ยท Apache-2.0
- ubuntu noble: bpfcc-tools 0.29.1+ds-1ubuntu7 ยท Apache-2.0
- ubuntu questing: bpfcc-tools 0.31.0+ds-7ubuntu2 ยท Apache-2.0
- ubuntu resolute: bpfcc-tools 0.35.0+ds-1ubuntu2 ยท Apache-2.0
- ubuntu stonking: bpfcc-tools 0.35.0+ds-1ubuntu4 ยท Apache-2.0
- ๐ girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms