• James Clark's avatar
    perf cs-etm: Prevent and warn on underflows during timestamp calculation. · c1a6165a
    James Clark authored
    When a zero timestamp is encountered, warn once. This is to make
    hardware or configuration issues visible. Also suggest that the issue
    can be worked around with the --itrace=Z option.
    
    When an underflow with a non-zero timestamp occurs, warn every time.
    This is an unexpected scenario, and with increasing timestamps, it's
    unlikely that it would occur more than once, therefore it should be
    ok to warn every time.
    
    Only try to calculate the timestamp by subtracting the instruction
    count if neither of the above cases are true. This makes attempting
    to decode files with zero timestamps in non-timeless mode
    more consistent. Currently it can half work if the timestamp wraps
    around and becomes non-zero, although the behavior is undefined and
    unpredictable.
    Signed-off-by: default avatarJames Clark <james.clark@arm.com>
    Reviewed-by: default avatarLeo Yan <leo.yan@linaro.org>
    Cc: Al Grant <al.grant@arm.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Anshuman Khandual <anshuman.khandual@arm.com>
    Cc: Branislav Rankov <branislav.rankov@arm.com>
    Cc: Denis Nikitin <denik@chromium.org>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: John Garry <john.garry@huawei.com>
    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: Suzuki Poulouse <suzuki.poulose@arm.com>
    Cc: Will Deacon <will@kernel.org>
    Cc: coresight@lists.linaro.org
    Cc: linux-arm-kernel@lists.infradead.org
    Link: http://lore.kernel.org/lkml/20210517131741.3027-4-james.clark@arm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    c1a6165a
cs-etm-decoder.c 21.8 KB