This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/3] Test on solib load and unload
- From: Gary Benson <gbenson at redhat dot com>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 27 Sep 2013 14:59:57 +0100
- Subject: Re: [PATCH 3/3] Test on solib load and unload
- Authentication-results: sourceware.org; auth=none
- References: <1380119209-25975-1-git-send-email-yao at codesourcery dot com> <1380119209-25975-4-git-send-email-yao at codesourcery dot com>
Hi Yao,
Yao Qi wrote:
> This patch is to add a test case to on the performance of GDB
> handling load and unload of shared library.
Thanks for writing this. I ran it on the setup I had for testing the
probes code, and it does pick up on the differences between probes
and non-probes.
> +void
> +do_test (int number)
> +{
> + void **handles;
> + char libname[40];
> + int i;
> +
> + handles = malloc (sizeof (void *) * number);
> +
> + for (i = 0; i < number; i++)
> + {
> + sprintf (libname, "solib-lib%d", i);
> + handles[i] = dlopen (libname, RTLD_LAZY);
> + if (handles[i] == NULL)
> + {
> + printf ("ERROR on dlopen %s\n", libname);
> + return;
> + }
> + }
> +
> + /* Unload shared libraries in different orders. */
> +#ifndef SOLIB_DLCLOSE_REVERSED_ORDER
> + for (i = 0; i < number; i++)
> +#else
> + for (i = number - 1; i >= 0; i--)
> +#endif
> + dlclose (handles[i]);
> +
> + free (handles);
> +}
I'm not sure how important this is, but this test is profiling both
load and unload. It's theoretically possible that a change could be
made that improved one phase while degrading the other, so it would
be nice to see separate timings if that's not too hard to implement.
For the avoidance of doubt I don't consider the absence of separate
timings a blocker.
Thanks,
Gary
--
http://gbenson.net/