summaryrefslogtreecommitdiffstats
path: root/Tools/AnvilStats/profile_run.cmd
blob: 0edb6f23d3b7a0f449a105afc18b45c6d4ddd701 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
@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
::




set pt="C:\Program Files\Microsoft Visual Studio 9.0\Team Tools\Performance Tools"
set appdir="Release profiled"
set app="Release profiled\AnvilStats.exe"
set args="0 c:\Games\MLG\world\region"

:: outputdir is relative to appdir!
set outputdir=Profiling
set output=profile.vsp





::Create the output directory, if it didn't exist
mkdir %outputdir%





:: Start the profiler
%pt%\vsperfcmd /start:sample /output:%outputdir%\%output%
if errorlevel 1 goto haderror

:: Launch the application via the profiler
%pt%\vsperfcmd /launch:%app% /args:%args%
if errorlevel 1 goto haderror

:: Shut down the profiler (this command waits, until the application is terminated)
%pt%\vsperfcmd /shutdown
if errorlevel 1 goto haderror





:: cd to outputdir, so that the reports are generated there
cd %outputdir%

:: generate the report files (.csv)
%pt%\vsperfreport /summary:all %output% /symbolpath:"srv*C:\Programovani\Symbols*http://msdl.microsoft.com/download/symbols" 
if errorlevel 1 goto haderror





goto finished




:haderror
echo An error was encountered
pause




:finished