I have output captured by following command:

strace -f -e trace=process,socketpair,open,close,dup,dup2,read,write -o rsync.log rsync -avcz --progress src/ dst/

it is a bit long so I've uploaded it here. I understand basic format of strace output, for example following line:

1399 open("/lib/x86_64-linux-gnu/libpopt.so.0", O_RDONLY|O_CLOEXEC) = 3

Means that:

  1. 1399 is PID of process
  2. open(const char *pathname, int flags); is system call with particular arguments (taken from man 2 open)
  3. 3 is the return value, a file descriptor in this particular case (taken from man 2 open)

According to this thread:

rsync spawns two processes/threads to do the copy, and there's one stream data between the processes, and another from the receiving process to the target file.

Using something like strace -e trace=process,socketpair,open,read,write would show some threads spawned off, the socket pair being created between them, and different threads opening the input and output files.

Can I somehow parse strace output to being able confirm statements from mentioned thread and see what happens under the hood, even if I'm not very familiar with inter process communication? I'm especially interested in data passing between processes/threads (how much data were passed from process1 to process2? where does the process2 wrote the received data?)

I've also seen lines like this one in log but I do not know how to correctly interpret them:

1399  <... close resumed> )             = 0
1400  <... dup2 resumed> )              = 0
  • It's going to be tricky since rsync uses SSH by default so the text itself is probably going to be encrypted. A description of "resumed" can be found on the man page: linux.die.net/man/1/strace – rogerdpack Aug 21 '18 at 19:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.