Software Archive
Read-only legacy content
17061 Discussions

Performance monitoring

Intel_C_Intel
Employee
620 Views
Has anyone tried to do any performance monitoring from within Developer Studio? The help files on how to do this are cryptic at best. I want to do a line by line monitoring and have set the appropriate compile and link options specified in the help files for doing this within Developer Studo. But the next bit of information in the help files is to "profile" the code, whatever that means. Then the help file suggests using Pview, Spy ++, Windows Performance Monitor, or "other" programs to get information.

But, then there is a section for profiling from a DOS prompt that includes running perfmon or prep, profile, and plist. I get a rather fuzzy impression that the only way to do a line by line profile for determining computational bottlenecks is at a DOS prompt, but, again, the help file is so cryptic on this that all I can get is an impression. Furthermore, there is no sample output from any program that shows what I need to look for.

Can anyone tell me anything about performance monitoring that will get me further down the line? Thanks,

Tom
0 Kudos
5 Replies
Jugoslav_Dujic
Valued Contributor II
620 Views
Yes, profiler's integration into Visual Studio is problematic at best. First, you have to select "Enable profiling" on link tab; that will produce .map files necessary for profiling. While profiler can be run from VS, I use the following batch file to set up things myself. The batch is used for profiling of an exe(VC++ 6) + dll(CVF 5) which cannot be done from VS anyway. OK, it could be more general without hard-coded program names but I hope you could adapt it to your needs. MAP files should be in the same directory as .bat
 
@ECHO OFF 
ECHO Preparing (step1)... 
prep /FT /NOLOGO dmsshell.exe dmsapp.dll 
ECHO Profiling... 
profile /NOLOGO dmsshell.exe 
ECHO Preparing (step2)... 
prep /NOLOGO /IT dmsshell.pbt /IO dmsshell.pbo /OT output.pbt 
ECHO Creating output file _profile.txt ... 
plist /ST /NOLOGO /INDENT output.pbt >_profile.txt 
del *.pbo 
del *.pbt 
del *.pbi 

As I recall (I was lazy at the time when I wrote this :-)) prep /FT in the first run prepares *.pbi and *.pbt files for profile. Profile creates *.pbo. When run second time, prep modifies *.pbt which then can be converted to "human-parsable" form using plist.

Also, I hope you use form one routine-one source file, since profiler has a well-known bug that it tends to "forgot" about existence of 2nd, 3rd... routine in the file, especially when CONTAINed :-(.

HTH

Jugoslav
0 Kudos
Intel_C_Intel
Employee
620 Views
Tom

I've been moderately successful with profiler recently, having figured out how to perform timing, counts, and coverage profiles at the function and line level. Even managed to decode how to merge profiles to wash out some probe error (timing harmonic) effects by using several problem sets through the same code. The source of my new found knowledge was the MSDN Library for Visual Studio 6.0. This might help you, too.

My reply to myself on Feb 28 in this forum contains some additional info that you might find useful.

John
0 Kudos
durisinm
Novice
620 Views
John,

What keywords did you use to search the MSDN library for the information?

The discussion of how to time an application in section 6.2.1 of the _Digital Visual Fortran Programmer's Guide_ book is for Windows NT, and I haven't been successful using those instructions for Windows 2000. Does anyone have an updated procedure for Windows 2000, or does anyone know how to find the information on Microsoft's Web site?

Mike
0 Kudos
Intel_C_Intel
Employee
620 Views
I am using the CD-ROM of the MSDN Library that comes with Visual Studio Enterprise. The key words I used were "profiler" and then "merge" within the prior search results. I have not tried to retrieve the info from online.

So far, I've been able to use merges with /LV for line coverage, /LC for line counts (just using 3 or so routines - otherwise the runs take too long on my ole dino P133!), /FC for function coverage, and /FT for function timing. The FTIME3.BAT sample below is a batch file I use for 3 test datasets to get /FT:

ECHO 3 Passes profiling %1 using %2 files %3,%4,%5 > %2FTIME3.TXT
prep /om /ft /exc dfor.lib %1
profile %1 %2%3
prep /m %1
profile %1 %2%4
prep /m %1
profile %1 %2%5
prep /m %1
plist %1 >> %2FTIME3.TXT

To use it from the MS-DOS command line, use:

FTIME3 Program DataPath Set1 Set2 Set3 where:

Program is the program name (must be in same directory as the batch file)
DataPath is the full drive and path to the test data set files (e.g. C:Path)
Set1, Set2, Set3 are the test data set file names with extensions.

NOTE: I did not want to profile the Fortran runtime library in this example, hence the "/exc dfor.lib". If library use is an issue, you may want to remove that switch.

I hope to have permission to publish a short paper on my use of the profiler; just waiting for the OK and something back from Compaq/Intel on the newsletter. I'll see if I can get a draft out to you also.

Hope this helps you other CVF users out there.

John
0 Kudos
Intel_C_Intel
Employee
620 Views
John,

I would very much like a copy of your soon to be article. You can send it to colet@wes.army.mil. Thanks,

Tom
0 Kudos
Reply