• J
    perf tools: Fix term parsing for raw syntax · 4929e95a
    Jiri Olsa 提交于
    Jin Yao reported issue with possible conflict between raw events and
    term values in pmu event syntax.
    
    Currently following syntax is resolved as raw event with 0xead value:
    
      uncore_imc_free_running/read/
    
    instead of using 'read' term from uncore_imc_free_running pmu, because
    'read' is correct raw event syntax with 0xead value.
    
    To solve this issue we do following:
    
      - check existing terms during rXXXX syntax processing
        and make them priority in case of conflict
    
      - allow pmu/r0x1234/ syntax to be able to specify conflicting
        raw event (implemented in previous patch)
    
    Also add automated tests for this and perf_pmu__parse_cleanup call to
    parse_events_terms, so the test gets properly cleaned up.
    
    Fixes: 3a6c51e4 ("perf parser: Add support to specify rXXX event with pmu")
    Reported-by: NJin Yao <yao.jin@linux.intel.com>
    Signed-off-by: NJiri Olsa <jolsa@kernel.org>
    Tested-by: NJin Yao <yao.jin@linux.intel.com>
    Acked-by: NIan Rogers <irogers@google.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Andi Kleen <ak@linux.intel.com>
    Cc: Michael Petlan <mpetlan@redhat.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Stephane Eranian <eranian@google.com>
    Cc: Thomas Richter <tmricht@linux.ibm.com>
    Link: http://lore.kernel.org/lkml/20200726075244.1191481-2-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
    4929e95a
parse-events.c 73.6 KB