Console alternative of kcachegrind?
Asked Answered
H

5

21

Kcachegrind rocks and it's of my favorite tools, however from time to time I'm missing the ability to run it in terminal(e.g using ssh) on the remote server.

I know it's possible to setup VNC or X-server forwarding but it's quite clumsy while I need something simple.

Is there any kcachegrind console alternative(e.g ncurses based)?

Haffner answered 5/9, 2009 at 17:12 Comment(0)
T
15

You can get basic information and annotations from callgrind output file (created by valgrind --tool=callgrind) with the command-line utility callgrind_annotate. (manual page section in docs). For files, generated by cachegrind (valgrind --tool=cachegrind), you can use a cg_annotate (section in docs). These utilities are build by default with valgrind itself.

Another way is to copy program and cache/callgrind output files to your machine and then analyze them with local kcachegrind as usual. But this way it can be difficult if your machine have no unix but windows or you running on incompatible arch (kcachegrind can call local objdump to get information about program).

I also want to recommend command line options to valgrind:

 valgrind --tool=cachegrind --branch-sim=yes 
 valgrind --tool=callgrind --dump-instr=yes --trace-jump=yes

You can also specify cache sizes for cachegrind with --I1=32768,8,64 --D1=32768,8,64 --L2=3145728,12,64

Tanh answered 25/3, 2011 at 17:53 Comment(0)
W
5

webgrind is a web-frontend written in PHP that parses the output of XDebug (which uses the same format as callgrind).

Wait answered 25/3, 2011 at 17:17 Comment(1)
" It implements a subset of the features of kcachegrind". So, e.g. assembler output will be inaccessible via webgrindTanh
C
4

Use SSHFS to mount the remote directory that you're working in (see e.g. SSHFS installation instructions for Ubuntu).

Then just ssh in and run valgrind --tool=callgrind with whatever options you want in the remote directory. Since you have that directory mounted locally, it's as easy to open the data files with KCacheGrind as if you were debugging locally.

Crater answered 24/3, 2011 at 1:40 Comment(1)
Cachegrind files can grow huge, upto several hundred MBs. Doing this on large files is really not recommended as kcachegrind reads the whole file at once, which will require several minutes even on a fast connection.Navel
E
0

Running Valgrind/Callgrind at the remote host appears to be a good option. Or, you could scp the output from Valgrind or Callgrind to your PC and run KCachegrind on it.

If you use Emacs, you could fire it up on the remote host and do as shown here, which will give you an Emacs'ish frontend for the valgrind tool.

Extract answered 23/3, 2011 at 22:46 Comment(0)
I
-9

kcachegrind states in its help that it is a frontend to cachegrind and callgrind.

cachegrind and callgrind are parts of the latest version (3.5) of valgrind. So, download valgrind from http://valgrind.org/downloads/current.html#current and build it. Run valgrind --help, it shows you how to use callgrind functionality.

For more information I need to know what you want to do.

Ingest answered 24/12, 2009 at 13:46 Comment(4)
I think you didn't really read the question. What I need is a ncurses based frontend for callgrind/cachegrind.Haffner
The answer is valgrind. For instructions how to use valgrind, run valgrind --help.Ingest
you are wrong, the answer is not valgrind. Valgrind only do an run and collect information step, but not a view the result for callgrind & cachegrindTanh
@ThorstenStaerk, to be very clear, valgrind's output (in callgrind or cachegrind mode) is not particularly human-readable. kcachegrind doesn't just run the tool, it interprets the results -- which is somewhat essential to the ability to make practical use said results. It's a curses-based tool to assist in such interpretation being requested here.Spiry

© 2022 - 2024 — McMap. All rights reserved.