uflow(8)

πŸ“¦
version 0.36.1 Β· 2 versions
, in alpine 3.24, nixpkgs unstable

πŸ’… uflow(8) β€” the flow graph glow-up πŸ’…

Okay bestie, so this is from the System Manager's Manual, and honestly? It's giving "I trace your methods so you don't have to" energy. We're talking uflow, plus its whole squad: javaflow, perlflow, phpflow, pythonflow, rubyflow, tclflow. They all print a flow graph of method calls in high-level languages. Periodt. πŸŽ€


✨ NAME ✨

uflow, javaflow, perlflow, phpflow, pythonflow, rubyflow, tclflow β€” print a flow graph of method calls in high-level languages. No cap, that's literally the whole vibe. πŸ’–


🌸 SYNOPSIS 🌸

javaflow [-h] [-M METHOD] [-C CLAZZ] [-v] pid
perlflow [-h] [-M METHOD] [-C CLAZZ] [-v] pid
phpflow [-h] [-M METHOD] [-C CLAZZ] [-v] pid
pythonflow [-h] [-M METHOD] [-C CLAZZ] [-v] pid
rubyflow [-h] [-M METHOD] [-C CLAZZ] [-v] pid
tclflow [-h] [-M METHOD] [-C CLAZZ] [-v] pid
uflow [-h] [-M METHOD] [-C CLAZZ] [-v] [-l
{java,perl,php,python,ruby,tcl}] pid

πŸ¦‹ DESCRIPTION πŸ¦‹

So uflow traces method calls and prints them in a flow graph. Why? Because following the program's execution (method flow) makes debugging and diagnostics so much easier. It's giving "main character energy" for your stack traces. ✨

This tool relies on USDT probes embedded in many high-level languages β€” think Java, Perl, PHP, Python, Ruby, and Tcl. It requires a runtime instrumented with these probes, which in some cases means building from source with a USDT-specific flag, like --enable-dtrace or --with-dtrace. For Java processes, the startup flag -XX:+ExtendedDTraceProbes is required. For PHP processes, the environment variable USE_ZEND_DTRACE must be set to 1. Iykyk. 🫢

Since this uses BPF, only the root user can use this tool. Like, root only. No exceptions. πŸ‘‘

🧚 REQUIREMENTS 🧚

CONFIG_BPF and bcc. That's it. That's the vibe check. βœ…


πŸ’… OPTIONS πŸ’…

  • -M METHOD β€” Print only method calls where the method name begins with this string. Filtering queen behavior. πŸŽ€
  • -C CLAZZ β€” Print only method calls where the class name begins with this string. The class name interpretation strongly depends on the language. For example, in Java use "package/subpackage/ClassName" to refer to classes. Slay the class hierarchy. πŸ’–
  • -v β€” Print the resulting BPF program, for debugging purposes. For when you need to see the receipts. πŸ”₯
  • {java,perl,php,python,ruby,tcl} β€” The language to trace. Pick your fighter. 🌈
  • pid β€” The process id to trace. The one. The only. The main character. πŸ‘‘

🌸 EXAMPLES 🌸

Follow method flow in a Ruby process:

# uflow ruby 148

Follow method flow in a Java process where the class name is java.lang.Thread:

# uflow -C java/lang/Thread java 1802

Literally iconic. πŸ’…


πŸ¦‹ FIELDS πŸ¦‹

  • CPU β€” The CPU number on which the method was invoked. This is useful to easily see where the output skips to a different CPU. CPU hopping tbh. πŸŒ€
  • PID β€” The process id. The OG. 🫢
  • TID β€” The thread id. Thread bestie. 🧡
  • TIME β€” The duration of the method call. How long did it take? The suspense. ⏳
  • METHOD β€” The method name. The star of the show. ⭐

😭 OVERHEAD 😭

Okay so this tool has extremely high overhead because it prints every method call. For some scenarios, you might see lost samples in the output as the tool is unable to keep up with the rate of data coming from the kernel. Filtering by class or method prefix can help reduce the amount of data printed, but there is still a very high overhead in the collection mechanism. Do not use for performance-sensitive production scenarios, and always test first.

Bestie, I cannot stress this enough: do not use this in production without testing first. It's giving "I will eat your CPU for breakfast" energy. πŸ’€

πŸŽ€ 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. It's the bonus content. πŸ“


🌈 OS 🌈

Linux. Obviously. 🐧


⭐ STABILITY ⭐

Unstable - in development. It's in its experimental era. πŸ™ˆ


πŸ’œ AUTHOR πŸ’œ

Sasha Goldshtein. The legend. The icon. The moment. πŸ‘‘


πŸ’– SEE ALSO πŸ’–

trace(8), ustat(8). Go give them a follow. 🫢


Okay bestie, that's the whole manual. Go trace those method calls, filter by class or method prefix, and remember: root only, high overhead, always test first. Slay the flow graph. πŸ’…βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’–

This page is from the USER COMMANDS section, dated 2018-10-09, and it's literally uflow(8). That's the sign-off. Periodt. πŸ’œ
πŸ“¦ where this page comes from