perf cs-etm: Fix incorrect or missing decoder for raw trace
authorBesar Wicaksono <bwicaksono@nvidia.com>
Tue, 10 Oct 2023 23:48:03 +0000 (18:48 -0500)
committerNamhyung Kim <namhyung@kernel.org>
Thu, 12 Oct 2023 17:01:57 +0000 (10:01 -0700)
commita16afcc58a8c5ebc65c852faf001f8f61f05e4ef
treef4ba15f7dcd149cbceaba9e98af06c4be742a49f
parentb84b3f47921568a8172bec77d0370268e9fc62a2
perf cs-etm: Fix incorrect or missing decoder for raw trace

The decoder creation for raw trace uses metadata from the first CPU.
On per-cpu mode, this metadata is incorrectly used for every decoder.
On per-process/per-thread traces, the first CPU is CPU0. If CPU0 trace
is not enabled, its metadata will be marked unused and the decoder is
not created. Perf report dump skips the decoding part because the
decoder is missing.

To fix this, use metadata of the CPU associated with sample object.

Signed-off-by: Besar Wicaksono <bwicaksono@nvidia.com>
Reviewed-by: James Clark <james.clark@arm.com>
Cc: suzuki.poulose@arm.com
Cc: mike.leach@linaro.org
Cc: jonathanh@nvidia.com
Cc: rwiley@nvidia.com
Cc: treding@nvidia.com
Cc: vsethi@nvidia.com
Cc: ywan@nvidia.com
Cc: linux-arm-kernel@lists.infradead.org
Cc: coresight@lists.linaro.org
Cc: linux-tegra@vger.kernel.org
Link: https://lore.kernel.org/r/20231010234803.5419-1-bwicaksono@nvidia.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/util/cs-etm.c