• Adrian Hunter's avatar
    perf script: Add field option 'flags' to print sample flags · 400ea6d3
    Adrian Hunter authored
    Instruction tracing will typically have access to information about the
    instruction being executed for a particular ip sample.  Some of that
    information will be available in the 'flags' member of struct
    perf_sample.
    
    With the addition of transactions events synthesis to Instruction
    Tracing options, there is a need to be able easily to see the flags
    because they show whether the ip is at the start, commit or abort of a
    tranasaction.
    
    Consequently add an option to display the flags.
    
    The flags are "bcrosyiABEx" which stand for branch, call, return,
    conditional, system, asynchronous, interrupt, transaction abort, trace
    begin, trace end, and in transaction, respectively.
    
    Example using Intel PT:
    
    perf script -fip,time,event,sym,addr,flags
    
    ...
     1288.721584105: branches:u:   bo              401146 main =>           401152 main
     1288.721584105: transactions:   x                   0           401164 main
     1288.721584105: branches:u:   bx              40117c main =>           40119b main
     1288.721584105: branches:u:   box             4011a4 main =>           40117e main
     1288.721584105: branches:u:   bcx             401187 main =>           401094 g
    ...
     1288.721591645: branches:u:   bx              4010c4 g =>           4010cb g
     1288.721591645: branches:u:   brx             4010cc g =>           401189 main
     1288.721591645: transactions:                       0           4011a6 main
     1288.721593199: branches:u:   b               4011a9 main =>           4011af main
     1288.721593199: branches:u:   bo              4011bc main =>           40113e main
     1288.721593199: branches:u:   b               401150 main =>           40115a main
     1288.721593199: transactions:   x                   0           401164 main
     1288.721593199: branches:u:   bx              40117c main =>           40119b main
     1288.721593199: branches:u:   box             4011a4 main =>           40117e main
     1288.721593199: branches:u:   bcx             401187 main =>           40105e f
    ...
     1288.722284747: branches:u:   brx             401093 f =>           401189 main
     1288.722284747: branches:u:   box             4011a4 main =>           40117e main
     1288.722284747: branches:u:   bcx             401187 main =>           40105e f
     1288.722285883: transactions:   bA                  0           401071 f
     1288.722285883: branches:u:   bA              401071 f =>           40116a main
     1288.722285883: branches:u:   bE              40116a main =>                0 [unknown]
     1288.722297174: branches:u:   bB                   0 [unknown] =>           40116a main
    ...
    Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
    Cc: David Ahern <dsahern@gmail.com>
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Namhyung Kim <namhyung@gmail.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Stephane Eranian <eranian@google.com>
    Link: http://lkml.kernel.org/r/1428594864-29309-26-git-send-email-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    400ea6d3
event.h 10.1 KB