• Jiri Olsa's avatar
    perf tools: Fix event's PMU name parsing · 84ea6036
    Jiri Olsa authored
    Jin Yao reported parser error for software event:
    
      # perf stat -e software/r1a/ -a -- sleep 1
      event syntax error: 'software/r1a/'
                           \___ parser error
    
    This happens after commit 8c3b1ba0 ("drm/i915/gt: Track the
    overall awake/busy time"), where new software-gt-awake-time event's
    non-pmu-event-style makes event parser conflict with software PMU.
    
    If we allow PE_PMU_EVENT_PRE to be parsed as PMU name, we fix the
    conflict and the following character '/' for PMU or '-' for
    non-pmu-event-style event allows parser to decide what even is
    specified.
    
    Fixes: 8c3b1ba0 ("drm/i915/gt: Track the overall awake/busy time")
    Reported-by: default avatarJin Yao <yao.jin@linux.intel.com>
    Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Chris Wilson <chris@chris-wilson.co.uk>
    Cc: Ian Rogers <irogers@google.com>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Michael Petlan <mpetlan@redhat.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Link: http://lore.kernel.org/lkml/20210301122315.63471-1-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    84ea6036
parse-events.y 17.4 KB