From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20450 invoked by alias); 27 Sep 2013 14:09:53 -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 20432 invoked by uid 89); 27 Sep 2013 14:09:53 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 27 Sep 2013 14:09:53 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.4 required=5.0 tests=AWL,BAYES_40,RP_MATCHES_RCVD,SPAM_SUBJECT autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8RDxxJ9022706 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 27 Sep 2013 10:00:00 -0400 Received: from blade.nx (ovpn-116-89.ams2.redhat.com [10.36.116.89]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r8RDxwvj019045; Fri, 27 Sep 2013 09:59:59 -0400 Received: by blade.nx (Postfix, from userid 1000) id C336D264AA8; Fri, 27 Sep 2013 14:59:57 +0100 (BST) Date: Fri, 27 Sep 2013 14:09:00 -0000 From: Gary Benson To: Yao Qi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 3/3] Test on solib load and unload Message-ID: <20130927135957.GE6993@blade.nx> Mail-Followup-To: Yao Qi , gdb-patches@sourceware.org References: <1380119209-25975-1-git-send-email-yao@codesourcery.com> <1380119209-25975-4-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1380119209-25975-4-git-send-email-yao@codesourcery.com> X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00957.txt.bz2 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/