Advertisement

04.22.2007 at 07:38AM PDT, ID: 22526464
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.8

Profiling using gprof in Linux RH4

Asked by Dan_Shule in Linux Programming, Compilers for Software Development, Debugging Software for Development

Tags: , , ,

I'm trying to optimize my program for speed. in the past I have compile and linked my program using g++ with the -pg tag to instrument the code for profiling. The run of the executable generated the expected file gmon.out. However when I'm using the command
gprof <name of executable> gmon.out
I get a bunch of errors such as: BFD: Sim(.rel.plt): relocation 0 has invalid symbol index 1
Then the table shows the number of time each function has been called but no timing information about how much time the CPU spent in this function. All timing information shows the value 0.
Example:
BFD: Sim(.rel.plt): relocation 0 has invalid symbol index 1
BFD: Sim(.rel.plt): relocation 1 has invalid symbol index 2
BFD: Sim(.rel.plt): relocation 2 has invalid symbol index 3
BFD: Sim(.rel.plt): relocation 3 has invalid symbol index 4
BFD: Sim(.rel.plt): relocation 4 has invalid symbol index 5
BFD: Sim(.rel.plt): relocation 5 has invalid symbol index 6
BFD: Sim(.rel.plt): relocation 6 has invalid symbol index 7
BFD: Sim(.rel.plt): relocation 7 has invalid symbol index 8
BFD: Sim(.rel.plt): relocation 8 has invalid symbol index 10
.....
BFD: Sim(.rel.plt): relocation 54 has invalid symbol index 62
BFD: Sim(.rel.plt): relocation 55 has invalid symbol index 63
BFD: Sim(.rel.plt): relocation 56 has invalid symbol index 64
BFD: Sim(.rel.plt): relocation 57 has invalid symbol index 66
Flat profile:

Each sample counts as 0.01 seconds.
 no time accumulated

  %   cumulative   self              self     total
 time   seconds   seconds    calls  Ts/call  Ts/call  name
  0.00      0.00     0.00  2953039     0.00     0.00  __gnu_cxx::__normal_iterator<Process**, std::vector<Process*, std::allocator<Process*> > >::__normal_
iterator(Process** const&)
  0.00      0.00     0.00  2890929     0.00     0.00  __gnu_cxx::__normal_iterator<Process**, std::vector<Process*, std::allocator<Process*> > >::base() co
nst
  0.00      0.00     0.00  1451477     0.00     0.00  std::vector<Process*, std::allocator<Process*> >::end()
  0.00      0.00     0.00  1387588     0.00     0.00  bool __gnu_cxx::operator!=<Process**, std::vector<Process*, std::allocator<Process*> > >(__gnu_cxx::_
_normal_iterator<Process**, std::vector<Process*, std::allocator<Process*> > > const&, __gnu_cxx::__normal_iterator<Process**, std::vector<Process*, std::a
llocator<Process*> > > const&)


I have used prof in the past for profiling and it used to work just fine. RH4 has gprof instead and they say it should be 100% compatible to prof + it is GNU.
Any idea what am I doing wrong?

P.S. my program is multithreaded one. According to the documentation it should not be a problem.
Start Free Trial
[+][-]04.23.2007 at 07:43PM PDT, ID: 18963158

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.25.2007 at 03:09AM PDT, ID: 18972257

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.25.2007 at 04:29AM PDT, ID: 18972555

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.25.2007 at 06:36AM PDT, ID: 18973344

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.25.2007 at 06:41AM PDT, ID: 18973372

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.25.2007 at 08:56AM PDT, ID: 18974732

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.25.2007 at 05:35PM PDT, ID: 18978613

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Linux Programming, Compilers for Software Development, Debugging Software for Development
Tags: gprof, invalid, symbol, linux
Sign Up Now!
Solution Provided By: Nopius
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20081112-EE-VQP-42