2012-06-18 12:28:18 -04:00
|
|
|
@echo off
|
|
|
|
::
|
|
|
|
:: Profiling using a MSVC standalone profiler
|
|
|
|
::
|
|
|
|
:: See http://www.codeproject.com/Articles/144643/Profiling-of-C-Applications-in-Visual-Studio-for-F for details
|
|
|
|
::
|
2012-05-08 05:22:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set pt="C:\Program Files\Microsoft Visual Studio 9.0\Team Tools\Performance Tools"
|
2012-09-07 12:40:05 -04:00
|
|
|
set appdir=..\MCServer
|
2012-10-20 15:24:27 -04:00
|
|
|
set app=MCServer_profiled.exe
|
2012-05-08 05:22:32 -04:00
|
|
|
|
2012-09-07 12:40:05 -04:00
|
|
|
:: outputdir is relative to appdir!
|
|
|
|
set outputdir=..\Profiling
|
2013-02-25 14:06:37 -05:00
|
|
|
set outputname=profile.vsp
|
|
|
|
set output=%outputdir%\%outputname%
|
2012-09-07 12:40:05 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
:: Must cd to MCServer's directory so that it can find settings.ini etc.
|
|
|
|
cd %appdir%
|
|
|
|
|
|
|
|
::Create the output directory, if it didn't exist
|
|
|
|
mkdir %outputdir%
|
2012-05-08 05:22:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
:: Start the profiler
|
|
|
|
%pt%\vsperfcmd /start:sample /output:%output%
|
2012-09-07 12:40:05 -04:00
|
|
|
if errorlevel 1 goto haderror
|
2012-05-08 05:22:32 -04:00
|
|
|
|
|
|
|
:: Launch the application via the profiler
|
|
|
|
%pt%\vsperfcmd /launch:%app%
|
2012-09-07 12:40:05 -04:00
|
|
|
if errorlevel 1 goto haderror
|
2012-05-08 05:22:32 -04:00
|
|
|
|
|
|
|
:: Shut down the profiler (this command waits, until the application is terminated)
|
|
|
|
%pt%\vsperfcmd /shutdown
|
2012-09-07 12:40:05 -04:00
|
|
|
if errorlevel 1 goto haderror
|
2012-05-08 05:22:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-07 12:40:05 -04:00
|
|
|
:: cd to outputdir, so that the reports are generated there
|
|
|
|
cd %outputdir%
|
|
|
|
|
2012-05-08 05:22:32 -04:00
|
|
|
:: generate the report files (.csv)
|
2013-02-25 14:06:37 -05:00
|
|
|
%pt%\vsperfreport /summary:all %outputname% /symbolpath:"srv*C:\Programovani\Symbols*http://msdl.microsoft.com/download/symbols"
|
2012-09-07 12:40:05 -04:00
|
|
|
if errorlevel 1 goto haderror
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
goto finished
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-08 05:22:32 -04:00
|
|
|
|
2012-09-07 12:40:05 -04:00
|
|
|
:haderror
|
|
|
|
echo An error was encountered
|
|
|
|
pause
|
2012-05-08 05:22:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-07 12:40:05 -04:00
|
|
|
:finished
|