This is the mail archive of the
mailing list for the Cygwin project.
Re: Is multithreaded profiling on cygwin possible?
- From: "peter garrone" <pgarrone at linuxmail dot org>
- To: cygwin at cygwin dot com
- Date: Mon, 13 Oct 2003 16:18:17 +0800
- Subject: Re: Is multithreaded profiling on cygwin possible?
Brian Ford wrote:
<snipped prior discussion>
>2.) Paraphrasing, the UNIX profil call (that gprof.c is currently using),
>has a contiguous flat address space model. It hashes address samples over
>that space into a buffer. The starting and ending address are
>automatically pulled from the executable and are in its address space.
>DLLs are mapped outside this space non-contiguously.
>4.) Paraphrasing, gprof doesn't know how to find and read the symbol
>tables from DLLs linked into the executable. I'm not even sure if the
>addresses are deterministic.
As you have suggested, I have tried setting up a list of
threads in profil.c, calling SuspendThread,
GetThreadTimes, to get timing information for all threads,
and to create a reasonably accurate profile for non-dll user space using gprof.
My plan now is to create new dll import libraries so that when these
dll functions are
called, a flag is set in the thread structure list, and the profiling thread
assigns cpu ticks against the statically linked small import functions, so that
hopefully gprof will pick it up and assign some sort of cpu usage and call
frequency count to all the functions in the import libraries.
If you can see any obvious pitfalls with this approach, I would be grateful.
Check out the latest SMS services @ http://www.linuxmail.org
This allows you to send and receive SMS through your mailbox.
Powered by Outblaze
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html