Re: [PATCH 1/3] change gdbserver to use hashtab: list->table

Yao Qi
2014-01-25T12:29:51Z

On 01/25/2014 09:12 AM, Doug Evans wrote:
> [In one perf experiment of attach/detach repeated 20 times on a
> program with 1000 threads, the time as measured by gprof went from
> 45sec to 5sec.]
>
> I created a testcase for our perf testsuite but the results there
> don't show the speed as impressively because it can only measure gdb
> not gdbserver. I may submit it separately anyway.

Hi, Doug,
Please do that. If gdbserver becomes faster, the improvements should
be shown in the perf test result. I'd like to help on this.

>
> The patch is in 3 parts:
>
> 1) rename "list" to "table" throughout,
> rename member "entry" in some structs to "head" (for consistency)
>
> 2) misc. prepatory cleanup, in particular while there are routines
> to traverse the lists, some code traverses the list itself.
> These need to be rewritten to always use the provided traversal
> routines.
>
> 3) Add hashtable support.

Where is patch 3/3? I don't see it in archive either.

>
> 2014-01-24 Doug Evans <dje@google.com>
>
> * inferiors.h (struct inferior_table): Renamed from struct
> inferior_list. All uses updated.
> (struct inferior_table_entry): Renamed from struct
> inferior_list_entry. All uses updated.
> (add_inferior_to_table): Renamed from add_inferior_to_list.
> * inferiors.c (*): Update.

Do we need entries like this? Since "All uses updated" is written
above, probably we don't need these entries. In gnu coding standards:

"When you change the calling sequence of a function in a simple
fashion, and you change all the callers of the function to use the new
calling sequence, there is no need to make individual entries for all
the callers that you changed. Just write in the entry for the function
being called, “All callers changedâ€"

Probably, we can apply this rule here too.

> (add_inferior_to_table): Renamed from add_inferior_to_list.
> All callers updated.
> * dll.c (*): Update.
> * dll.h (*): Update.
> (struct dll_info): Member "entry" renamed to "head".
> * gdbthread.h (*): Update.
> (struct thread_info): Member "entry" renamed to "head".
> * linux-aarch64-low.c (*): Update.
> * linux-arm-low.c (*): Update.
> * linux-low.c (*): Update.
> * linux-low.h (*): Update.
> * linux-mips-low.c (*): Update.
> * linux-x86-low.c (*): Update.
> * regcache.c (*): Update.
> * regcache.h (*): Update.
> * server.c (*): Update.
> * thread-db.c (*): Update.
> * tracepoint.c (*): Update.
> * win32-low.c (*): Update.

--
Yao (é½å°§)