1

I am using http://valgrind.org/docs/manual/cl-manual.html to profile my application. But I have a question about it's o/p does it shows

  1. time consumed inside that function

OR

  1. cpU consumed inside that function call

What I guess is Currently it is showing 90% usage in curl connect. I think which is i/o bound process.

So I think it is showing time consumed inside that function call.

2 Answers 2

0

It can show various things, either instruction count (a rough proxy for CPU time), an estimated cycle count (also a rough proxy for CPU time), or various sorts of estimated cache hit/miss counts.

0

The callgrind tool of valgrind as stated in the document has only Instructions read (Ir) enabled by default.

The tool itself is not suitable for calculating the time consumed by the function, refer here.

For getting time and CPU usage I prefer running "time" command in Unix in verbose mode

/usr/bin/time -v

However, we can get other utilities such as

==snippet from the doc===

Cache misses on instruction reads ("I1mr"/"ILmr"), data read accesses ("Dr") and related cache misses ("D1mr"/"DLmr"), data write accesses ("Dw") and related cache misses ("D1mw"/"DLmw") by enabling the option of

--cache-sim=yes

Also its possible to get other utilities such as Number of executed conditional branches and related predictor misses ("Bc"/"Bcm"), executed indirect jumps and related misses of the jump address predictor ("Bi"/"Bim") by enabling option of

--branch-sim=yes

Finally with the help of callgrind_annotate utility we get the desired output file.

==========

Not the answer you're looking for? Browse other questions tagged or ask your own question.