• James Clark's avatar
    perf cs-etm: Fix timeless decode mode detection · 449067f3
    James Clark authored
    In this context, timeless refers to the trace data rather than the perf
    event data. But when detecting whether there are timestamps in the trace
    data or not, the presence of a timestamp flag on any perf event is used.
    
    Since commit f42c0ce5 ("perf record: Always get text_poke events
    with --kcore option") timestamps were added to a tracking event when
    --kcore is used which breaks this detection mechanism. Fix it by
    detecting if trace timestamps exist by looking at the ETM config flags.
    This would have always been a more accurate way of doing it anyway.
    
    This fixes the following error message when using --kcore with
    Coresight:
    
      $ perf record --kcore -e cs_etm// --per-thread
      $ perf report
      The perf.data/data data has no samples!
    
    Fixes: f42c0ce5 ("perf record: Always get text_poke events with --kcore option")
    Reported-by: default avatarYang Shi <shy828301@gmail.com>
    Signed-off-by: default avatarJames Clark <james.clark@arm.com>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Ian Rogers <irogers@google.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: John Garry <john.g.garry@oracle.com>
    Cc: Leo Yan <leo.yan@linaro.org>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
    Cc: Mike Leach <mike.leach@linaro.org>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
    Cc: Will Deacon <will@kernel.org>
    Cc: coresight@lists.linaro.org
    Cc: denik@google.com
    Cc: linux-arm-kernel@lists.infradead.org
    Link: https://lore.kernel.org/lkml/CAHbLzkrJQTrYBtPkf=jf3OpQ-yBcJe7XkvQstX9j2frz4WF-SQ@mail.gmail.com/
    Link: https://lore.kernel.org/r/20230424134748.228137-2-james.clark@arm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    449067f3
cs-etm.c 90.7 KB