perf inject: Add facility to do in place update
authorAdrian Hunter <adrian.hunter@intel.com>
Fri, 30 Apr 2021 07:03:01 +0000 (10:03 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 12 May 2021 15:43:10 +0000 (12:43 -0300)
commit2a525f6a5502bfd80568e6befb84053cf650ad25
tree6b2bdf6fbde7501965a097302c91545deb421bf2
parente9d64739635f8db204c9fc81f20ed70751b4e0dd
perf inject: Add facility to do in place update

When there is a need to modify only timestamps, it is much simpler and
quicker to do it to the existing file rather than re-write all the
contents.

In preparation for that, add the ability to modify the input file in place.
In practice that just means making the file descriptor and mmaps writable.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: https://lore.kernel.org/r/20210430070309.17624-5-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-inject.c
tools/perf/util/data.c
tools/perf/util/data.h
tools/perf/util/header.c
tools/perf/util/session.c