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