by spieglt on 6/8/20, 10:38 PM with 37 comments
by hnlmorg on 6/9/20, 7:27 AM
ls -l /proc/$PID/fd/
Additionally you can also use the /proc file system to display where the cursor is in those files by outputting the contents of /proc/$PID/fdinfo/$FD
which is handy if you have a long running process but forgot to pipe it into `pv` (or any other long running ingest that lacks a progress UI)(Both tricks are Linux only)
by bostonsre on 6/9/20, 7:32 AM
by ravinder_sbu on 6/9/20, 7:45 AM
`strace -e trace=file`
I see that you are using ptrace to monitor a process. That is also used by strace. Is there something else your application does that strace does not (In relation to files)?
by Doctor_Fegg on 6/9/20, 11:04 AM
by MCOfficer on 6/9/20, 9:39 AM
by atrudeau on 6/9/20, 1:04 PM
by em500 on 6/9/20, 10:49 AM
edit: fatrace is system-wide, whereas the current tools monitors a specific process
http://manpages.ubuntu.com/manpages/trusty/man1/fatrace.1.ht...
https://piware.de/2012/02/fatrace-report-system-wide-file-ac...
by unhammer on 6/9/20, 8:36 AM
by Erwin on 6/9/20, 5:37 PM
read(3</proc/filesystems>, "", 1024) = 0
Another interesting new strace option is -k which does a stack dump after each syscall. this can be useful to find out what part of the application, like some obscure lib, does weird system calls in your app.by st0le on 6/9/20, 2:01 AM
by dkdk8283 on 6/9/20, 6:22 AM
by amelius on 6/9/20, 1:19 PM
Because strace on Linux still fails with:
strace: ptrace(PTRACE_TRACEME, ...): Operation not permitted
in those cases :(