I want to profile a dll plugin in C++. I have access to the source (being the author/mantainer) and can modify them (if needed for instrumentation). What I don't have is the source/symbols/etc of the host program which is calling the dll. I only have the headers needed to build the plugin. The dll is invoked upon action from the client.
What is the best way to proceed for profiling the code? It is not realistic to "wrap" an executable around the dll and it would be not useful because since in the plugin I am calling some functions from the host AND i need to profile those paths, a wrapper would skew the performance.
EDIT after Kieren Johnston's comment: Ideally I would like to hook into the loaded dll just like the debugger is able to (attaching to the running host process and placing a breakpoint somewhere in the dll as needed). Is it possible? If not, I will need to ask another question to ask why :-)
I am using the TFS edition of Visual Studio 2010.
Bonus points for providing suggestions/answers for the same task under AIX (ah, the joys of multiple environments!).