VerySleepy / verysleepy

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

Non-GUI (console) version of VerySleepy that can be called programmatically #84

Closed Patje242 closed 3 years ago

Patje242 commented 3 years ago

I want to include VerySleepy in our automatic QA test procedures, so that when QA can automatically generate .sleepy files if they detect a performance decrease in a testing module. That way, developers don't have to run manual scenario's anymore and directly focus on the actual problem (being performance). I tried checking out VerySleepy, but I couldn't get it built (simply running build.cmd gave lots of errors about missing .vcxproj files). My next idea was to create a non-GUI version of VerySleepy that could be programmatically accessed from the test scenario, or even from the application that is being tested (something like starting VerySleepy with the PID as argument, and then stopping it via a socket, a Windows Pipe connection or simply writing a kind of stop.txt file). I want this console-version to have minimal dependencies (so no WxWidgets). I noticed it also uses WxWidgets for the ZIP functionality, but I can perfectly live with a separate set of files (instead of packing them in a ZIP file).

So, my questions:

CyberShadow commented 3 years ago

I want to include VerySleepy in our automatic QA test procedures, so that when QA can automatically generate .sleepy files if they detect a performance decrease in a testing module.

It sounds like you need a way to invoke VerySleepy fully automatically, which is orthogonal to it producing results to standard output, or to it running with a console window, or to it running without a GUI. All of these are independent variables.

We already do run Very Sleepy fully automatically, as part of our test suite. Perhaps you could build off of that.

Here is an example: https://github.com/VerySleepy/tests/blob/721e52fcb14d8134394264586a4fe92e73574059/tests/dmd-64/test.bat#L10

I tried checking out VerySleepy, but I couldn't get it built (simply running build.cmd gave lots of errors about missing .vcxproj files).

Make sure to clone with --recursive.

Any idea on how to get a simple checkout of VerySleepy built (using Visual Studio 2019, 16.11 on Windows 10)?

You could trace the steps done by our CI (AppVeyor), which does succeed in building it successfully.

Is making a console-version of VerySleepy a good idea?

I can't think of many reasons for one, because even headless Windows machines have GUI functionality (as it is a core part of Windows).

Is this idea already being investigated or being worked at?

Not that I know of.

If nobody is working on it yet, what is the easiest way to donate my adapted VerySleepy sources into this GitHub project (knowing that I will probably delete all WxWidgets related-logic from all code)?

You could #ifdef them out. The console versions could be a separate build configuration.

If that's not feasible, you could maintain a fork.

But, and since this sounds like a rather intrusive set of changes, I think it would be nice if there was good justification for it.

If it cannot be donated back to the GitHub project, can I just keep my local copy of the code (does this comply with the GPL2 license)? Am I in that case allowed to distribute the console-version of VerySleepy executable to my customers?

I think making your GitHub fork public and including a link to it in the executable would be sufficient.

CyberShadow commented 3 years ago

I hope the reply above addressed the immediate use case; let me know if you feel there is still something that needs to be done here and I will reopen.