perf event x86: Add retire_lat when synthesizing PERF_SAMPLE_WEIGHT_STRUCT
authorKan Liang <kan.liang@linux.intel.com>
Mon, 6 Feb 2023 16:20:59 +0000 (08:20 -0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 6 Feb 2023 17:56:22 +0000 (14:56 -0300)
In arch_perf_synthesize_sample_weight(), the retire_lat was mistakenly
missed, add it.

  perf test -v "x86 sample parsing"
   74: x86 Sample parsing                                              :
  --- start ---
  test child forked, pid 72526
  Samples differ at 'retire_lat'
  parsing failed for sample_type 0x1000000
  test child finished with -1
  ---- end ----
  x86 Sample parsing: FAILED!

Reported-by: Arnaldo Carvalho de Melo <acme@kernel.org>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: https://lore.kernel.org/r/20230206162100.3329395-1-kan.liang@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/arch/x86/util/event.c

index 37b3feb..e4288d0 100644 (file)
@@ -101,6 +101,7 @@ void arch_perf_synthesize_sample_weight(const struct perf_sample *data,
        if (type & PERF_SAMPLE_WEIGHT_STRUCT) {
                *array &= 0xffffffff;
                *array |= ((u64)data->ins_lat << 32);
+               *array |= ((u64)data->retire_lat << 48);
        }
 }