Messages in this thread | | | Date | Thu, 15 Mar 2012 18:28:05 -0700 | From | Arun Sharma <> | Subject | Re: [PATCH] perf: Add branch stack support to perf script |
| |
On 3/15/12 1:08 PM, Arun Sharma wrote:
> The samples seem to have the sense of call/return > inverted. If the original callgraph was a -> b -> c > I get samples like: > > from to > c b > b a > > To restore the normal sense, I'm printing them as: > > to => from
I debugged this some more and something seems to be wrong with the the way the kernel maps PERF_SAMPLE_BRANCH_ANY_CALL to MSR_LBR_SELECT.
perf record -aj any_call,u -F 1 -- sleep 300 &
msr[0x1c8] = 0x1d
perf record -aj any_ret,u -F 1 -- sleep 300 &
msr[0x1c8] = 0x1ad
Stephane: does this give a clue about what may be wrong? It doesn't match the kernel code:
static const int nhm_lbr_sel_map[PERF_SAMPLE_BRANCH_MAX] = { ... [PERF_SAMPLE_BRANCH_ANY_CALL] = LBR_REL_CALL | LBR_IND_CALL | LBR_REL_JMP | LBR_IND_JMP | LBR_FAR, };
It'd be nice to have *_lbr_sel_map[] in the same order as enum perf_branch_sample_type. Right now, the call and return entries are reversed. Which shouldn't matter in theory, since the initializer has an explicit index.
I also got a kernel hang running the two perf record lines above simultaneously (without the -F 1).
-Arun
| |