| title | Tracing the syscall of the wild |
|---|
Compile me with pandoc --standalone --to=revealjs --output=README.html README.md
Env for demos can be prepared by nix develop or nix develop --command $SHELL
- Meeting time conflicts with ACM x WCS
- GLUG/ACM cloud??
-
Create new process (
strace $cmd) or attach to existing one (strace -p $pid) -
Filter by syscall (
--trace=openat) or group of syscalls (--trace=%file)
$ strace --follow-forks --trace=%file --output=log ls
...
$ cat log
...
openat(AT_FDCWD, ".", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
$ strace --follow-forks --trace=%file --output=log ls -l
...
$ cat log
...
openat(AT_FDCWD, ".", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
statx(AT_FDCWD, "spack.yaml", ...) = 0
many times
$ strace --follow-forks --trace=openat --output=log zsh -c 'echo hi'
hi
$ cat log
...
openat(AT_FDCWD, "/etc/passwd", O_RDONLY|O_CLOEXEC) = 11
openat(AT_FDCWD, "/etc/zshenv", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/sam/.zshenv", O_RDONLY|O_NOCTTY) = 3
openat(AT_FDCWD, "/home/sam/.config/zsh/.zshenv", O_RDONLY|O_NOCTTY) = 3
openat(AT_FDCWD, "/home/sam/.nix-profile/etc/profile.d/hm-session-vars.sh", O_RDONLY|O_NOCTTY) = 3
openat(AT_FDCWD, "/dev/null", O_RDONLY|O_NOCTTY) = 3
- Website
- Technical paper
- Record and reply programs
- Works on Firefox!
$ python -c "import random; print(random.choice(range(100)))"
39
$ rr record python -c "import random; print(random.choice(range(100)))"
rr: Saving execution to trace directory `/home/sam/.local/share/rr/python-5'.
59
$ rr replay --autopilot /home/sam/.local/share/rr/python-5
59
$ rr dump /home/sam/.local/share/rr/python-5 > log
$ less log
- Full system simulation vs syscall emulation in Gem5
- Turn off interrupts
- Use hugepages
- No scheduler
- Let Linux handle FS
$ make menuconfig
# exit, saving config
$ make isoimage
- Strace has wicked overhead because switch processes every traced syscall.
- How to avoid? => Write filtering logic in kernel??
- eBPF := a restricted language, safe to execute within kernel!
- Implement filtering logic in eBPF
- Hybrid runtime research
- Security auditing research
- Linux performance tuning
- Karaoke anything Brendan Gregg has ever written
- Debugging ZFS performance

