• Arnaldo Carvalho de Melo's avatar
    perf beauty: Introduce scrape script for various fs syscalls 'flags' arguments · 3d6cfbaf
    Arnaldo Carvalho de Melo authored
    It was using the first variation on producing a string representation
    for a binary flag, one that used the system's fcntl.h and preprocessor
    tricks that had to be updated everytime a new flag was introduced.
    
    Use the more recent scrape script + strarray + strarray__scnprintf_flags() combo.
    
      $ tools/perf/trace/beauty/fs_at_flags.sh
      static const char *fs_at_flags[] = {
      	[ilog2(0x100) + 1] = "SYMLINK_NOFOLLOW",
      	[ilog2(0x200) + 1] = "REMOVEDIR",
      	[ilog2(0x400) + 1] = "SYMLINK_FOLLOW",
      	[ilog2(0x800) + 1] = "NO_AUTOMOUNT",
      	[ilog2(0x1000) + 1] = "EMPTY_PATH",
      	[ilog2(0x0000) + 1] = "STATX_SYNC_AS_STAT",
      	[ilog2(0x2000) + 1] = "STATX_FORCE_SYNC",
      	[ilog2(0x4000) + 1] = "STATX_DONT_SYNC",
      	[ilog2(0x8000) + 1] = "RECURSIVE",
      	[ilog2(0x80000000) + 1] = "GETATTR_NOSEC",
      };
      $
    
    Now we need a copy of uapi/linux/fcntl.h from tools/include/ in the
    scrape only directory tools/perf/trace/beauty/include and will use that
    fs_at_flags array for other fs syscalls.
    Reviewed-by: default avatarIan Rogers <irogers@google.com>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Link: https://lore.kernel.org/lkml/20240320193115.811899-2-acme@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    3d6cfbaf
Build 463 Bytes