Using `callgrind` to count function calls in Linux

195 views Asked by At

I am trying to track function call counts on a program I'm interested in. If I run the program on its own, it will run fine. If I try to run it with valgrind using the command seen below I seem to be getting a different result.

Command run: enter image description here

Produces this input immediately, even though the execution is normally slow. enter image description here

2

There are 2 answers

3
Sagar On

valgrind has limited floating point support. You're probably using non-standard or very large floats.

UPDATE: since you're using long double, you're outta luck. Unfortunately,

Your least-worst option is to find a way to make your world work just using standard IEEE754 64-bit double precision.

This probably isn't easy considering you're using an existing project.

3
Paul Floyd On

I'd say that this is more likely to be related to this issue. However to be certain you will need to tell us

  1. what compilation options are being used - specifically are you using anything related to AVX or x87?
  2. What hardware this is running on.

It would help if you can cut this down to a small example and either update this or the frexp bugzilla items.