perf tools: Add perf_event__synthesize_id_sample()
authorAdrian Hunter <adrian.hunter@intel.com>
Mon, 11 Jul 2022 09:31:49 +0000 (12:31 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 20 Jul 2022 14:07:48 +0000 (11:07 -0300)
commit1ee94463e9ac4721cfef27ffcd6f97ab026e3aac
treee253ec2f946911e2630f09aef969e162ab1c3346
parent0a64de04c94ad4285120bed0dfb382ea98d6d499
perf tools: Add perf_event__synthesize_id_sample()

Add perf_event__synthesize_id_sample() to enable the synthesis of
ID samples.

This is needed by perf inject. When injecting events from a guest perf.data
file, there is a possibility that the sample ID numbers conflict. In that
case, perf_event__synthesize_id_sample() can be used to re-write the ID
sample.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: kvm@vger.kernel.org
Link: https://lore.kernel.org/r/20220711093218.10967-7-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/synthetic-events.c
tools/perf/util/synthetic-events.h