Commit [eb7558]  Maximize  Restore  History

Improve sample collection in multi-threaded apps when using "--pid" option

See oprofile bug # 260 (https://sourceforge.net/p/oprofile/bugs/260/) for reference.

operf may fail to collect samples for new threads or forked
processes in a multi-threaded app under certain conditions:

- If operf is started on a multi-threaded app (i.e., one that uses
pthreads) with the "--pid" option
- If said app has already started at least one thread
- If the app either creates new threads or forks new processes
after operf has started

then no samples are collected for those new threads/processes.

This patch fixes that problem (mostly) and documents the limitations and
issues when using the "--pid" option. The limitations and issues are:

1. When using "--pid" to profile a multi-threaded application that also forks
new processes, samples for processes that are forked before profiling is
started may not be recorded (depending on timing of thread creation and
when operf is started)

2. The "--lazy-conversion" option is not recommended to be used in conjunction
with the --pid option for profiling multi-threaded processes. Depending on
the order of thread creation (or forking of new processes), you may not get
any samples for the new threads/processes.

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>

Maynard Johnson Maynard Johnson 2014-06-23

changed doc/operf.1.in
changed libperf_events/operf_counter.cpp
changed libperf_events/operf_counter.h
changed libperf_events/operf_utils.cpp
changed pe_profiling/operf.cpp
doc/operf.1.in Diff Switch to side-by-side view
Loading...
libperf_events/operf_counter.cpp Diff Switch to side-by-side view
Loading...
libperf_events/operf_counter.h Diff Switch to side-by-side view
Loading...
libperf_events/operf_utils.cpp Diff Switch to side-by-side view
Loading...
pe_profiling/operf.cpp Diff Switch to side-by-side view
Loading...

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks