uflow(8)

πŸŽ€ uflow(8) β€” System Manager's Manual πŸŽ€

πŸ’– NAME πŸ’–

okay so this page is about uflow and its whole squad: javaflow, perlflow, phpflow, pythonflow, rubyflow, and tclflow 🧚. They all print a flow graph of method calls in high-level languages, so you can literally watch the program's methods hand off to each other ✨

🌸 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 πŸ¦‹

okay so uflow traces method calls and prints them as a flow graph πŸ’… It's giving debugging superpowers, because you can follow the program's execution (the method flow) step by step πŸ”₯

this tool leans on USDT probes that are baked into a bunch of high-level languages, like Java, Perl, PHP, Python, Ruby, and Tcl 🌈 Your runtime has to be instrumented with these probes. Sometimes that means building from source with a USDT-specific flag, like --enable-dtrace or --with-dtrace πŸ› οΈ For Java processes you need the startup flag -XX:+ExtendedDTraceProbes. For PHP processes, the environment variable USE_ZEND_DTRACE must be set to 1. no cap, don't skip these πŸ™ˆ

⚠️ Since this uses BPF, only the root user can use this tool. Sorry bestie, no exceptions 😭

🧚 REQUIREMENTS 🧚

CONFIG_BPF and bcc.

✨ OPTIONS ✨

  • -M METHOD β€” literally only print method calls whose method name starts with this string πŸ’œ
  • -C CLAZZ β€” only print method calls whose class name starts with this string. The class name depends a lot on the language, so it's a vibe check 🫢 For example, in Java you write classes like package/subpackage/ClassName.
  • -v β€” prints the resulting BPF program, for debugging purposes πŸ”
  • {java,perl,php,python,ruby,tcl} β€” the language you want to trace 🌸
  • pid β€” the process id you want to trace 🎯

πŸ“ EXAMPLES πŸ“

okay so here's how you use it:

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

πŸ’… FIELDS πŸ’…

  • CPU β€” the CPU number the method was invoked on. This is super handy for spotting where the output jumps to a different CPU πŸ‘‘
  • PID β€” the process id 🌷
  • TID β€” the thread id 🧡
  • TIME β€” how long the method call lasted ⏰
  • METHOD β€” the method name πŸ’«

πŸ’€ OVERHEAD πŸ’€

🚨 This tool has extremely high overhead because it prints every single method call. In some scenarios you might see lost samples in the output, since the tool can't keep up with the rate of data coming from the kernel. Filtering by class or method prefix can help cut down the amount of data printed, but the collection mechanism itself still has very high overhead. Do not use this for performance-sensitive production scenarios, and always test first 😭

🌈 SOURCE 🌈

this is from bcc πŸ¦„

https://github.com/iovisor/bcc

also look in the bcc distribution for a companion _example.txt file, which has example usage, output, and commentary for this tool πŸ“š

πŸŽ€ OS πŸŽ€

Linux 🐧

πŸ™ˆ STABILITY πŸ™ˆ

Unstable, still in development 🚧

πŸ’œ AUTHOR πŸ’œ

Sasha Goldshtein 🫢

πŸ”— SEE ALSO πŸ”—

trace(8), ustat(8) ✨


bestie, that's the whole page πŸ’– It's from USER COMMANDS, dated 2018-10-09, and it's all about uflow(8) 🧚✨ periodt πŸ’