perf arm-spe: Save context ID in record
authorGerman Gomez <german.gomez@arm.com>
Thu, 11 Nov 2021 13:36:24 +0000 (13:36 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Sat, 13 Nov 2021 21:11:51 +0000 (18:11 -0300)
This patch is to save context ID in record, this will be used to set TID
for samples.

Reviewed-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: German Gomez <german.gomez@arm.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
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: Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lore.kernel.org/r/20211111133625.193568-4-german.gomez@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/arm-spe-decoder/arm-spe-decoder.c
tools/perf/util/arm-spe-decoder/arm-spe-decoder.h

index 32fe418..3fc528c 100644 (file)
@@ -151,6 +151,7 @@ static int arm_spe_read_record(struct arm_spe_decoder *decoder)
        u64 payload, ip;
 
        memset(&decoder->record, 0x0, sizeof(decoder->record));
+       decoder->record.context_id = (u64)-1;
 
        while (1) {
                err = arm_spe_get_next_packet(decoder);
@@ -180,6 +181,7 @@ static int arm_spe_read_record(struct arm_spe_decoder *decoder)
                case ARM_SPE_COUNTER:
                        break;
                case ARM_SPE_CONTEXT:
+                       decoder->record.context_id = payload;
                        break;
                case ARM_SPE_OP_TYPE:
                        if (idx == SPE_OP_PKT_HDR_CLASS_LD_ST_ATOMIC) {
index 59bdb73..46a8556 100644 (file)
@@ -38,6 +38,7 @@ struct arm_spe_record {
        u64 timestamp;
        u64 virt_addr;
        u64 phys_addr;
+       u64 context_id;
 };
 
 struct arm_spe_insn;