How to the prof/gprof tool


 
Thread Tools Search this Thread
Top Forums Programming How to the prof/gprof tool
# 1  
Old 11-24-2005
How to the prof/gprof tool

Hello everyone

I want to use the standard Unix prof/gprof tool for my application but I cannot get through the compilation part. I have add the -xpg option in my makefile as specified in the cc man page but the linker gives me the following error:
***************************************
Undefined first referenced
symbol in file
mcount dlmMain.o
ld: fatal: Symbol referencing errors. No output written to dlm
*** Error code 1
make: Fatal error: Command failed for target `DLM'
******************************************

My main module does not contain any mcount symbol, so I guess is something that has to do with the prof option (-xpg).

How I can overcome this problem? Is there any site with usefull info?

Thanx
# 2  
Old 11-28-2005
I don't know what the -x option does, it's not an option I've ever seen, that I can recall.

Normally -pg does:
1. inserts the names of all of the symbols into the output file (image file)
2. add monitor code (see monitor.h)
3. links the image statically - that is, it puts all of the code into the image file instead of having the code open libraries at run time. Called a static link.

First off try it without the "x". If that fails, then you may be missing the usr/lib/libc.a file - the one used to link statically. If you can see the file and you are using gcc (gprof) then check for the existence of the file: /usr/lib/libgprof32.* <- this assumes you are not on Linux.

Last edited by jim mcnamara; 11-28-2005 at 11:07 AM..
# 3  
Old 12-08-2005
Thanx Jim. It worked with the -pg.

Can anybody suggest a site with Profiling info or Perfromance Analysis/Evaluation tools?

Thanx again.
# 4  
Old 12-08-2005
FWIW - you should profile and mess with your code ONLY AFTER:

1. Code works perfectly correctly and meets all requirements.
2. It has been clearly identified that your code runs too long. And that the business, not your self-image, will profit from the time you spend to speed it up.

In realtime systems performance tuning is a given part of the requirements.

Examples of #2:
You write a report that runs in 40 minutes. The user starts the report, goes to lunch,
comes back reads the report. You decide to tune it, and get it down to 25 minutes of runtime. The user will still start the report and then go to lunch. You have acheived nothing. This is not what you want to tune.

You have a routine that displays input as the user types. It has a runtime of two seconds. The user has to type, wait, type ,wait. You tune it so that it runs in .25 seconds. Now the user sees improvement.

You have long batch runs that go overnight and sometimes bump into the time when users log on again the next day. If there are any delays, then users are asked not to log in. This is a case where tuning is almost mandatory.

Runtimes can also be affected by the amount of free space on the disk system and the number of processes running.

Are you not able to interpret the output from prof? Generally this kind of tuning is more art than science.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

XWindow Tool

Hi Guys can any one help me in this regard .. I'm using Reflaction and xManager but I want list of another xWindow tools between Unix and Windows .. Pls advice .. (1 Reply)
Discussion started by: top.level
1 Replies

2. Infrastructure Monitoring

LogAnalysis Tool

Hello Due to my semester project I am searching a LogAnalysis Tool for Linux platforms. The tool should offer following functionalities: - support Ubuntu/Debian/CentOS - analyse as much as possible system logs - deployable for >100 servers - central administration on one host (preferable... (1 Reply)
Discussion started by: Xava
1 Replies

3. Ubuntu

Fedora Windows XP Prof dual boot

Faced with a "learn the new platform at your own expense or lose your job" ultimatum, I bought a Maxtor internal HD and added it to my older HP desktop which had been upgraded from Windows to Windows Professional. I installed Fedora on the new 500 GB HD and tried putting the Fedora boot partition... (5 Replies)
Discussion started by: dba18
5 Replies

4. UNIX for Dummies Questions & Answers

Chronicle tool

Hi all, Any one know about the chronicle tool. I came to know which is a scheduler tool. If u know any links regarding this please let me know. Regards Saravan (3 Replies)
Discussion started by: saravanakumar
3 Replies

5. Solaris

sar tool

Hi All, I have come through this very nice tool which stores the week performance stats in solaris, but its only stores the stats for 8 in the morning to 5 in the evening. i want to extend the facility to work 24 hrs . Does anyone know how to do that? Thanks in advance (1 Reply)
Discussion started by: azs0309
1 Replies

6. AIX

Nmon tool

How to analyze nmon output or is there any tool for analyzing. (2 Replies)
Discussion started by: vjm
2 Replies

7. Solaris

CD burning tool

Im looking for any GUI Based burner to work under sun solaris 10, any ideas > (7 Replies)
Discussion started by: XP_2600
7 Replies

8. Solaris

Tool top

Hi @all, I have some SUN boxes running. Now I'm looking for the tool "top". Where can I find it? As I could see it is not installed on sys boxes. Thanx and regards daemon (2 Replies)
Discussion started by: daemon
2 Replies

9. UNIX for Dummies Questions & Answers

Linux SuSe 7.2 prof

does someone know the requierements for this OS?!? i installed it on an AMD 850 with 256MB then i tried to install it on an AMD 500 with 64MB, and it doesnt work :( it says, during starting the system, unable to mount /root in 3a:00! i cant go into install, recue or anything else! i... (1 Reply)
Discussion started by: Distributer
1 Replies
Login or Register to Ask a Question