2

I need to see the load balancing characteristics of my multithreaded program. Is there any tool that will give me the information to, e.g. plot this? I need something simple that will give me information per core, for example, but not Intel VTune and the such... that is so bloated it hurts to even look at it.

user454322
  • 7,300
  • 5
  • 41
  • 52
Dervin Thunk
  • 19,515
  • 28
  • 127
  • 217

4 Answers4

3

Take a look at Linux Trace Toolkit - next generation, you can also use Gnu gprof it's not sexy but it do the job :)

EDIT : You can use gprof in threaded environment : Using gprof with pthreads

EDIT2 : Oprofile may help also

Community
  • 1
  • 1
TOC
  • 4,326
  • 18
  • 21
2

I've only scratched the surface of the capabolities of AMD's CodeAnalyst but what I have found so far is impressive, especially all the performance counters and getting them into the detailed picture. As to per-thread profiling, I mostly write massively parallel applications running for extended periods of time on dedicated cores which may not be applicable for your stuff.

It appears quite stingy with respect to its own CPU needs. I don't know if it will profile on intel CPUs. There is a Linux version.

Give it a spin!

Olof Forshell
  • 3,169
  • 22
  • 28
  • I'm on an Intel machine. :( But I've only heard good things about CA. Thanks. – Dervin Thunk Sep 29 '12 at 14:11
  • Are you sure it won't work on intel CPUs? I know some intel ICC run-time libraries detect non-intel machines and enable slower code. I found this post http://www.virtualdub.org/blog/pivot/entry.php?id=288 which claims that some CA techniques do work on intel. – Olof Forshell Sep 30 '12 at 20:00
0

You can also use perf, the official implementation for supporting performance counters in the Linux kernel. In addition to reading performance counters, it also allows to access some other metrics such as context switches, CPU migrations, page faults, etc.

Unfortunately the official wiki does not contain too much information. But you can check this page for more information on how to use the different tools included in perf.

betabandido
  • 18,946
  • 11
  • 62
  • 76
0

For researching subject I've used the following command:

ps -AL -o lwp,fname,psr | grep ammp

The application under study was ammp, it uses the same number of threads than cores. The command returns in which core was each thread. Executing this command several times you will see how a given thread moves through the cores and how the load balancing algorithm works.

I hope you find useful.

  • `ps -L -o lwp,fname,psr ` would be much better because will show you only the info about the process you are interested on, so no need to grep (create an additional process) – user454322 Sep 27 '12 at 07:35