lkml.org 
[lkml]   [2012]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2012-03-16 02:31    [W:0.036 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site