Solved

How to profile in VC++6

Posted on 2001-06-12
11
487 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
haveThree challenge 22 127
abstract class with all non abstract mentods 6 87
wordappend challenge 8 247
Detect file exist or not 3 215
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.

734 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