delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/10/02/12:54:56

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: eos.vss.fsi.com: ford owned process doing -bs
Date: Thu, 2 Oct 2003 11:54:38 -0500 (CDT)
From: Brian Ford <ford AT vss DOT fsi DOT com>
X-X-Sender: ford AT eos
To: cygwin AT cygwin DOT com
Subject: Re: Is multithreaded profiling on cygwin possible?
Message-ID: <Pine.GSO.4.56.0310021140200.12522@eos>
MIME-Version: 1.0

peter garrone wrote:

>If I profile my multi-threaded application, it appears that only the main
>thread is profiled.
>
Currently, yes.

You can, however, profile other threads one at a time if you use
the gprof API's manually, called from the thread you want to profile.  I
have done this, but it has been too long for me to give you specific
instructions.  Have a look at profile.c, profile.[ch], gmon.[ch] in the
cygwin sources to see how its done.

PTC
While you're there, it should be fairly trivial to create a patch that
at least loops through all Cygwin created pthreads in the sampler.  I
don't know if that kind of flat profile is what you wanted, though.

BTW, code in DLL's is difficult to profile because of the monolithic
segment view of the profiling hash.  Check the archives for a discussion
on this and possible work arounds if you are interested.

>On linux, it is possible to save and set the virtual timer upon creation
>of each thread, and thereby get a decent profile.
>However the virtual timer is unavailable on cygwin, and I would imagine
>that this approach is incorrect, due to differing thread models.
>
I've never profiled on Linux and I don't know anything about the virtual
timer you are refering to.  On Solaris, I get a nice flat profile of all
threads combined, like the implimentation I suggested above.  The same
shared library concerns exist there, but Solaris is good about providing
static profile enabled libs.

Let me know if you want to discuss patch ideas.  I used to have a few, but
no priority time to work on them. :(

-- 
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
Phone: 314-551-8460
Fax:   314-551-8444

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019