VerySleepy / verysleepy

Very Sleepy, a sampling CPU profiler for Windows
http://www.codersnotes.com/sleepy
GNU General Public License v2.0
1.07k stars 105 forks source link

Very Sleepy could not profile DLL when issuing from command line #18

Closed tangogu closed 9 years ago

tangogu commented 9 years ago

We use correct /r"test.exe" to do the job. We use Very Sleepy newest version. The test.exe will load a dll, which is called test2.dll. The DLL is dynamically loaded, and released before test.exe exit.

Functions inside test.exe could be got correctly. But the functions inside DLL only show binary address. The PDBs of exe/dll are all in current directory, and Very Sleepy could show correct function name if use attach method.

This is very important, since coders could use such command line interface to easily implement a small regression system for performance reports. What's more, no need to attach a process not only ease the work, but also show correct info from the very beginning.

CyberShadow commented 9 years ago

How is the DLL loaded, via LoadLibrary?

tangogu commented 9 years ago

Yes, LoadLibrary(). I noticed there is a thread here(http://www.codersnotes.com/programs/very-sleepy-0-8#comment-110) mentioned by Dalaran which solved our issue after updating the code. Really thanks!

The Very Sleepy is useful, though not as powerful as WPA. On the other side, it could show function name, which is great for our usage - a small profiler.

We will also try to do some improvements and give you feedback. Some useful feature I think are: Allow users to specify the module name, and start sampling after the module is loaded Change sampling rate. A lower frequency could ensure the Very Sleepy to work for hours. Though it may not accurately reflect the performance, it is better than nothing. Try to use a higher sampling rate. Sometimes, 1ms may be too long. But when using higher sampling rate, the QueryPerformanceCounter() will have very poor performance, and if we use rdtsc(p), it is not wall clock.

CyberShadow commented 9 years ago

Change sampling rate. A lower frequency could ensure the Very Sleepy to work for hours. Though it may not accurately reflect the performance, it is better than nothing.

This is already implemented as an option, but not exposed as a command-line parameter.

tangogu commented 9 years ago

Thanks! I just realized this is in the GUI.