Debugging API Hook for Instrumentation
-
Thursday, May 17, 2012 12:15 AM
Hello,
I plan to build instrumentation using debugger API, over an application for which i have pdbs. The application is build in c++ & c# dlls. When ever a function is called in the application or it's dll, i want to write it to a text log file. There are several functions which i want to track.
Is this possible to use debuggin APIs to hook up to the application and track execution of these functions using some kind of event handling.
Appreciate any samples.
All Replies
-
Thursday, May 17, 2012 5:21 AMModerator
Would you mind to show us what you problem you're facing that make you have this design?
I think the common requirement could be solve by the Visual Studio Profiler tool:
http://msdn.microsoft.com/en-us/magazine/cc337887.aspx
http://www.codeproject.com/Articles/144643/Profiling-of-C-Applications-in-Visual-Studio-for-F
If there's any concern, please feel free to let me know.
Best wishes,
Mike Zhang[MSFT]
MSDN Community Support | Feedback to us
-
Thursday, May 17, 2012 9:48 AM
Thanks Mike, I reviewed the articles.
Is there an API for the profiling? i want to build an application which can hook up to an exe and do profiling.
Finally i want to do something like
when a function starts executing, kick of a task in background and stop when the function exits. This way i can capture all the information which the function did in background.
A background task could be monitoring all sql statements the function fired on a database.
I hope i am clear
-
Monday, May 21, 2012 10:33 AM
Not a expert, but if you try to debug the APIs to hook up to the application, what result is it? Did you get any error?
Xuan,
-
Tuesday, May 22, 2012 1:32 PMModerator
Sorry, I got the wrong idea, and incorrect direction.
And after research, I think there's no way to implement your requirement.
The probable way for you is using the IntelliTrace tool the trace your assembly, and then use the Visual Studio or the InterlliTrace APIs to decode the .iTrace file, I'm not familiar this this group APIs, but you can see the .iTrace report loaded to the Visual Studio, you can double click on the main thread to review the method call information.
http://naveensrinivasan.com/2010/04/28/useintellitracewithoutvsnet/
http://msdn.microsoft.com/en-us/library/ee661590
Best wishes,
Mike Zhang[MSFT]
MSDN Community Support | Feedback to us

