tools headers UAPI: Sync asm-generic/mman-common.h with the kernel
authorArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 27 Sep 2019 14:30:30 +0000 (11:30 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 1 Apr 2022 19:19:35 +0000 (16:19 -0300)
commit6d05e1398507fc3509debc397bb9dfa18fc5230e
treebfd6ef8d4d08242ba42050fb82186d0021fc0908
parent9a195da42feca3948d7f1ee8a689e2b9d2406fb5
tools headers UAPI: Sync asm-generic/mman-common.h with the kernel

To pick the changes from:

  9457056ac426e5ed ("mm: madvise: MADV_DONTNEED_LOCKED")

That result in these changes in the tools:

  $ diff -u tools/include/uapi/asm-generic/mman-common.h include/uapi/asm-generic/mman-common.h
  --- tools/include/uapi/asm-generic/mman-common.h 2022-03-29 16:17:50.461694991 -0300
  +++ include/uapi/asm-generic/mman-common.h 2022-03-27 19:12:48.923250468 -0300
  @@ -75,6 +75,8 @@
   #define MADV_POPULATE_READ 22 /* populate (prefault) page tables readable */
   #define MADV_POPULATE_WRITE 23 /* populate (prefault) page tables writable */

  +#define MADV_DONTNEED_LOCKED 24 /* like DONTNEED, but drop locked pages too */
  +
   /* compatibility flags */
   #define MAP_FILE 0

  $ tools/perf/trace/beauty/madvise_behavior.sh > before
  $ cp include/uapi/asm-generic/mman-common.h tools/include/uapi/asm-generic/mman-common.h
  $ tools/perf/trace/beauty/madvise_behavior.sh > after
  $ diff -u before after
  --- before 2022-03-29 16:18:04.091044244 -0300
  +++ after 2022-03-29 16:18:11.692238906 -0300
  @@ -20,6 +20,7 @@
    [21] = "PAGEOUT",
    [22] = "POPULATE_READ",
    [23] = "POPULATE_WRITE",
  + [24] = "DONTNEED_LOCKED",
    [100] = "HWPOISON",
    [101] = "SOFT_OFFLINE",
   };
  $

I.e. now when madvise gets those behaviours as args, 'perf trace' will
be able to translate from the number to a human readable string and to
use the strings in tracepoint filter expressions.

This addresses the following perf build warning:

  Warning: Kernel ABI header at 'tools/include/uapi/asm-generic/mman-common.h' differs from latest version at 'include/uapi/asm-generic/mman-common.h'
  diff -u tools/include/uapi/asm-generic/mman-common.h include/uapi/asm-generic/mman-common.h

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lore.kernel.org/lkml/YkNcUfeh795yqGMV@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/include/uapi/asm-generic/mman-common.h