How to profile a dll without having Vtune launch it ?
I am a newbie to VTUNE myself -I have used VTune to launch an application and then profile it -it works fine -but now I have a dll that gets called whenever I print a file -How do I use VTune to profile this dll i.e. - I don't want VTune to launch the application any more -I just want VTUNE to profile this dll whenever it starts running i.e. whenever I print a file -
When you say "profile", what do you mean? If you are talking about Sampling, then there are no special setups. Simply create the Sampling activity and check "No application to launch" in the Sampling Wizard.
If you are talking about Callgraph, please review "DLL-level Call Graph Profiling" in the online help. Basically, specify "No application to launch" in the Call Graph Wizard and then add your DLL(s) as the Module(s) of Interest.
In both cases, setup the activity to run with no duration and press the Stop button when you want to stop collecting profiling data.
but I get this error when I try to set Call graph collector manually (I did make sure that duration is 0 seconds)
Basically, when I say"run the activity", after specifying the module of interest -I get the "copy instrumented modules" dialog box pop-up" which says that it needs to copy a few .dll files from the "cache folder" into my destination folder -when I click "run" (after having selected copy and restore files automatically) -I get "copying instrument files failed", "No module from the activity was loaded", No results were generated for this run"
Was there an access violation during the copy? Does your account have write access rights to the destination directory? The batch file is on your system. You could attempt to run it manually to determine if there is a problem. When the dialog pops up, I believe it tells you where the batch file is located.
"DLL-level Call Graph" requires write permissions in the directory where DLL-to-profile resides, because it tries to replace the original DLL with it's instrumented version.
The actually same results can be achieved by another much safer approach.
What actually you need is to instruct VTune not to instrument anything except your DLL. So let's do this:
1. Specify your application in the "application to launch" box.
2. Switch on check box to open advanced configuration before run.
3. Add your DLL to the list of modules of interest. Do not remove EXE from there !
4. Finish wizard.
5. When Advanced Configuration is opened go to the Collector Configuration (theConfigure button at the center of the dialog) and press the Advanced button there.
6. Modify all drop-down boxes to show Minimal.
7. Switch off COM profiling.
---- Now we configured VTune not to instrument anything at all ----
9. Find your DLL in the list of modules and modify Instumentation Level to show "All Routines".
10. Press OK as many times as it required.
Now your application should run without instrumentation at all. VTune will monitor all dynamically loaded modules in your application and when it will catch your DLL it will replace it *in memory*with the instrumented version. So only your DLL will be profiled.