I have just pushed into GIT a patch that changes the interface to the
PMU context routines. We had a single call to implemented switch_from
and switch_to: pfm_ctxsw().
In order for perfmon to leverage, the Debug Store (ds) interface partially
integrated into the mainline kernel, we have had to split the operations
between swiching out and in. The reason is that DS now manages the
DS Area pointer and does the saving/restoring on context switch. When
context switching PEBS per-thread sessions, the following order must
1. stop and save PMU state
2. clear DS_AREA
3. install new DS_AREA (if any)
4. reload new PMU state (if needed)
Hence, DS management and PMU state management must be interleaved.
Although this affects only X86 (Intel) processor, the pfm_ctxsw() was a generic
interface, thus the break down into pfm_ctxsw_out()/pfm_ctxsw_in() had to be
propagated to all arches.
Although, PEBS support via DS is not yet functional in 2.6.25, the
changes prepares for it for 2.6.26. I prefer pushing it now so that it
can get some
exposure ahead of time.
A side effect of this change is that now the perfmon stats in debugfs breakdown
the cost of context switch in and out separately.
Please pull from GIT and report any problems.