Solved

How to profile in VC++6

Posted on 2001-06-12
11
439 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
Comment Utility
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
Comment Utility
0
 

Author Comment

by:esdave
Comment Utility
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
 
LVL 5

Expert Comment

by:proskig
Comment Utility
fine, I agree
0
 
LVL 4

Expert Comment

by:captainkirk
Comment Utility
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:esdave
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
glad it helped...
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
MFC Dialog 9 47
repeatSeparator  java  challenge 13 56
either24  challenge 19 84
Unix Command -- Challenging  question 7 79
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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

771 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now