Solved

How to profile in VC++6

Posted on 2001-06-12
11
475 Views
Last Modified: 2013-11-20
Hi All,

I'm interested in studying my code for performance enhancements. I've never used the profiler in VC++6 before (or any other profiler product). I'm running in Dev Studio (6). I've checked all of the boxes that enable profiling (linking incrementally turned off), generating a map file and .pdb in Microsoft format. I then run my app (in debug I think is correct). Oh, I also clicked on "function timing". The big question is:

Where do I view my timing results? If it is supposed to be under the "profile Tab" then I have to say I get nothing there. I have seen an error about profile.dll but I checked the system and I have only one version of this file, the correct data, and in the correct location according to the help. Can anybody hold my hand a bit here and let me know what to do?

Thanks!

Dave P
0
Comment
Question by:esdave
  • 5
  • 3
  • 3
11 Comments
 
LVL 5

Expert Comment

by:proskig
ID: 6182466
This link gives an excellent overview of built-in profiler.

http://msdn.microsoft.com/library/default.asp?URL=/library/devprods/vs6/visualc/vccore/_core_profiling.3a_.overview.htm

I can also recommend to look at third-party profilers. There are good ones provided by Rational Software and nu-mega. I will post links soon
0
 
LVL 5

Expert Comment

by:proskig
ID: 6182490
0
 

Author Comment

by:esdave
ID: 6182521
Proskig,

Thanks for your quick reply. I'm opening up the question for others to answer since what you pointed me to is the same documentation as is on my system and I have looked at it in total.

I still can't seem to get any results. I get the following:

PREP : fatal error PRF1012: cannot read expected number of bytes from file d:\esdave\oitest\debug\vtest.pbo

In the docs it says something about profile.dll. I have the correct version of profile.dll in the correct location.

Dave P
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 5

Expert Comment

by:proskig
ID: 6182529
fine, I agree
0
 
LVL 4

Expert Comment

by:captainkirk
ID: 6182633
I've always done it from the command line (batch file) and not from the IDE - it's a four-pass operation, as you would know from the docs...

PREP pass 1
PROFILE
PREP pass 2
PLIST

The output can be placed in a file formatted so that Excel can read it and generate a sheet, etc. There is a macro called profiler.xlm, I believe, that will give you a bar chart that may or may not be useful - sometimes you get a skimmed-down chart that doesn't include the functions of interest.

Try the command line approach and see if that doesn't help...
0
 

Author Comment

by:esdave
ID: 6186304
CaptainKirk, Jim (if you don't mind),

I have not used the command line to build my apps except if I have a Makefile I can use NMAKE to build it. That is the extent of my knowledge of the command line. You say:

PREP pass 1
PROFILE
PREP pass 2
PLIST

I have no idea what that all means. Are those commands that you type at the DOS level? No Makefile? The bottom line is that I don't see what you are doing. I have nothing against using the command line tools to get what I want done. Could you please spell out in a bit (OK, a bunch) more detail. I'd surely appreciate it.

Thanks!

Dave P
0
 

Author Comment

by:esdave
ID: 6186350
CaptainKirk, Jim (if you don't mind),

I have not used the command line to build my apps except if I have a Makefile I can use NMAKE to build it. That is the extent of my knowledge of the command line. You say:

PREP pass 1
PROFILE
PREP pass 2
PLIST

I have no idea what that all means. Are those commands that you type at the DOS level? No Makefile? The bottom line is that I don't see what you are doing. I have nothing against using the command line tools to get what I want done. Could you please spell out in a bit (OK, a bunch) more detail. I'd surely appreciate it.

Thanks!

Dave P
0
 
LVL 4

Accepted Solution

by:
captainkirk earned 50 total points
ID: 6186734
Yep - here's an example of profiling a single EXE:

create a batch file, call it prof.bat:

REM - create self-profiling EXE...
PREP /OM /FT yourprogram.exe
if errorlevel == 1 goto done

REM - gather stats...
PROFILE yourprogram
if errorlevel == 1 goto done

REM - create output files for input to PLIST...
PREP /M yourprogram
if errorlevel == 1 goto done

REM - create tab-delimited report...
PLIST /T yourprogram > yourprogram.lst
:done

"yourprogram.lst" will contain the output in tab delimited format that you can use Excel to read in and create a spreadhseet for. Then you can run the Excel macro "profiler.xlm" to create a graph, if you want.

Now you can go to a DOS window or to "Run" from the Start button and just execute the batch file by typing in the complete path....

Modifications can be done to the above batch file if you need to include additional DLL's, merge several runs, etc...

Need more info, just yell....
0
 

Author Comment

by:esdave
ID: 6186754
CaptainKirk, Jim (if you don't mind),

I have not used the command line to build my apps except if I have a Makefile I can use NMAKE to build it. That is the extent of my knowledge of the command line. You say:

PREP pass 1
PROFILE
PREP pass 2
PLIST

I have no idea what that all means. Are those commands that you type at the DOS level? No Makefile? The bottom line is that I don't see what you are doing. I have nothing against using the command line tools to get what I want done. Could you please spell out in a bit (OK, a bunch) more detail. I'd surely appreciate it.

Thanks!

Dave P
0
 

Author Comment

by:esdave
ID: 6186806
Capt'n,

I just got profiler results for my app just minutes ago. Thanks for your help!!

Dave P
0
 
LVL 4

Expert Comment

by:captainkirk
ID: 6187369
glad it helped...
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Login Script to Copy Folders 12 42
Change owner from userA to server Local Administrators 7 66
withoutTen challenge 14 131
EvenOdd challenge 10 126
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question