summaryrefslogtreecommitdiffstats
path: root/MCServer/profile_run.cmd
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-08-27 13:53:02 +0200
committerMattes D <github@xoft.cz>2014-08-27 13:53:02 +0200
commit4a907c9efa9cc2bb6da95686b56ed8d7709613f2 (patch)
tree40d7d6ef18bad61b9c258e9ad8c9f1f57964489c /MCServer/profile_run.cmd
parentMerge pull request #1346 from mc-server/AnvilStatsHeights (diff)
parentDungeonRooms: Added a height probability distribution function. (diff)
downloadcuberite-4a907c9efa9cc2bb6da95686b56ed8d7709613f2.tar
cuberite-4a907c9efa9cc2bb6da95686b56ed8d7709613f2.tar.gz
cuberite-4a907c9efa9cc2bb6da95686b56ed8d7709613f2.tar.bz2
cuberite-4a907c9efa9cc2bb6da95686b56ed8d7709613f2.tar.lz
cuberite-4a907c9efa9cc2bb6da95686b56ed8d7709613f2.tar.xz
cuberite-4a907c9efa9cc2bb6da95686b56ed8d7709613f2.tar.zst
cuberite-4a907c9efa9cc2bb6da95686b56ed8d7709613f2.zip
Diffstat (limited to 'MCServer/profile_run.cmd')
-rw-r--r--MCServer/profile_run.cmd17
1 files changed, 11 insertions, 6 deletions
diff --git a/MCServer/profile_run.cmd b/MCServer/profile_run.cmd
index 58efea64a..6137e9d4d 100644
--- a/MCServer/profile_run.cmd
+++ b/MCServer/profile_run.cmd
@@ -12,7 +12,8 @@
:: It expects the MS Performance tools installed in C:\Program Files\Microsoft Visual Studio 9.0\Team Tools\Performance Tools
:: You can override this path by setting the pt environment variable prior to launching this script
::
-:: By default it will launch the release version of MCServer; set the app environment variable to another executable to run that instead.
+:: By default it will launch the 32-bit release version of MCServer; set the app environment variable to another executable to run that instead.
+:: Set the IsExecutablex64 env variable to \x64 to profile a 64-bit executable instead (available as the profile_run_x64.cmd script)
:: Note that the app needs to be compiled with the "/PROFILE" flag in order for the profiling to work
@@ -45,7 +46,7 @@ if %outputdir%n == n (
-::Create the output directory, if it didn't exist
+:: Create the output directory, if it didn't exist
mkdir %outputdir%
@@ -55,15 +56,15 @@ mkdir %outputdir%
:: Start the profiler
set outputname=profile.vsp
set output=%outputdir%\%outputname%
-%pt%\vsperfcmd /start:sample /output:%output%
+%pt%%IsExecutablex64%\vsperfcmd /start:sample /output:%output%
if errorlevel 1 goto haderror
:: Launch the application via the profiler
-%pt%\vsperfcmd /launch:%app%
-if errorlevel 1 goto haderror
+%pt%%IsExecutablex64%\vsperfcmd /launch:%app%
+if errorlevel 1 goto haderrorshutdown
:: Shut down the profiler (this command waits, until the application is terminated)
-%pt%\vsperfcmd /shutdown
+%pt%%IsExecutablex64%\vsperfcmd /shutdown
if errorlevel 1 goto haderror
@@ -86,6 +87,10 @@ goto finished
+:haderrorshutdown
+echo An error was encountered, shutting down the profiler
+%pt%%IsExecutablex64%\vsperfcmd /shutdown
+
:haderror
echo An error was encountered
pause