• Arnaldo Carvalho de Melo's avatar
    tools include UAPI: Sync x86's syscalls_64.tbl, generic unistd.h and fcntl.h... · c4528333
    Arnaldo Carvalho de Melo authored
    tools include UAPI: Sync x86's syscalls_64.tbl, generic unistd.h and fcntl.h to pick up openat2 and pidfd_getfd
    
      fddb5d43 ("open: introduce openat2(2) syscall")
      9a2cef09 ("arch: wire up pidfd_getfd syscall")
    
    We also need to grab a copy of uapi/linux/openat2.h since it is now
    needed by fcntl.h, add it to tools/perf/check_headers.h.
    
      $ diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl
      --- tools/perf/arch/x86/entry/syscalls/syscall_64.tbl	2019-12-20 16:43:57.662429958 -0300
      +++ arch/x86/entry/syscalls/syscall_64.tbl	2020-02-10 16:36:22.070012468 -0300
      @@ -357,6 +357,8 @@
       433	common	fspick			__x64_sys_fspick
       434	common	pidfd_open		__x64_sys_pidfd_open
       435	common	clone3			__x64_sys_clone3/ptregs
      +437	common	openat2			__x64_sys_openat2
      +438	common	pidfd_getfd		__x64_sys_pidfd_getfd
    
       #
       # x32-specific system call numbers start at 512 to avoid cache impact
      $
    
    Update tools/'s copy of that file:
    
      $ cp arch/x86/entry/syscalls/syscall_64.tbl tools/perf/arch/x86/entry/syscalls/syscall_64.tbl
    
    See the result:
    
      $ diff -u /tmp/build/perf/arch/x86/include/generated/asm/syscalls_64.c.before /tmp/build/perf/arch/x86/include/generated/asm/syscalls_64.c
      --- /tmp/build/perf/arch/x86/include/generated/asm/syscalls_64.c.before	2020-02-10 16:42:59.010636041 -0300
      +++ /tmp/build/perf/arch/x86/include/generated/asm/syscalls_64.c	2020-02-10 16:43:24.149958337 -0300
      @@ -346,5 +346,7 @@
       	[433] = "fspick",
       	[434] = "pidfd_open",
       	[435] = "clone3",
      +	[437] = "openat2",
      +	[438] = "pidfd_getfd",
       };
      -#define SYSCALLTBL_x86_64_MAX_ID 435
      +#define SYSCALLTBL_x86_64_MAX_ID 438
      $
    
    Now one can use:
    
      perf trace -e openat2,pidfd_getfd
    
    To get just those syscalls or use in things like:
    
      perf trace -e open*
    
    To get all the open variant (open, openat, openat2, etc) or:
    
      perf trace pidfd*
    
    To get the pidfd syscalls.
    
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Aleksa Sarai <cyphar@cyphar.com>
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Cc: Christian Brauner <christian.brauner@ubuntu.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Sargun Dhillon <sargun@sargun.me>
    Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    c4528333
check-headers.sh 4.02 KB