• Y
    perf script: Fix printing 'phys_addr' failure issue · 20287a73
    Yao Jin 提交于
    hulk inclusion
    category: bugfix
    bugzilla: https://gitee.com/openeuler/kernel/issues/I4OAFT
    CVE: NA
    
    -------------------------------------------------
    
    Perf script was failed to print the phys_addr for SPE profiling.
    One 'dummy' event is added by SPE profiling but it doesn't have PHYS_ADDR
    attribute set, perf script then exits with error.
    
    Now referring to 'addr', use evsel__do_check_stype() to check the type.
    
    Before:
    
      # perf record -e arm_spe_0/branch_filter=0,ts_enable=1,pa_enable=1,load_filter=1,jitter=0,store_filter=0,min_latency=0,event_filter=2/ -p 4064384 -- sleep 3
      # perf script -F pid,tid,addr,phys_addr
      Samples for 'dummy:u' event do not have PHYS_ADDR attribute set. Cannot print 'phys_addr' field.
    
    After:
    
      # perf record -e arm_spe_0/branch_filter=0,ts_enable=1,pa_enable=1,load_filter=1,jitter=0,store_filter=0,min_latency=0,event_filter=2/ -p 4064384 -- sleep 3
      # perf script -F pid,tid,addr,phys_addr
      4064384/4064384 ffff802f921be0d0      2f921be0d0
      4064384/4064384 ffff802f921be0d0      2f921be0d0
    Signed-off-by: NYao Jin <jinyao5@huawei.com>
    Signed-off-by: NWei Li <liwei391@huawei.com>
    Reviewed-by: NYang Jihong <yangjihong1@huawei.com>
    Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
    20287a73
builtin-script.c 103.0 KB