From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27860 invoked by alias); 3 Sep 2013 01:59:46 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 27619 invoked by uid 89); 3 Sep 2013 01:59:46 -0000 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 03 Sep 2013 01:59:46 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RDNS_NONE,SPF_HELO_FAIL autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1VGfuA-0003Xt-8l from Yao_Qi@mentor.com ; Mon, 02 Sep 2013 18:59:42 -0700 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Mon, 2 Sep 2013 18:59:41 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.2.247.3; Mon, 2 Sep 2013 18:59:41 -0700 Message-ID: <52254252.9050503@codesourcery.com> Date: Tue, 03 Sep 2013 01:59:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: "Agovic, Sanimir" CC: "gdb-patches@sourceware.org" Subject: Re: [RFC 3/3] Test on solib load and unload References: <520B7F70.6070207@codesourcery.com> <1377663394-4975-1-git-send-email-yao@codesourcery.com> <1377663394-4975-4-git-send-email-yao@codesourcery.com> <521D7BCA.10806@codesourcery.com> <0377C58828D86C4588AEEC42FC3B85A717658713@IRSMSX105.ger.corp.intel.com> In-Reply-To: <0377C58828D86C4588AEEC42FC3B85A717658713@IRSMSX105.ger.corp.intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00050.txt.bz2 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. >> >+ >> >+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. >> >+ >> >+ 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. -- Yao (齐尧)