Trace whole syscall classes with %file and %network
Trace a whole group of syscalls with strace 6.x by naming a class such as -e trace=%file or %network instead of listing every call.
Listing open,openat,stat,access by hand always misses one. strace has named classes for this, written with a leading %, and they cover every call in the group on the running architecture. -e trace=%file takes the calls that name a file, and %network takes the socket family. The strace manual lists the classes, and they need strace 5.3 or newer, with the % spelling.
strace -f -e trace=%file,%network -o app.trace curl -s http://127.0.0.1:8080/ >/dev/nullexecve("/usr/bin/curl", ["curl", "-s", "http://127.0.0.1:8080/"], 0x7ffc8e0d5a58 /* 31 vars */) = 0
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
socket(AF_INET, SOCK_STREAM, IPPROTO_TCP) = 5
connect(5, {sa_family=AF_INET, sin_port=htons(8080), sin_addr=inet_addr("127.0.0.1")}, 16) = 0The two classes are joined with a comma in a single -e. The call list is the same one you would have had to maintain by hand, including the *at variants and execve, which counts as a file call because it names a path. Other classes include %process, %signal, %memory and %desc.
Class names are matched per architecture, so a 32-bit process under a 64-bit kernel still gets its own syscall names. The classes tell you which calls to watch, not whether the program is behaving, so read the return values as well. PIDs, addresses and the environment count in the lines above will differ.