Sasha Goldshtein | 070c1df | 2016-10-29 13:08:39 -0700 | [diff] [blame] | 1 | .TH ucalls 8 "2016-11-07" "USER COMMANDS" |
| 2 | .SH NAME |
Paul Chaignon | caa14ed | 2017-04-02 21:57:13 +0200 | [diff] [blame] | 3 | ucalls, javacalls, pythoncalls, rubycalls, phpcalls \- Summarize method calls |
| 4 | from high-level languages and Linux syscalls. |
Sasha Goldshtein | 070c1df | 2016-10-29 13:08:39 -0700 | [diff] [blame] | 5 | .SH SYNOPSIS |
Paul Chaignon | caa14ed | 2017-04-02 21:57:13 +0200 | [diff] [blame] | 6 | .B javacalls [-h] [-T TOP] [-L] [-S] [-v] [-m] pid [interval] |
| 7 | .br |
| 8 | .B pythoncalls [-h] [-T TOP] [-L] [-S] [-v] [-m] pid [interval] |
| 9 | .br |
| 10 | .B rubycalls [-h] [-T TOP] [-L] [-S] [-v] [-m] pid [interval] |
| 11 | .br |
| 12 | .B phpcalls [-h] [-T TOP] [-L] [-S] [-v] [-m] pid [interval] |
| 13 | .br |
Sasha Goldshtein | cfb5ee7 | 2017-02-08 14:32:51 -0500 | [diff] [blame] | 14 | .B ucalls [-l {java,python,ruby,php}] [-h] [-T TOP] [-L] [-S] [-v] [-m] pid [interval] |
Sasha Goldshtein | 070c1df | 2016-10-29 13:08:39 -0700 | [diff] [blame] | 15 | .SH DESCRIPTION |
| 16 | This tool summarizes method calls from high-level languages such as Python, |
Sasha Goldshtein | cfb5ee7 | 2017-02-08 14:32:51 -0500 | [diff] [blame] | 17 | Java, Ruby, and PHP. It can also trace Linux system calls. Whenever a method is |
Sasha Goldshtein | 070c1df | 2016-10-29 13:08:39 -0700 | [diff] [blame] | 18 | invoked, ucalls records the call count and optionally the method's execution |
| 19 | time (latency) and displays a summary. |
| 20 | |
| 21 | This uses in-kernel eBPF maps to store per process summaries for efficiency. |
| 22 | |
| 23 | This tool relies on USDT probes embedded in many high-level languages, such as |
Sasha Goldshtein | cfb5ee7 | 2017-02-08 14:32:51 -0500 | [diff] [blame] | 24 | Java, Python, Ruby, and PHP. It requires a runtime instrumented with these |
Sasha Goldshtein | 070c1df | 2016-10-29 13:08:39 -0700 | [diff] [blame] | 25 | probes, which in some cases requires building from source with a USDT-specific |
| 26 | flag, such as "--enable-dtrace" or "--with-dtrace". For Java, method probes are |
| 27 | not enabled by default, and can be turned on by running the Java process with |
Sasha Goldshtein | cfb5ee7 | 2017-02-08 14:32:51 -0500 | [diff] [blame] | 28 | the "-XX:+ExtendedDTraceProbes" flag. For PHP processes, the environment |
| 29 | variable USE_ZEND_DTRACE must be set to 1. |
Sasha Goldshtein | 070c1df | 2016-10-29 13:08:39 -0700 | [diff] [blame] | 30 | |
| 31 | Since this uses BPF, only the root user can use this tool. |
| 32 | .SH REQUIREMENTS |
| 33 | CONFIG_BPF and bcc. |
| 34 | .SH OPTIONS |
| 35 | .TP |
Sasha Goldshtein | cfb5ee7 | 2017-02-08 14:32:51 -0500 | [diff] [blame] | 36 | \-l {java,python,ruby,php} |
Sasha Goldshtein | 070c1df | 2016-10-29 13:08:39 -0700 | [diff] [blame] | 37 | The language to trace. If not provided, only syscalls are traced (when the \-S |
| 38 | option is used). |
| 39 | .TP |
| 40 | \-T TOP |
| 41 | Print only the top methods by frequency or latency. |
| 42 | .TP |
| 43 | \-L |
| 44 | Collect method invocation latency (duration). |
| 45 | .TP |
| 46 | \-S |
| 47 | Collect Linux syscalls frequency and timing. |
| 48 | .TP |
| 49 | \-v |
| 50 | Print the resulting BPF program, for debugging purposes. |
| 51 | .TP |
| 52 | \-m |
| 53 | Print times in milliseconds (the default is microseconds). |
| 54 | .TP |
| 55 | pid |
| 56 | The process id to trace. |
| 57 | .TP |
| 58 | interval |
| 59 | Print summary after this number of seconds and then exit. By default, wait for |
| 60 | Ctrl+C to terminate. |
| 61 | .SH EXAMPLES |
| 62 | .TP |
| 63 | Trace the top 10 Ruby method calls: |
| 64 | # |
| 65 | .B ucalls -T 10 -l ruby 1344 |
| 66 | .TP |
| 67 | Trace Python method calls and Linux syscalls including latency in milliseconds: |
| 68 | # |
| 69 | .B ucalls -l python -mL 2020 |
| 70 | .TP |
| 71 | Trace only syscalls and print a summary after 10 seconds: |
| 72 | # |
| 73 | .B ucalls -S 788 10 |
| 74 | .SH OVERHEAD |
| 75 | Tracing individual method calls will produce a considerable overhead in all |
| 76 | high-level languages. For languages with just-in-time compilation, such as |
| 77 | Java, the overhead can be more considerable than for interpreted languages. |
| 78 | On the other hand, syscall tracing will typically be tolerable for most |
| 79 | processes, unless they have a very unusual rate of system calls. |
| 80 | .SH SOURCE |
| 81 | This is from bcc. |
| 82 | .IP |
| 83 | https://github.com/iovisor/bcc |
| 84 | .PP |
| 85 | Also look in the bcc distribution for a companion _example.txt file containing |
| 86 | example usage, output, and commentary for this tool. |
| 87 | .SH OS |
| 88 | Linux |
| 89 | .SH STABILITY |
| 90 | Unstable - in development. |
| 91 | .SH AUTHOR |
| 92 | Sasha Goldshtein |
| 93 | .SH SEE ALSO |
| 94 | ustat(8), argdist(8) |