perf trace beauty: Add script to autogenerate mremap's flags args string/id table
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 29 Sep 2020 21:07:27 +0000 (18:07 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 29 Sep 2020 21:07:27 +0000 (18:07 -0300)
commit9012e3dda2a70cff7986e08d0a9cf3a8e04691e6
treeaca87c3f2f39eba1a8522c9008cfe34b1d06f631
parentd758d5d474ac5a9eb4e23188261c75bb1393afdf
perf trace beauty: Add script to autogenerate mremap's flags args string/id table

It'll also conditionally generate the defines, so that if we don't have
those when building a new tool tarball in an older systems, we get
those, and we need them sometimes in the actual scnprintf routine, such
as when checking if a flags means we have an extra arg, like with
MREMAP_FIXED.

  $ tools/perf/trace/beauty/mremap_flags.sh
  static const char *mremap_flags[] = {
   [ilog2(1) + 1] = "MAYMOVE",
  #ifndef MREMAP_MAYMOVE
  #define MREMAP_MAYMOVE 1
  #endif
   [ilog2(2) + 1] = "FIXED",
  #ifndef MREMAP_FIXED
  #define MREMAP_FIXED 2
  #endif
   [ilog2(4) + 1] = "DONTUNMAP",
  #ifndef MREMAP_DONTUNMAP
  #define MREMAP_DONTUNMAP 4
  #endif
  };
  $

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Makefile.perf
tools/perf/trace/beauty/mmap.c
tools/perf/trace/beauty/mremap_flags.sh [new file with mode: 0755]