3

Is oprofile thread-aware/safe (meaning I can safely profile multithreaded apps), and if so, what is the difference with perf?

Dervin Thunk
  • 19,515
  • 28
  • 127
  • 217

2 Answers2

0

1 Yes, oprofile is thread aware.

Verbatim from man opcontrol (oprofile's control tool):

--separate=[none,lib,kernel,thread,cpu,all]

Separate samples based on the given separator. 'lib' separates dynamically linked library samples per application. 'kernel' separates kernel and kernel module samples per application; 'kernel' implies 'library'. 'thread' gives separation for each thread and task. 'cpu' separates for each CPU. 'all' implies all of the above options and 'none' turns off separation.

2 oprofile is system-wide profiler, it runs as a daemon and by default profiles all system activity.

alk
  • 69,737
  • 10
  • 105
  • 255
0

Both Oprofile and Perf are thread-aware and can profile multithreaded apps. They can even profile the kernel if you ask them.

OProfile is a profiler (one tool that can record and annotate). It was one of the first (if not the first) profiler to actually use hardware performance counters.

Perf is a set of profiling tools to help you understand what's going on with an application (stat, top, record, annotate, etc.). It is part of the Linux kernel project (although the tools work in userland). It is still in active development, and from what i hear it happens from time to time that the API change dramatically.

KrahnacK
  • 313
  • 2
  • 7