• Ian Rogers's avatar
    perf list: Give more details about raw event encodings · 4ccf3bb7
    Ian Rogers authored
    List all the PMUs, not just the first core one, and list real format
    specifiers with value ranges.
    
    Before:
    
      $ perf list
      ...
        rNNN                                               [Raw hardware event descriptor]
        cpu/t1=v1[,t2=v2,t3 ...]/modifier                  [Raw hardware event descriptor]
             [(see 'man perf-list' on how to encode it)]
        mem:<addr>[/len][:access]                          [Hardware breakpoint]
      ...
    
    After:
    
      $ perf list
      ...
        rNNN                                               [Raw event descriptor]
        cpu/event=0..255,pc,edge,.../modifier              [Raw event descriptor]
             [(see 'man perf-list' or 'man perf-record' on how to encode it)]
        breakpoint//modifier                               [Raw event descriptor]
        cstate_core/event=0..0xffffffffffffffff/modifier   [Raw event descriptor]
        cstate_pkg/event=0..0xffffffffffffffff/modifier    [Raw event descriptor]
        i915/i915_eventid=0..0x1fffff/modifier             [Raw event descriptor]
        intel_bts//modifier                                [Raw event descriptor]
        intel_pt/ptw,event,cyc_thresh=0..15,.../modifier   [Raw event descriptor]
        kprobe/retprobe/modifier                           [Raw event descriptor]
        msr/event=0..0xffffffffffffffff/modifier           [Raw event descriptor]
        power/event=0..255/modifier                        [Raw event descriptor]
        software//modifier                                 [Raw event descriptor]
        tracepoint//modifier                               [Raw event descriptor]
        uncore_arb/event=0..255,edge,inv,.../modifier      [Raw event descriptor]
        uncore_cbox/event=0..255,edge,inv,.../modifier     [Raw event descriptor]
        uncore_clock/event=0..255/modifier                 [Raw event descriptor]
        uncore_imc_free_running/event=0..255,umask=0..255/modifier[Raw event descriptor]
        uprobe/ref_ctr_offset=0..0xffffffff,retprobe/modifier[Raw event descriptor]
        mem:<addr>[/len][:access]                          [Hardware breakpoint]
      ...
    
    With '--details' provide more details on the formats encoding:
    
      cpu/event=0..255,pc,edge,.../modifier              [Raw event descriptor]
           [(see 'man perf-list' or 'man perf-record' on how to encode it)]
            cpu/event=0..255,pc,edge,offcore_rsp=0..0xffffffffffffffff,ldlat=0..0xffff,inv,
            umask=0..255,frontend=0..0xffffff,cmask=0..255,config=0..0xffffffffffffffff,
            config1=0..0xffffffffffffffff,config2=0..0xffffffffffffffff,config3=0..0xffffffffffffffff,
            name=string,period=number,freq=number,branch_type=(u|k|hv|any|...),time,
            call-graph=(fp|dwarf|lbr),stack-size=number,max-stack=number,nr=number,inherit,no-inherit,
            overwrite,no-overwrite,percore,aux-output,aux-sample-size=number/modifier
      breakpoint//modifier                               [Raw event descriptor]
            breakpoint//modifier
      cstate_core/event=0..0xffffffffffffffff/modifier   [Raw event descriptor]
            cstate_core/event=0..0xffffffffffffffff/modifier
      cstate_pkg/event=0..0xffffffffffffffff/modifier    [Raw event descriptor]
            cstate_pkg/event=0..0xffffffffffffffff/modifier
      i915/i915_eventid=0..0x1fffff/modifier             [Raw event descriptor]
            i915/i915_eventid=0..0x1fffff/modifier
      intel_bts//modifier                                [Raw event descriptor]
            intel_bts//modifier
      intel_pt/ptw,event,cyc_thresh=0..15,.../modifier   [Raw event descriptor]
            intel_pt/ptw,event,cyc_thresh=0..15,pt,notnt,branch,tsc,pwr_evt,fup_on_ptw,cyc,noretcomp,
            mtc,psb_period=0..15,mtc_period=0..15/modifier
      kprobe/retprobe/modifier                           [Raw event descriptor]
            kprobe/retprobe/modifier
      msr/event=0..0xffffffffffffffff/modifier           [Raw event descriptor]
            msr/event=0..0xffffffffffffffff/modifier
      power/event=0..255/modifier                        [Raw event descriptor]
            power/event=0..255/modifier
      software//modifier                                 [Raw event descriptor]
            software//modifier
      tracepoint//modifier                               [Raw event descriptor]
            tracepoint//modifier
      uncore_arb/event=0..255,edge,inv,.../modifier      [Raw event descriptor]
            uncore_arb/event=0..255,edge,inv,umask=0..255,cmask=0..31/modifier
      uncore_cbox/event=0..255,edge,inv,.../modifier     [Raw event descriptor]
            uncore_cbox/event=0..255,edge,inv,umask=0..255,cmask=0..31/modifier
      uncore_clock/event=0..255/modifier                 [Raw event descriptor]
            uncore_clock/event=0..255/modifier
      uncore_imc_free_running/event=0..255,umask=0..255/modifier[Raw event descriptor]
            uncore_imc_free_running/event=0..255,umask=0..255/modifier
      uprobe/ref_ctr_offset=0..0xffffffff,retprobe/modifier[Raw event descriptor]
            uprobe/ref_ctr_offset=0..0xffffffff,retprobe/modifier
    
    Committer notes:
    
    Address this build error in various distros:
    
      55    58.44 ubuntu:24.04                  : FAIL gcc version 13.2.0 (Ubuntu 13.2.0-17ubuntu2)
        util/pmu.c:1638:70: error: '_Static_assert' with no message is a C2x extension [-Werror,-Wc2x-extensions]
         1638 |         _Static_assert(ARRAY_SIZE(terms) == __PARSE_EVENTS__TERM_TYPE_NR - 6);
              |                                                                             ^
              |                                                                             , ""
        1 error generated.
    Signed-off-by: default avatarIan Rogers <irogers@google.com>
    Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    Tested-by: default avatarKan Liang <kan.liang@linux.intel.com>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: James Clark <james.clark@arm.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Ravi Bangoria <ravi.bangoria@amd.com>
    Cc: Yang Jihong <yangjihong1@huawei.com>
    Link: https://lore.kernel.org/r/20240308001915.4060155-5-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    4ccf3bb7
print-events.c 11.4 KB