This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]