Is there any similar tool for Linux that works like Shark on Mac OS X?
Asked Answered
C

4

7

Shark on Mac OS X is a great tool for profiling an application on a running system. Is there any similar tools for Linux?

OProfile looks like it could be, anyone used it?

Carrel answered 20/10, 2008 at 9:2 Comment(0)
F
4

OProfile is a tool that does sampling-based profiling of both your application and the system calls it makes. This allows for seeing detailed information about where it's spending time. It doesn't have a GUI, but there are several front-ends that will let you process the information from the runs.

I've used it extensively, both for desktop applications and for embedded systems. It takes a little effort to interpret the results, but the callgraph output is really useful here.

Frowsty answered 3/12, 2008 at 3:26 Comment(0)
B
9

Extending another answer, I use the 'callgrind' option of valgrind (http://valgrind.org). Then install kcachegrind from KDE for a nice GUI interface.

As a dummy's tutorial, do:

1) Compile your application with debugging information. It's a good idea to try profiling with optimization both on and off, with optimization off you will get more information, but it may be less accurate (in particular tiny functions will seem to take up more time than they deserve.

2) Run with:

valgrind --tool=callgrind <name of your app> <your app's options>

This should produce a file called 'callgrind.something', which you can load into kcachegrind.

You can also look at:

valgrind --tool=cachegrind <name of your app> <your app's options>

Which will give you information about how your app is interacting with your CPU's cache.

Note that while valgrind and shark seem like similar apps, they work very differently. When you run an app in valgrind it will run many times slower than normal (often over 40 times slower), but the results you get are much more accurate than shark's. I tend to use both, so I can get as much information as possible!

Bodhisattva answered 2/12, 2008 at 17:48 Comment(0)
L
5

You can probably try Valgrind (http://valgrind.org/). They have both runtime and compile time profiling tools.

Liegnitz answered 20/10, 2008 at 9:40 Comment(0)
H
5

A bit late to answer this one, but the closest answer is Zoom. Some of the Shark team worked on it.

Houseyhousey answered 7/12, 2010 at 10:34 Comment(2)
Update: also note that Zoom now runs on Mac OS X...and Shark is gone completely.Vernice
Sadly Zoom is no longer maintained. From the RotateRight website: "Zoom has not been updated since 2015, so it may not work on newer systems. There are no plans to continue development on Zoom at this time."Aleurone
F
4

OProfile is a tool that does sampling-based profiling of both your application and the system calls it makes. This allows for seeing detailed information about where it's spending time. It doesn't have a GUI, but there are several front-ends that will let you process the information from the runs.

I've used it extensively, both for desktop applications and for embedded systems. It takes a little effort to interpret the results, but the callgraph output is really useful here.

Frowsty answered 3/12, 2008 at 3:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.