I am on the VS Profiler team, so feel free to ask any clarifying questions.
If you need accurate indicators (lead time, number of calls), you should use the toolkit. Using the toolkit, the profiler will show you data for any binary files that you use, as well as one level of calls (for example, if you call string.Concat directly from your instrumental binary file, the profiler will show you how many times you called it and how long ( collectively) caused by calls). The profiler will not show you data for binary files that you are not using.
Have you tried profiling tools? What data do you see?
If you want, you can also try a statistical approach to profiling: sampling. Sampling is lighter than a tool, and is often good as a first pass to understand at a high level where your processor works most. When fetching, the profiler takes snapshots of the call stack at specific intervals (this is like splitting into a debugger to see what is currently running). Then it combines the snapshots to create a call tree.
If you give me a better idea of how you are trying to profile, I can help you more. Are you using a profiler from VS or from the command line? Do you have a VS / project solution for your sidebar gadget?
You can also check our blog or our MSDN for more information.
Update:
The profiling functionality of the JavaScript profiler was primarily focused on IE8, so I'm not sure that it will collect data against another process, such as sidebar.exe, which (I assume) hosts the IE IE engine. However, you should at least be able to use a profiler to collect data against your managed code.
For the toolkit, you will need the second option ("Executable file"), and in the Performance Explorer you will want to have two goals:
- sidebar.exe, not instrumental (since you do not have PDB) - you can right-click the target and uncheck the "Tool" box to suppress hardware
- foo.dll (no matter what you call the Gadget DLL), you need to manually add this target (right-click on the "Targets" folder, select "Add Target Binary File ..."), but be sure to turn on the "Tool" and make sure his PDB is next to him.
To learn more about performance goals, see this blog post . With this setting, just click the "Start profiling" button. The toolkit must be successful, and you should get trace profiling data for your gadget.
For selection, you can start or join the process. Joining a process only works if:
- The process runs on CLR v4; or
- The process has the correct profiling environment variables (see below what this means)
Profiling the CLR process to V4 requires some environment variables to be set in the target process. Essentially, you will need to kill the sidebar.exe process and then restart it using the profiler command-line tools. A step-by-step guide on how to do this is available on MSDN .
Another option, fetching, can be done from the command line (see the MSDN article again) or from the VS user interface. Select "Processor Selection" with "Executable (.EXE)", then close all currently running instances of sidebar.exe, right-click on the newly created target in Performance Explorer, select "Properties" and change the command if necessary. Then you should run the profiler.
Let me know if you have more problems. Sorry, this is not easier.