• Stephane Eranian's avatar
    perf script: Enable printing of branch stack · dc323ce8
    Stephane Eranian authored
    This patch improves perf script by enabling printing of the
    branch stack via the 'brstack' and 'brstacksym' arguments to
    the field selection option -F. The option is off by default
    and operates only if the perf.data file has branch stack content.
    
    The branches are printed in to/from pairs. The most recent branch
    is printed first. The number of branch entries vary based on the
    underlying hardware and filtering used.
    
    The brstack prints FROM/TO addresses in raw hexadecimal format.
    The brstacksym prints FROM/TO addresses in symbolic form wherever
    possible.
    
     $ perf script -F ip,brstack
      5d3000 0x401aa0/0x5d2000/M/-/-/-/0 ...
    
     $ perf script -F ip,brstacksym
      4011e0 noploop+0x0/noploop+0x0/P/-/-/0
    
    The notation F/T/M/X/A/C describes the attributes of the branch.
    F=from, T=to, M/P=misprediction/prediction, X=TSX, A=TSX abort, C=cycles (SKL)
    Signed-off-by: default avatarStephane Eranian <eranian@google.com>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Andi Kleen <ak@linux.intel.com>
    Cc: David Ahern <dsahern@gmail.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Kan Liang <kan.liang@intel.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Yuanfang Chen <cyfmxc@gmail.com>
    Link: http://lkml.kernel.org/r/1441039273-16260-5-git-send-email-eranian@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    dc323ce8
builtin-script.c 51.2 KB