• Arnaldo Carvalho de Melo's avatar
    perf evlist: Decode perf_event_attr->branch_sample_type · a213b92e
    Arnaldo Carvalho de Melo authored
    While trying to use --call-graph lbr in 'perf trace', since we only are
    interested in the callchain for userspace, up to the callchain, I found
    that 'perf evlist' is not decoding the branch_sample_type field, fix it.
    
    Before:
    
      # perf record --call-graph lbr usleep 1
      # perf evlist -v
      cycles:ppp: size: 112, { sample_period, sample_freq }: 4000,
      sample_type: IP|TID|TIME|CALLCHAIN|CPU|PERIOD|BRANCH_STACK,
      disabled: 1, inherit: 1, mmap: 1, comm: 1, freq: 1, task: 1,
      precise_ip: 3, sample_id_all: 1, exclude_guest: 1, mmap2: 1,
      comm_exec: 1, branch_sample_type: 51201
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
    
    After:
    
      # perf evlist -v
      cycles:ppp: size: 112, { sample_period, sample_freq }: 4000,
      sample_type: IP|TID|TIME|CALLCHAIN|CPU|PERIOD|BRANCH_STACK,
      disabled: 1, inherit: 1, mmap: 1, comm: 1, freq: 1, task: 1,
      precise_ip: 3, sample_id_all: 1, exclude_guest: 1, mmap2: 1,
      comm_exec: 1, branch_sample_type: USER|CALL_STACK|NO_FLAGS|NO_CYCLES
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: David Ahern <dsahern@gmail.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Milian Wolff <milian.wolff@kdab.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Wang Nan <wangnan0@huawei.com>
    Link: http://lkml.kernel.org/n/tip-hozai7974u0ulgx13k96fcaw@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    a213b92e
evsel.c 57.6 KB