This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [RFC 3/3] Test on solib load and unload
- From: "Agovic, Sanimir" <sanimir dot agovic at intel dot com>
- To: 'Yao Qi' <yao at codesourcery dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Tue, 3 Sep 2013 06:32:29 +0000
- Subject: RE: [RFC 3/3] Test on solib load and unload
- Authentication-results: sourceware.org; auth=none
- References: <520B7F70 dot 6070207 at codesourcery dot com> <1377663394-4975-1-git-send-email-yao at codesourcery dot com> <1377663394-4975-4-git-send-email-yao at codesourcery dot com> <521D7BCA dot 10806 at codesourcery dot com> <0377C58828D86C4588AEEC42FC3B85A717658713 at IRSMSX105 dot ger dot corp dot intel dot com> <52254252 dot 9050503 at codesourcery dot com>
> -----Original Message-----
> From: Yao Qi [mailto:yao@codesourcery.com]
> Sent: Tuesday, September 03, 2013 03:59 AM
> To: Agovic, Sanimir
> Cc: gdb-patches@sourceware.org
> Subject: Re: [RFC 3/3] Test on solib load and unload
>
> On 08/28/2013 07:31 PM, Agovic, Sanimir wrote:
> >> + for (i = 0; i < number; i++)
> >> >+ {
> >> >+ char funname[20];
> >> >+ void *p;
> >> >+
> >> >+ sprintf (funname, "shr%d", i);
> >> >+ p = dlsym (handles[i], funname);
> >> >
> > Does dlsym has any perf impact on the debugger?
> >
>
> Probably no much performance impact on the debugger, IMO. dlsym is to
> resolve symbol in runtime, debugger is not much involved.
>
Without impact/side-effect I`d rather remove it, given that this is a
NOP for the debugger. But this is nothing I`m worried about.
> >> >+
> >> >+gdb_test_no_output "python SolibLoadUnload\($SOLIB_NUMBER\)"
> >> >+
> >> >+# Call the convenience function registered by python script.
> >> >+send_gdb "call \$perftest()\n"
> >> >
> > Not sure if a convenience function is necessary:
> > python SolibLoadUnload().execute_test()
> > could do the job as well.
> >
>
> Convenience function is useful to de-couple solib.py and solib.exp.
> solib.py adds a convenience function, while solib.exp is to call it.
>
Got it.
> >> >+
> >> >+ start_time = time.clock()
> >> >+ gdb.execute (do_test_command)
> >> >+ elapsed_time = time.clock() - start_time
> >> >+
> >> >+ self.result.record (num, elapsed_time)
> >> >+
> >> >+ num = num / 2
> >> >+ iteration -= 1
> >> >
> > You may consider observing solibs loads/unloads to compute the time
> > between the events.
> > Can you re-run the sample with turned off garbage collector? It may
> > cause some jitter if turned on.
>
> I don't know how much time is spent on jitter, but python code is
> simple and most of the time should be spent on GDB, which is what we
> want. Thanks for your suggestion. I'll re-run it with gc turned off,
> to see if I can get something different.
>
Thanks.
-Sanimir
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052