?
Solved

How to profile in VC++6

Posted on 2001-06-12
11
Medium Priority
?
502 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
 

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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 200 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Integration Management Part 2
Suggested Courses
Course of the Month16 days, 23 hours left to enroll

862 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