namhyung / uftrace

Function graph tracer for C/C++/Rust/Python
https://uftrace.github.io/slide/
GNU General Public License v2.0
3.01k stars 441 forks source link

uftrace --list-event feature isn't well documented. #923

Open DanielTimLee opened 4 years ago

DanielTimLee commented 4 years ago

uftrace --list-event feature isn't well documented.

$ uftrace --help | grep list-event
#      --list-event           List avaiable events
$ uftrace --list-event
# Usage: uftrace [OPTION...]
#             [record|replay|live|report|info|dump|recv|graph|script|tui]
#             [<program>]
# Try `uftrace --help' or `uftrace --usage' for more information.
$ uftrace --list-event net
$ sudo uftrace --list-event net

The only place that I can see how this option could be used is commit log. I think document should tell --list-event needs argument.

Seems the feature is for systemtap SDT and perf event, so it might be used less, but, I think this part should be better documented than it is now.

$ git log --grep list-event

# commit b1045b53f369647b98859fe5785f9786f28d6a9c
# Author: Namhyung Kim <namhyung@gmail.com>
# Date:   Wed Jun 28 14:31:39 2017 +0900
#
#    live: Add --list-event option
#
#    The --list-event option is just to show available events in the
#    process.
#
#      $ uftrace --list-event sdt-test | tail
#      [kernel event] net:napi_gro_frags_entry
#      [kernel event] net:netif_rx
#      [kernel event] net:netif_receive_skb
namhyung commented 4 years ago

Yes, the SDT events are from libraries so it'd be different for each program due to the different dependencies. But other events are global so can be listed regardless of the argument (program).

namhyung commented 8 months ago

I don't think it takes an argument. But it needs to be root to print kernel tracing events or have an argument for the executable if it has SDT events. And I found a bug that it didn't pass the option if there's no command line argument (for target executable). I'll fix that separately.

I agree the documentation needs updates. See https://sourceware.org/systemtap/wiki/AddingUserSpaceProbingToApps.