Re: [PATCH] Make remote transfers interruptible

Pedro Alves
2015-08-17T16:00:07Z

On 08/12/2015 06:31 PM, Sandra Loosemore wrote:
> On 08/12/2015 08:30 AM, Gary Benson wrote:
>> Hi Sandra,
>>
>> Sandra Loosemore wrote:
>>> On 08/05/2015 09:28 AM, Gary Benson wrote:
>>>> This commit makes it possible to interrupt slow remote file transfers.
>>>>
>>>> gdb/ChangeLog:
>>>>
>>>> * gdb_bfd.c (gdb_bfd_iovec_fileio_pread): Add QUIT call.
>>>
>>> It still does not work for me. :-(
>>
>> Could you please try this newer version and see if it allows you to
>> interrupt the remote transfers?
>
> This version still doesn't make the transfer interruptable with ^C.
> *But*, with this patch, the startup time is reduced from 4 minutes to 19
> seconds. Huh? Is it really transferring the entire file contents, or
> was the time being used for some GDB-side operation that is quadratic or
> exponential in the size of the read requested rather than the actual
> byte transfer? Independently of the ^C issue, I think we need to better
> understand what is going on here and better tune the code on both sides
> of the RSP for large file transfers. Even if a user asks for
> target-side libraries explicitly, 4 minutes to transfer one library
> doesn't provide a good user experience, and 19 seconds isn't so great
> either when you consider that some interactive applications link with
> dozens of GUI or multimedia libraries and not just glibc.
>

Now that's quite surprising. It seems to make no difference to me.

Granted, I'm testing on the local machine, but, attaching to Firefox,
with:

$ ./gdbserver/gdbserver --multi :9999

and then:

$ ./gdb -data-directory=data-directory -ex "tar extended-rem :9999" -ex "set pagination off" -ex "attach 31613" -ex "info shared" -ex "set confirm off" -ex "detach" -ex "quit"

takes around 3-5 seconds with or without patch. Around one second less if I do (add "set sysroot /"):

$ ./gdb -data-directory=data-directory -ex "set sysroot /" -ex "tar extended-rem :9999" -ex "set pagination off" -ex "attach 31613" -ex "info shared" -ex "set confirm off" -ex "detach" -ex "quit"

I was previously assuming you were seeing this on multiple machines,
but looking back, I only find mention of nios2.

Could it be the slowdown you see is caused by some other local patches
you might have in the tree you're using? Do you see it with pristine FSF?

If you try your example test with gdb 7.9, with "set sysroot remote:",
does it also take the 4 minutes to reach main?

Also, can you reproduce this with other machines? E.g., what about
x86_64 GNU/Linux? Wondering whether it's a kernel/libc/etc issue...

Does anyone else confirm the unexpected slowness Sandra is seeing?

Thanks,
Pedro Alves