strace-ui is an strace UI. It looks like this:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโญ Syscalls โโโโโโโโโโโโโโโโโโโ f:all โฎโญ Details <tab> โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ x:auto m:man โฎโ
โโ execve("/usr/bin/ping",...) 0โโ recvmsg pid 7 (#0) 15:04:20.358200064 0.000150s โโ
โโ brk(NULL) 0x558>โโ ping localhost โโ
โโ access("/etc/ld.so.prel...) ENOENTโโ Receive a message from a socket โโ
โโ openat(AT_FDCWD, "/lib6...) 3โโ ssize_t recvmsg(int sockfd , struct msghdr * msg , int flagโโ
โโ read(3, "\x7fELF\x02\x0...) 832โโ โโ
โโ fstat(3, {st_mode=S_IFR...) 0โโ Arguments โโ
โโ mmap(NULL, 4020448, PRO...) 0x7f6>โโ sockfd: 3<PING:[140199664]> โโ
โโ close(3) 0โโ โณ fd 3 from: socket(AF_INET, SOCK_DGRAM, IPPROTO_ICMP) โโ
โโ socket(AF_INET, SOCK_DG...) 3โโ msg: โโ
โโ connect(3, {sa_family=A...) 0โโ โโmsg_name โโ
โโ sendto(3, "\x08\x00\xe1...) 64โโ โ โโsa_family = AF_INET โโ
โโ recvmsg(3, {msg_name={s...) 64โโ โ โโsin_port = htons(0) โโ
โโ write(1, "64 bytes from...) 64โโ โ โฐโsin_addr = inet_addr("127.0.0.1") โโ
โโฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ 12/13 โฏโ โโmsg_namelen = 128 => 16 โโ
โ โ โโmsg_iov โโ
โ โ โ โฐโ[0] โโ
โ โ โ โโiov_base = โโ
โ โ โ โ 0000 00 00 e9 2f 00 6c 00 01 โ00./0l01โ โโ
โ โ โ โ 0008 ba 07 8e 69 โ.7.i โ โโ
โ โ โ โฐโiov_len = 192 โโ
โ โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
strace-ui and its dependencies. The specific installation instructions depend on your platform. You can find platform-specific instructions here.strace-ui uses OxCaml so the next thing you'll want to do is install oxcaml by running: opam switch create oxcaml-dev --repos=oxcaml-dev=git+https://github.com/oxcaml/opam-repository.git#dev,default.opam install strace-ui. This will install the strace-ui binary onto your PATH, along with its dependencies.Note that strace-ui shells out to strace, so you'll also need to have strace available on your PATH.
You can invoke it roughly like you would invoke strace:
strace-ui ping localhost
strace-ui -p 12345 -e !futexWhich will invoke strace for you with roughly these arguments:
strace \
--absolute-timestamps=format:unix,precision:us \
--syscall-times \
--follow-forks \
--decode-fds=all \
--no-abbrev \
--strings-in-hex=non-ascii \
--string-limit=1024 \
-- ping localhostIt has some features that make the output easier to understand, like associating <unfinished ...> calls with their eventual completion in multi-process output, parsing and rendering structs nicely, and rendering buffers as hexdumps instead of escaped strings.
It also tracks file descriptor provenance, and lets you filter to all syscalls that create or reference a given FD. It tries to track FD provenance even across forks, but if you're attaching to an already-running process that will not work very well. Still, you can easily see e.g. all write() calls a process makes to a given FD by pressing F.
strace-ui uses --decode-fds=all to show more information about FDs, even if it you weren't tracing at the time that the FD was created. But it augments the output by resolving IP addresses to domain names when possible. That means instead of seeing:
read(18<TCP:[30.32.177.12:44878->30.32.107.76:44563]>, ...)You'll see something like:
read(18<TCP:[foo:44878->bar:44563]>, ...)-e controls the underlying strace call that we make, but you can filter syscalls after-the-fact: even if you capture everything, you can dynamically filter what you see in the syscall list by pressing f (or % or h)
Press F1 or ? for a list of keyboard shortcuts:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโญ Syscalls โโโโโโโโโโโโโโโญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎโโโโโโโโโโ x:auto m:man โฎโ
โโ execve("/usr/bin/ping"โ Keyboard Shortcuts โ0064 0.000150s โโ
โโ brk(NULL) โ โ โโ
โโ access("/etc/ld.so.preโ F1 / ? Toggle this help โ โโ
โโ openat(AT_FDCWD, "/libโ Tab Switch focus between list and details โ msghdr * msg , int flagโโ
โโ read(3, "\x7fELF\x02\xโ f Edit filter expression โ โโ
โโ fstat(3, {st_mode=S_IFโ / Grep (start regex filter) โ โโ
โโ mmap(NULL, 4020448, PRโ % Cycle family presets โ โโ
โโ close(3) โ h Hide selected syscall โCK_DGRAM, IPPROTO_ICMP) โโ
โโ socket(AF_INET, SOCK_Dโ H Show only selected syscall โ โโ
โโ connect(3, {sa_family=โ p Filter to selected PID โ โโ
โโ sendto(3, "\x08\x00\xeโ P Exclude selected PID โ โโ
โโ recvmsg(3, {msg_name={โ x Cycle display mode (auto/hex/str) โ โโ
โโ write(1, "64 bytes froโ m Toggle man page โ") โโ
โโฐโโโโโโโโโโโโโโโโโโโโโโโโโ d / u Page down / up โ โโ
โ โ g / G Jump to top / bottom โ โโ
โ โ F Follow selected FD โ โโ
โ โ < / > Jump to prev / next syscall on same FD โ โโ
โ โ ^ Jump to FD origin (open/socket/etc.) โโ00./0l01โ โโ
โ โ Alt-f Clear filter โโ.7.i โ โโ
โ โ Ctrl-c Quit โ โโ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโฏโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ* main.exe
: strace-ui - interactive strace viewer
:
: main.exe [[PROGRAM ...]]
:
: === flags ===
:
: [-- PROGRAM] . run PROGRAM
: [-e EXPR] . Trace expression passed to strace (e.g.
: trace=%net)
: [-p PID] . Attach to an existing process
: [-theme THEME] . Color theme (Mocha, Macchiato, Frappe, Latte)
: [-build-info] . print info about this build and exit
: [-version] . print the version of this build and exit
: [-help], -? . print this help text and exit