linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] System call table generation support
@ 2018-08-09  5:36 Firoz Khan
  2018-08-09  5:36 ` [PATCH 1/3] sh: Rename NR_syscalls macro to __NR_syscalls Firoz Khan
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Firoz Khan @ 2018-08-09  5:36 UTC (permalink / raw)
  To: linux-sh, Yoshinori Sato, Rich Felker, Steven Rostedt,
	Ingo Molnar, Greg Kroah-Hartman, Philippe Ombredanne,
	Thomas Gleixner, Kate Stewart
  Cc: y2038, linux-kernel, linux-arch, arnd, deepa.kernel,
	marcin.juszkiewicz, firoz.khan

The purpose of this patch series is:
1. We can easily add/modify/delete system call by changing entry 
in syscall.tbl file. No need to manually edit many files.

2. It is easy to unify the system call implementation across all 
the architectures. 

The system call tables are in different format in all architecture 
and it will be difficult to manually add or modify the system calls
manually in the respective files. To make it easy by keeping a script 
and which'll generate the header file and syscall table file so this 
change will unify the implementation across all architectures.

syscall.tbl contains the list of available system calls along with 
system call number and corresponding entry point. Add a new system 
call in this architecture will be possible by adding new entry in 
the syscall.tbl file.

Adding a new table entry consisting of:
        - System call number.
        - ABI.
        - System call name.
        - Entry point name.

Important thing to note, I have added this support only for 32-bit
ABI. It seems like no one using 64-bit ABI for long time. But it is
very easy to add the support for64-bit. Please let me know if any-
one need this support:)

ARM, s390 and x86 architecuture does exist the similar support. I 
leverage their implementation to come up with a generic solution.

I have done the same support for work for alpha, m68k, microblaze, 
ia64, mips, parisc, powerpc, sparc, and xtensa. But I started sending 
the patch for one architecuture for review. Below mentioned git
repository contains more details.
Git repo:- https://github.com/frzkhn/system_call_table_generator/

Finally, this is the ground work for solving the Y2038 issue. We 
need to add/change two dozen of system calls to solve Y2038 issue. 
So this patch series will help to easily modify from existing 
system call to Y2038 compatible system calls.

I started working system call table generation on 4.17-rc1. I used 
marcin's script - https://github.com/hrw/syscalls-table to generate 
the syscall.tbl file. And this will be the input to the system call 
table generation script. But there are couple system call got add 
in the latest rc release. If run Marcin's script on latest release,
it will generate a different syscall.tbl. But I still use the old 
file - syscall.tbl and once all review got over I'll update 
syscall.tbl alone w.r.to the tip of the kernel. The impact of this
is, few of the system call won't work.

Firoz Khan (3):
  sh: Rename NR_syscalls macro to __NR_syscalls
  sh: Added system call table generation support
  sh: uapi header and system call table file generation

 arch/sh/Makefile                      |   3 +
 arch/sh/include/asm/Kbuild            |   2 +
 arch/sh/include/asm/ftrace.h          |   2 +-
 arch/sh/include/uapi/asm/Kbuild       |   2 +
 arch/sh/include/uapi/asm/unistd_32.h  |   2 +-
 arch/sh/include/uapi/asm/unistd_64.h  |   2 +-
 arch/sh/kernel/Makefile               |   2 +-
 arch/sh/kernel/cpu/sh5/entry.S        |   2 +-
 arch/sh/kernel/entry-common.S         |   2 +-
 arch/sh/kernel/syscall.S              |   9 +
 arch/sh/kernel/syscalls/Makefile      |  37 ++++
 arch/sh/kernel/syscalls/syscall.tbl   | 388 ++++++++++++++++++++++++++++++++
 arch/sh/kernel/syscalls/syscallhdr.sh |  33 +++
 arch/sh/kernel/syscalls/syscalltbl.sh |  28 +++
 arch/sh/kernel/syscalls_32.S          | 402 ----------------------------------
 15 files changed, 508 insertions(+), 408 deletions(-)
 create mode 100644 arch/sh/kernel/syscall.S
 create mode 100644 arch/sh/kernel/syscalls/Makefile
 create mode 100644 arch/sh/kernel/syscalls/syscall.tbl
 create mode 100644 arch/sh/kernel/syscalls/syscallhdr.sh
 create mode 100644 arch/sh/kernel/syscalls/syscalltbl.sh
 delete mode 100644 arch/sh/kernel/syscalls_32.S

-- 
1.9.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/3] sh: Rename NR_syscalls macro to __NR_syscalls
  2018-08-09  5:36 [PATCH 0/3] System call table generation support Firoz Khan
@ 2018-08-09  5:36 ` Firoz Khan
  2018-08-09 12:58   ` kbuild test robot
  2018-08-09  5:36 ` [PATCH 2/3] sh: Added system call table generation support Firoz Khan
  2018-08-09  5:36 ` [PATCH 3/3] sh: uapi header and system call table file generation Firoz Khan
  2 siblings, 1 reply; 7+ messages in thread
From: Firoz Khan @ 2018-08-09  5:36 UTC (permalink / raw)
  To: linux-sh, Yoshinori Sato, Rich Felker, Steven Rostedt,
	Ingo Molnar, Greg Kroah-Hartman, Philippe Ombredanne,
	Thomas Gleixner, Kate Stewart
  Cc: y2038, linux-kernel, linux-arch, arnd, deepa.kernel,
	marcin.juszkiewicz, firoz.khan

NR_syscalls macro holds the number of system call exist in SH arch-
itecture. One of the patch in this patch series has a script which
will generate a uapi header based on syscall.tbl file. The syscall.tbl
file contains the total number of system call information, which will
be used to update NR_syscalls.

The macro name also changed form NR_syscalls to __NR_syscalls for
making the name convention same across all architecture. While
__NR_syscalls isn't strictly part of the uapi, having it as part of
the generated header to simplifies the implementation.

Signed-off-by: Firoz Khan <firoz.khan@linaro.org>
---
 arch/sh/include/asm/ftrace.h         | 2 +-
 arch/sh/include/uapi/asm/unistd_32.h | 2 +-
 arch/sh/include/uapi/asm/unistd_64.h | 2 +-
 arch/sh/kernel/cpu/sh5/entry.S       | 2 +-
 arch/sh/kernel/entry-common.S        | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/sh/include/asm/ftrace.h b/arch/sh/include/asm/ftrace.h
index b1c1dc0..968a9bb 100644
--- a/arch/sh/include/asm/ftrace.h
+++ b/arch/sh/include/asm/ftrace.h
@@ -5,7 +5,7 @@
 #ifdef CONFIG_FUNCTION_TRACER
 
 #define MCOUNT_INSN_SIZE	4 /* sizeof mcount call */
-#define FTRACE_SYSCALL_MAX	NR_syscalls
+#define FTRACE_SYSCALL_MAX	__NR_syscalls
 
 #ifndef __ASSEMBLY__
 extern void mcount(void);
diff --git a/arch/sh/include/uapi/asm/unistd_32.h b/arch/sh/include/uapi/asm/unistd_32.h
index 58f04cf..2c4f087 100644
--- a/arch/sh/include/uapi/asm/unistd_32.h
+++ b/arch/sh/include/uapi/asm/unistd_32.h
@@ -396,6 +396,6 @@
 #define __NR_preadv2		381
 #define __NR_pwritev2		382
 
-#define NR_syscalls 383
+#define __NR_syscalls 383
 
 #endif /* __ASM_SH_UNISTD_32_H */
diff --git a/arch/sh/include/uapi/asm/unistd_64.h b/arch/sh/include/uapi/asm/unistd_64.h
index 6f809a5..9e6e8cb 100644
--- a/arch/sh/include/uapi/asm/unistd_64.h
+++ b/arch/sh/include/uapi/asm/unistd_64.h
@@ -416,6 +416,6 @@
 #define __NR_preadv2		392
 #define __NR_pwritev2		393
 
-#define NR_syscalls 394
+#define __NR_syscalls 394
 
 #endif /* __ASM_SH_UNISTD_64_H */
diff --git a/arch/sh/kernel/cpu/sh5/entry.S b/arch/sh/kernel/cpu/sh5/entry.S
index 0c8d037..d2ff022 100644
--- a/arch/sh/kernel/cpu/sh5/entry.S
+++ b/arch/sh/kernel/cpu/sh5/entry.S
@@ -1192,7 +1192,7 @@ system_call:
 	STI()
 
 	pta	syscall_allowed, tr0
-	movi	NR_syscalls - 1, r4	/* Last valid */
+	movi	__NR_syscalls - 1, r4	/* Last valid */
 	bgeu/l	r4, r5, tr0
 
 syscall_bad:
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S
index 28cc612..80ea3c4 100644
--- a/arch/sh/kernel/entry-common.S
+++ b/arch/sh/kernel/entry-common.S
@@ -396,7 +396,7 @@ syscall_exit:
 #if !defined(CONFIG_CPU_SH2)
 1:	.long	TRA
 #endif
-2:	.long	NR_syscalls
+2:	.long	__NR_syscalls
 3:	.long	sys_call_table
 7:	.long	do_syscall_trace_enter
 8:	.long	do_syscall_trace_leave
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/3] sh: Added system call table generation support
  2018-08-09  5:36 [PATCH 0/3] System call table generation support Firoz Khan
  2018-08-09  5:36 ` [PATCH 1/3] sh: Rename NR_syscalls macro to __NR_syscalls Firoz Khan
@ 2018-08-09  5:36 ` Firoz Khan
  2018-08-09  5:36 ` [PATCH 3/3] sh: uapi header and system call table file generation Firoz Khan
  2 siblings, 0 replies; 7+ messages in thread
From: Firoz Khan @ 2018-08-09  5:36 UTC (permalink / raw)
  To: linux-sh, Yoshinori Sato, Rich Felker, Steven Rostedt,
	Ingo Molnar, Greg Kroah-Hartman, Philippe Ombredanne,
	Thomas Gleixner, Kate Stewart
  Cc: y2038, linux-kernel, linux-arch, arnd, deepa.kernel,
	marcin.juszkiewicz, firoz.khan

The system call tables are in different format in all
architecture and it will be difficult to manually add or
modify the system calls in the respective files. To make
it easy by keeping a script and which'll generate the
header file and syscall table file so this change will
unify them across all architectures.

The system call table generation script is added in
syscalls directory which contain the script to generate
both uapi header file system call table generation file
and syscall.tbl file which'll be the input for the scripts.

syscall.tbl contains the list of available system calls
along with system call number and corresponding entry point.
Add a new system call in this architecture will be possible
by adding new entry in the syscall.tbl file.

Adding a new table entry consisting of:
        - System call number.
        - ABI.
        - System call name.
        - Entry point name.

syscallhdr.sh and syscalltbl.sh will generate uapi header-
unistd.h and syscall_table.h files respectively. File
syscall_table.h is included by syscall.S - the real system
call table. Both .sh files will parse the content syscall.tbl
to generate the header and table files.

ARM, s390 and x86 architecuture does have the similar support.
I leverage their implementation to come up with a generic
solution. And this is the ground work for y2038 issue. We need
to change 52 system call implementation and this work will
reduce the effort by simply modify 52 entries in syscall.tbl.

Signed-off-by: Firoz Khan <firoz.khan@linaro.org>
---
 arch/sh/kernel/syscalls/Makefile      |  37 ++++
 arch/sh/kernel/syscalls/syscall.tbl   | 388 ++++++++++++++++++++++++++++++++++
 arch/sh/kernel/syscalls/syscallhdr.sh |  33 +++
 arch/sh/kernel/syscalls/syscalltbl.sh |  28 +++
 4 files changed, 486 insertions(+)
 create mode 100644 arch/sh/kernel/syscalls/Makefile
 create mode 100644 arch/sh/kernel/syscalls/syscall.tbl
 create mode 100644 arch/sh/kernel/syscalls/syscallhdr.sh
 create mode 100644 arch/sh/kernel/syscalls/syscalltbl.sh

diff --git a/arch/sh/kernel/syscalls/Makefile b/arch/sh/kernel/syscalls/Makefile
new file mode 100644
index 0000000..7624044
--- /dev/null
+++ b/arch/sh/kernel/syscalls/Makefile
@@ -0,0 +1,37 @@
+# SPDX-License-Identifier: GPL-2.0
+out := arch/$(SRCARCH)/include/generated/asm
+uapi := arch/$(SRCARCH)/include/generated/uapi/asm
+
+_dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \
+	  $(shell [ -d '$(out)' ] || mkdir -p '$(out)')
+
+syscall := $(srctree)/$(src)/syscall.tbl
+
+syshdr := $(srctree)/$(src)/syscallhdr.sh
+systbl := $(srctree)/$(src)/syscalltbl.sh
+
+quiet_cmd_syshdr = SYSHDR  $@
+      cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@'  \
+		   '$(syshdr_abi_$(basetarget))'          \
+		   '$(syshdr_pfx_$(basetarget))'          \
+		   '$(syshdr_offset_$(basetarget))'
+
+quiet_cmd_systbl = SYSTBL  $@
+      cmd_systbl = $(CONFIG_SHELL) '$(systbl)' '$<' '$@'  \
+		   '$(systbl_abi_$(basetarget))'
+
+$(uapi)/unistd_32.h: $(syscall) $(syshdr)
+	$(call if_changed,syshdr)
+
+$(out)/syscall_table.h: $(syscall) $(systbl)
+	$(call if_changed,systbl)
+
+uapisyshdr-y			+= unistd_32.h
+syshdr-y			+= syscall_table.h
+
+targets	+= $(uapisyshdr-y) $(syshdr-y)
+
+PHONY += all
+all: $(addprefix $(uapi)/,$(uapisyshdr-y))
+all: $(addprefix $(out)/,$(syshdr-y))
+	@:
diff --git a/arch/sh/kernel/syscalls/syscall.tbl b/arch/sh/kernel/syscalls/syscall.tbl
new file mode 100644
index 0000000..8fe5187
--- /dev/null
+++ b/arch/sh/kernel/syscalls/syscall.tbl
@@ -0,0 +1,388 @@
+#
+# Linux system call numbers and entry vectors
+#
+# The format is:
+# <number> <abi> <name> <entry point>
+#
+# The abi is always "common" for this file.
+#
+0       common  restart_syscall                 sys_restart_syscall
+1       common  exit                            sys_exit
+2       common  fork                            sys_fork
+3       common  read                            sys_read
+4       common  write                           sys_write
+5       common  open                            sys_open
+6       common  close                           sys_close
+7       common  waitpid                         sys_waitpid
+8       common  creat                           sys_creat
+9       common  link                            sys_link
+10      common  unlink                          sys_unlink
+11      common  execve                          sys_execve
+12      common  chdir                           sys_chdir
+13      common  time                            sys_time
+14      common  mknod                           sys_mknod
+15      common  chmod                           sys_chmod
+16      common  lchown                          sys_lchown16
+17      common  break                           sys_ni_syscall
+18      common  oldstat                         sys_stat
+19      common  lseek                           sys_lseek
+20      common  getpid                          sys_getpid
+21      common  mount                           sys_mount
+22      common  umount                          sys_oldumount
+23      common  setuid                          sys_setuid16
+24      common  getuid                          sys_getuid16
+25      common  stime                           sys_stime
+26      common  ptrace                          sys_ptrace
+27      common  alarm                           sys_alarm
+28      common  oldfstat                        sys_fstat
+29      common  pause                           sys_pause
+30      common  utime                           sys_utime
+31      common  stty                            sys_ni_syscall
+32      common  gtty                            sys_ni_syscall
+33      common  access                          sys_access
+34      common  nice                            sys_nice
+35      common  ftime                           sys_ni_syscall
+36      common  sync                            sys_sync
+37      common  kill                            sys_kill
+38      common  rename                          sys_rename
+39      common  mkdir                           sys_mkdir
+40      common  rmdir                           sys_rmdir
+41      common  dup                             sys_dup
+42      common  pipe                            sys_sh_pipe
+43      common  times                           sys_times
+44      common  prof                            sys_ni_syscall
+45      common  brk                             sys_brk
+46      common  setgid                          sys_setgid16
+47      common  getgid                          sys_getgid16
+48      common  signal                          sys_signal
+49      common  geteuid                         sys_geteuid16
+50      common  getegid                         sys_getegid16
+51      common  acct                            sys_acct
+52      common  umount2                         sys_umount
+53      common  lock                            sys_ni_syscall
+54      common  ioctl                           sys_ioctl
+55      common  fcntl                           sys_fcntl
+56      common  mpx                             sys_ni_syscall
+57      common  setpgid                         sys_setpgid
+58      common  ulimit                          sys_ni_syscall
+59      common  oldolduname                     sys_ni_syscall
+60      common  umask                           sys_umask
+61      common  chroot                          sys_chroot
+62      common  ustat                           sys_ustat
+63      common  dup2                            sys_dup2
+64      common  getppid                         sys_getppid
+65      common  getpgrp                         sys_getpgrp
+66      common  setsid                          sys_setsid
+67      common  sigaction                       sys_sigaction
+68      common  sgetmask                        sys_sgetmask
+69      common  ssetmask                        sys_ssetmask
+70      common  setreuid                        sys_setreuid16
+71      common  setregid                        sys_setregid16
+72      common  sigsuspend                      sys_sigsuspend
+73      common  sigpending                      sys_sigpending
+74      common  sethostname                     sys_sethostname
+75      common  setrlimit                       sys_setrlimit
+76      common  getrlimit                       sys_old_getrlimit
+77      common  getrusage                       sys_getrusage
+78      common  gettimeofday                    sys_gettimeofday
+79      common  settimeofday                    sys_settimeofday
+80      common  getgroups                       sys_getgroups16
+81      common  setgroups                       sys_setgroups16
+82      common  select                          sys_ni_syscall
+83      common  symlink                         sys_symlink
+84      common  oldlstat                        sys_lstat
+85      common  readlink                        sys_readlink
+86      common  uselib                          sys_uselib
+87      common  swapon                          sys_swapon
+88      common  reboot                          sys_reboot
+89      common  readdir                         sys_old_readdir
+90      common  mmap                            old_mmap
+91      common  munmap                          sys_munmap
+92      common  truncate                        sys_truncate
+93      common  ftruncate                       sys_ftruncate
+94      common  fchmod                          sys_fchmod
+95      common  fchown                          sys_fchown16
+96      common  getpriority                     sys_getpriority
+97      common  setpriority                     sys_setpriority
+98      common  profil                          sys_ni_syscall
+99      common  statfs                          sys_statfs
+100     common  fstatfs                         sys_fstatfs
+101     common  ioperm                          sys_ni_syscall
+102     common  socketcall                      sys_socketcall
+103     common  syslog                          sys_syslog
+104     common  setitimer                       sys_setitimer
+105     common  getitimer                       sys_getitimer
+106     common  stat                            sys_newstat
+107     common  lstat                           sys_newlstat
+108     common  fstat                           sys_newfstat
+109     common  olduname                        sys_uname
+110     common  iopl                            sys_ni_syscall
+111     common  vhangup                         sys_vhangup
+112     common  idle                            sys_ni_syscall
+113     common  vm86old                         sys_ni_syscall
+114     common  wait4                           sys_wait4
+115     common  swapoff                         sys_swapoff
+116     common  sysinfo                         sys_sysinfo
+117     common  ipc                             sys_ipc
+118     common  fsync                           sys_fsync
+119     common  sigreturn                       sys_sigreturn
+120     common  clone                           sys_clone
+121     common  setdomainname                   sys_setdomainname
+122     common  uname                           sys_newuname
+123     common  cacheflush                      sys_cacheflush
+124     common  adjtimex                        sys_adjtimex
+125     common  mprotect                        sys_mprotect
+126     common  sigprocmask                     sys_sigprocmask
+127     common  create_module                   sys_ni_syscall
+128     common  init_module                     sys_init_module
+129     common  delete_module                   sys_delete_module
+130     common  get_kernel_syms                 sys_ni_syscall
+131     common  quotactl                        sys_quotactl
+132     common  getpgid                         sys_getpgid
+133     common  fchdir                          sys_fchdir
+134     common  bdflush                         sys_bdflush
+135     common  sysfs                           sys_sysfs
+136     common  personality                     sys_personality
+137     common  afs_syscall                     sys_ni_syscall
+138     common  setfsuid                        sys_setfsuid16
+139     common  setfsgid                        sys_setfsgid16
+140     common  _llseek                         sys_llseek
+141     common  getdents                        sys_getdents
+142     common  _newselect                      sys_select
+143     common  flock                           sys_flock
+144     common  msync                           sys_msync
+145     common  readv                           sys_readv
+146     common  writev                          sys_writev
+147     common  getsid                          sys_getsid
+148     common  fdatasync                       sys_fdatasync
+149     common  _sysctl                         sys_sysctl
+150     common  mlock                           sys_mlock
+151     common  munlock                         sys_munlock
+152     common  mlockall                        sys_mlockall
+153     common  munlockall                      sys_munlockall
+154     common  sched_setparam                  sys_sched_setparam
+155     common  sched_getparam                  sys_sched_getparam
+156     common  sched_setscheduler              sys_sched_setscheduler
+157     common  sched_getscheduler              sys_sched_getscheduler
+158     common  sched_yield                     sys_sched_yield
+159     common  sched_get_priority_max          sys_sched_get_priority_max
+160     common  sched_get_priority_min          sys_sched_get_priority_min
+161     common  sched_rr_get_interval           sys_sched_rr_get_interval
+162     common  nanosleep                       sys_nanosleep
+163     common  mremap                          sys_mremap
+164     common  setresuid                       sys_setresuid16
+165     common  getresuid                       sys_getresuid16
+166     common  vm86                            sys_ni_syscall
+167     common  query_module                    sys_ni_syscall
+168     common  poll                            sys_poll
+169     common  nfsservctl                      sys_ni_syscall
+170     common  setresgid                       sys_setresgid16
+171     common  getresgid                       sys_getresgid16
+172     common  prctl                           sys_prctl
+173     common  rt_sigreturn                    sys_rt_sigreturn
+174     common  rt_sigaction                    sys_rt_sigaction
+175     common  rt_sigprocmask                  sys_rt_sigprocmask
+176     common  rt_sigpending                   sys_rt_sigpending
+177     common  rt_sigtimedwait                 sys_rt_sigtimedwait
+178     common  rt_sigqueueinfo                 sys_rt_sigqueueinfo
+179     common  rt_sigsuspend                   sys_rt_sigsuspend
+180     common  pread64                         sys_pread_wrapper
+181     common  pwrite64                        sys_pwrite_wrapper
+182     common  chown                           sys_chown16
+183     common  getcwd                          sys_getcwd
+184     common  capget                          sys_capget
+185     common  capset                          sys_capset
+186     common  sigaltstack                     sys_sigaltstack
+187     common  sendfile                        sys_sendfile
+188     common  getpmsg                         sys_ni_syscall
+189     common  putpmsg                         sys_ni_syscall
+190     common  vfork                           sys_vfork
+191     common  ugetrlimit                      sys_getrlimit
+192     common  mmap2                           sys_mmap2
+193     common  truncate64                      sys_truncate64
+194     common  ftruncate64                     sys_ftruncate64
+195     common  stat64                          sys_stat64
+196     common  lstat64                         sys_lstat64
+197     common  fstat64                         sys_fstat64
+198     common  lchown32                        sys_lchown
+199     common  getuid32                        sys_getuid
+200     common  getgid32                        sys_getgid
+201     common  geteuid32                       sys_geteuid
+202     common  getegid32                       sys_getegid
+203     common  setreuid32                      sys_setreuid
+204     common  setregid32                      sys_setregid
+205     common  getgroups32                     sys_getgroups
+206     common  setgroups32                     sys_setgroups
+207     common  fchown32                        sys_fchown
+208     common  setresuid32                     sys_setresuid
+209     common  getresuid32                     sys_getresuid
+210     common  setresgid32                     sys_setresgid
+211     common  getresgid32                     sys_getresgid
+212     common  chown32                         sys_chown
+213     common  setuid32                        sys_setuid
+214     common  setgid32                        sys_setgid
+215     common  setfsuid32                      sys_setfsuid
+216     common  setfsgid32                      sys_setfsgid
+217     common  pivot_root                      sys_pivot_root
+218     common  mincore                         sys_mincore
+219     common  madvise                         sys_madvise
+220     common  getdents64                      sys_getdents64
+221     common  fcntl64                         sys_fcntl64
+222     common  tux                             sys_ni_syscall
+224     common  gettid                          sys_gettid
+225     common  readahead                       sys_readahead
+226     common  setxattr                        sys_setxattr
+227     common  lsetxattr                       sys_lsetxattr
+228     common  fsetxattr                       sys_fsetxattr
+229     common  getxattr                        sys_getxattr
+230     common  lgetxattr                       sys_lgetxattr
+231     common  fgetxattr                       sys_fgetxattr
+232     common  listxattr                       sys_listxattr
+233     common  llistxattr                      sys_llistxattr
+234     common  flistxattr                      sys_flistxattr
+235     common  removexattr                     sys_removexattr
+236     common  lremovexattr                    sys_lremovexattr
+237     common  fremovexattr                    sys_fremovexattr
+238     common  tkill                           sys_tkill
+239     common  sendfile64                      sys_sendfile64
+240     common  futex                           sys_futex
+241     common  sched_setaffinity               sys_sched_setaffinity
+242     common  sched_getaffinity               sys_sched_getaffinity
+243     common  set_thread_area                 sys_ni_syscall
+244     common  get_thread_area                 sys_ni_syscall
+245     common  io_setup                        sys_io_setup
+246     common  io_destroy                      sys_io_destroy
+247     common  io_getevents                    sys_io_getevents
+248     common  io_submit                       sys_io_submit
+249     common  io_cancel                       sys_io_cancel
+250     common  fadvise64                       sys_fadvise64
+252     common  exit_group                      sys_exit_group
+253     common  lookup_dcookie                  sys_lookup_dcookie
+254     common  epoll_create                    sys_epoll_create
+255     common  epoll_ctl                       sys_epoll_ctl
+256     common  epoll_wait                      sys_epoll_wait
+257     common  remap_file_pages                sys_remap_file_pages
+258     common  set_tid_address                 sys_set_tid_address
+259     common  timer_create                    sys_timer_create
+260     common  timer_settime                   sys_timer_settime
+261     common  timer_gettime                   sys_timer_gettime
+262     common  timer_getoverrun                sys_timer_getoverrun
+263     common  timer_delete                    sys_timer_delete
+264     common  clock_settime                   sys_clock_settime
+265     common  clock_gettime                   sys_clock_gettime
+266     common  clock_getres                    sys_clock_getres
+267     common  clock_nanosleep                 sys_clock_nanosleep
+268     common  statfs64                        sys_statfs64
+269     common  fstatfs64                       sys_fstatfs64
+270     common  tgkill                          sys_tgkill
+271     common  utimes                          sys_utimes
+272     common  fadvise64_64                    sys_fadvise64_64_wrapper
+273     common  vserver                         sys_ni_syscall
+274     common  mbind                           sys_mbind
+275     common  get_mempolicy                   sys_get_mempolicy
+276     common  set_mempolicy                   sys_set_mempolicy
+277     common  mq_open                         sys_mq_open
+278     common  mq_unlink                       sys_mq_unlink
+279     common  mq_timedsend                    sys_mq_timedsend
+280     common  mq_timedreceive                 sys_mq_timedreceive
+281     common  mq_notify                       sys_mq_notify
+282     common  mq_getsetattr                   sys_mq_getsetattr
+283     common  kexec_load                      sys_kexec_load
+284     common  waitid                          sys_waitid
+285     common  add_key                         sys_add_key
+286     common  request_key                     sys_request_key
+287     common  keyctl                          sys_keyctl
+288     common  ioprio_set                      sys_ioprio_set
+289     common  ioprio_get                      sys_ioprio_get
+290     common  inotify_init                    sys_inotify_init
+291     common  inotify_add_watch               sys_inotify_add_watch
+292     common  inotify_rm_watch                sys_inotify_rm_watch
+294     common  migrate_pages                   sys_migrate_pages
+295     common  openat                          sys_openat
+296     common  mkdirat                         sys_mkdirat
+297     common  mknodat                         sys_mknodat
+298     common  fchownat                        sys_fchownat
+299     common  futimesat                       sys_futimesat
+300     common  fstatat64                       sys_fstatat64
+301     common  unlinkat                        sys_unlinkat
+302     common  renameat                        sys_renameat
+303     common  linkat                          sys_linkat
+304     common  symlinkat                       sys_symlinkat
+305     common  readlinkat                      sys_readlinkat
+306     common  fchmodat                        sys_fchmodat
+307     common  faccessat                       sys_faccessat
+308     common  pselect6                        sys_pselect6
+309     common  ppoll                           sys_ppoll
+310     common  unshare                         sys_unshare
+311     common  set_robust_list                 sys_set_robust_list
+312     common  get_robust_list                 sys_get_robust_list
+313     common  splice                          sys_splice
+314     common  sync_file_range                 sys_sync_file_range
+315     common  tee                             sys_tee
+316     common  vmsplice                        sys_vmsplice
+317     common  move_pages                      sys_move_pages
+318     common  getcpu                          sys_getcpu
+319     common  epoll_pwait                     sys_epoll_pwait
+320     common  utimensat                       sys_utimensat
+321     common  signalfd                        sys_signalfd
+322     common  timerfd_create                  sys_timerfd_create
+323     common  eventfd                         sys_eventfd
+324     common  fallocate                       sys_fallocate
+325     common  timerfd_settime                 sys_timerfd_settime
+326     common  timerfd_gettime                 sys_timerfd_gettime
+327     common  signalfd4                       sys_signalfd4
+328     common  eventfd2                        sys_eventfd2
+329     common  epoll_create1                   sys_epoll_create1
+330     common  dup3                            sys_dup3
+331     common  pipe2                           sys_pipe2
+332     common  inotify_init1                   sys_inotify_init1
+333     common  preadv                          sys_preadv
+334     common  pwritev                         sys_pwritev
+335     common  rt_tgsigqueueinfo               sys_rt_tgsigqueueinfo
+336     common  perf_event_open                 sys_perf_event_open
+337     common  fanotify_init                   sys_fanotify_init
+338     common  fanotify_mark                   sys_fanotify_mark
+339     common  prlimit64                       sys_prlimit64
+340     common  socket                          sys_socket
+341     common  bind                            sys_bind
+342     common  connect                         sys_connect
+343     common  listen                          sys_listen
+344     common  accept                          sys_accept
+345     common  getsockname                     sys_getsockname
+346     common  getpeername                     sys_getpeername
+347     common  socketpair                      sys_socketpair
+348     common  send                            sys_send
+349     common  sendto                          sys_sendto
+350     common  recv                            sys_recv
+351     common  recvfrom                        sys_recvfrom
+352     common  shutdown                        sys_shutdown
+353     common  setsockopt                      sys_setsockopt
+354     common  getsockopt                      sys_getsockopt
+355     common  sendmsg                         sys_sendmsg
+356     common  recvmsg                         sys_recvmsg
+357     common  recvmmsg                        sys_recvmmsg
+358     common  accept4                         sys_accept4
+359     common  name_to_handle_at               sys_name_to_handle_at
+360     common  open_by_handle_at               sys_open_by_handle_at
+361     common  clock_adjtime                   sys_clock_adjtime
+362     common  syncfs                          sys_syncfs
+363     common  sendmmsg                        sys_sendmmsg
+364     common  setns                           sys_setns
+365     common  process_vm_readv                sys_process_vm_readv
+366     common  process_vm_writev               sys_process_vm_writev
+367     common  kcmp                            sys_kcmp
+368     common  finit_module                    sys_finit_module
+369     common  sched_getattr                   sys_sched_getattr
+370     common  sched_setattr                   sys_sched_setattr
+371     common  renameat2                       sys_renameat2
+372     common  seccomp                         sys_seccomp
+373     common  getrandom                       sys_getrandom
+374     common  memfd_create                    sys_memfd_create
+375     common  bpf                             sys_bpf
+376     common  execveat                        sys_execveat
+377     common  userfaultfd                     sys_userfaultfd
+378     common  membarrier                      sys_membarrier
+379     common  mlock2                          sys_mlock2
+380     common  copy_file_range                 sys_copy_file_range
+381     common  preadv2                         sys_preadv2
+382     common  pwritev2                        sys_pwritev2
diff --git a/arch/sh/kernel/syscalls/syscallhdr.sh b/arch/sh/kernel/syscalls/syscallhdr.sh
new file mode 100644
index 0000000..1b99fff
--- /dev/null
+++ b/arch/sh/kernel/syscalls/syscallhdr.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
+
+in="$1"
+out="$2"
+my_abis=`echo "($3)" | tr ',' '|'`
+prefix="$4"
+offset="$5"
+
+fileguard=__ASM_SH_`basename "$out" | sed \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
+    -e 's/[^A-Z0-9_]/_/g' -e 's/__/_/g'`
+grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
+    echo "#ifndef ${fileguard}"
+    echo "#define ${fileguard}"
+    echo ""
+
+    nxt=0
+    while read nr abi name entry ; do
+	if [ -z "$offset" ]; then
+	    echo -e "#define __NR_${prefix}${name}\t$nr"
+	else
+	    echo -e "#define __NR_${prefix}${name}\t($offset + $nr)"
+	fi
+	nxt=$nr
+	let nxt=nxt+1
+    done
+    
+    echo ""
+    echo -e "#define __NR_syscalls\t$nxt"
+    echo ""
+    echo "#endif /* ${fileguard} */"
+) > "$out"
diff --git a/arch/sh/kernel/syscalls/syscalltbl.sh b/arch/sh/kernel/syscalls/syscalltbl.sh
new file mode 100644
index 0000000..04d4e4e
--- /dev/null
+++ b/arch/sh/kernel/syscalls/syscalltbl.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
+
+in="$1"
+out="$2"
+my_abi="$3"
+
+emit() {
+    nxt="$1"
+    nr="$2"
+    entry="$3"
+
+    while [ $nxt -lt $nr ]; do
+	echo "__SYSCALL($nxt, sys_ni_syscall, )"
+	let nxt=nxt+1
+    done
+    
+    echo "__SYSCALL($nr, $entry, )"
+}
+
+grep '^[0-9]' "$in" | sort -n | (
+    nxt=0
+    while read nr abi name entry ; do
+	emit $nxt $nr $entry
+	nxt=$nr
+        let nxt=nxt+1
+    done
+) > "$out"
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/3] sh: uapi header and system call table file generation
  2018-08-09  5:36 [PATCH 0/3] System call table generation support Firoz Khan
  2018-08-09  5:36 ` [PATCH 1/3] sh: Rename NR_syscalls macro to __NR_syscalls Firoz Khan
  2018-08-09  5:36 ` [PATCH 2/3] sh: Added system call table generation support Firoz Khan
@ 2018-08-09  5:36 ` Firoz Khan
  2 siblings, 0 replies; 7+ messages in thread
From: Firoz Khan @ 2018-08-09  5:36 UTC (permalink / raw)
  To: linux-sh, Yoshinori Sato, Rich Felker, Steven Rostedt,
	Ingo Molnar, Greg Kroah-Hartman, Philippe Ombredanne,
	Thomas Gleixner, Kate Stewart
  Cc: y2038, linux-kernel, linux-arch, arnd, deepa.kernel,
	marcin.juszkiewicz, firoz.khan

System call table generation script must be run to generate
unistd_64.h and syscall_table.h files. This patch will have
changes which will invokes the script.

This patch will generate unistd_64.h and syscall_table.h
files by the syscall table generation script invoked by
arch/ia64/Makefile and the generated files against the
removed files will be identical.

The generated uapi header file will be included in
uapi/asm/unistd.h and generated system call table support
file will be included by ia64/kernel/syscall_table.S file.

Signed-off-by: Firoz Khan <firoz.khan@linaro.org>
---
 arch/sh/Makefile                |   3 +
 arch/sh/include/asm/Kbuild      |   2 +
 arch/sh/include/uapi/asm/Kbuild |   2 +
 arch/sh/kernel/Makefile         |   2 +-
 arch/sh/kernel/syscall.S        |   9 +
 arch/sh/kernel/syscalls_32.S    | 402 ----------------------------------------
 6 files changed, 17 insertions(+), 403 deletions(-)
 create mode 100644 arch/sh/kernel/syscall.S
 delete mode 100644 arch/sh/kernel/syscalls_32.S

diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index 65300193..19ca795 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -228,6 +228,9 @@ archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
 	$(Q)$(MAKE) $(clean)=arch/sh/kernel/vsyscall
 
+archheaders:
+	$(Q)$(MAKE) $(build)=arch/sh/kernel/syscalls all
+
 define archhelp
 	@echo '  zImage 	           - Compressed kernel image'
 	@echo '  romImage	           - Compressed ROM image, if supported'
diff --git a/arch/sh/include/asm/Kbuild b/arch/sh/include/asm/Kbuild
index 46dd82a..a907c57 100644
--- a/arch/sh/include/asm/Kbuild
+++ b/arch/sh/include/asm/Kbuild
@@ -18,3 +18,5 @@ generic-y += serial.h
 generic-y += sizes.h
 generic-y += trace_clock.h
 generic-y += xor.h
+
+generated-y += syscall_table.h
\ No newline at end of file
diff --git a/arch/sh/include/uapi/asm/Kbuild b/arch/sh/include/uapi/asm/Kbuild
index ba4d39c..443b746 100644
--- a/arch/sh/include/uapi/asm/Kbuild
+++ b/arch/sh/include/uapi/asm/Kbuild
@@ -21,3 +21,5 @@ generic-y += statfs.h
 generic-y += termbits.h
 generic-y += termios.h
 generic-y += ucontext.h
+
+generated-y += unistd_32.h
\ No newline at end of file
diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile
index dc80041..a042981 100644
--- a/arch/sh/kernel/Makefile
+++ b/arch/sh/kernel/Makefile
@@ -18,7 +18,7 @@ obj-y	:= debugtraps.o dma-nommu.o dumpstack.o 		\
 	   process_$(BITS).o ptrace.o ptrace_$(BITS).o			\
 	   reboot.o return_address.o					\
 	   setup.o signal_$(BITS).o sys_sh.o 				\
-	   syscalls_$(BITS).o time.o topology.o traps.o			\
+	   syscall.o time.o topology.o traps.o			\
 	   traps_$(BITS).o unwinder.o
 
 ifndef CONFIG_GENERIC_IOMAP
diff --git a/arch/sh/kernel/syscall.S b/arch/sh/kernel/syscall.S
new file mode 100644
index 0000000..317a2a9
--- /dev/null
+++ b/arch/sh/kernel/syscall.S
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#include <linux/sys.h>
+#include <linux/linkage.h>
+
+#define __SYSCALL(nr, entry, nargs) .long entry
+
+.data
+ENTRY(sys_call_table)
+#include <asm/syscall_table.h>
diff --git a/arch/sh/kernel/syscalls_32.S b/arch/sh/kernel/syscalls_32.S
deleted file mode 100644
index 254bc22..0000000
--- a/arch/sh/kernel/syscalls_32.S
+++ /dev/null
@@ -1,402 +0,0 @@
-/*
- * arch/sh/kernel/syscalls.S
- *
- * System call table for SuperH
- *
- *  Copyright (C) 1999, 2000, 2002  Niibe Yutaka
- *  Copyright (C) 2003  Paul Mundt
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- */
-#include <linux/sys.h>
-#include <linux/linkage.h>
-
-	.data
-ENTRY(sys_call_table)
-	.long sys_restart_syscall	/* 0  -  old "setup()" system call*/
-	.long sys_exit
-	.long sys_fork
-	.long sys_read
-	.long sys_write
-	.long sys_open		/* 5 */
-	.long sys_close
-	.long sys_waitpid
-	.long sys_creat
-	.long sys_link
-	.long sys_unlink		/* 10 */
-	.long sys_execve
-	.long sys_chdir
-	.long sys_time
-	.long sys_mknod
-	.long sys_chmod		/* 15 */
-	.long sys_lchown16
-	.long sys_ni_syscall	/* old break syscall holder */
-	.long sys_stat
-	.long sys_lseek
-	.long sys_getpid		/* 20 */
-	.long sys_mount
-	.long sys_oldumount
-	.long sys_setuid16
-	.long sys_getuid16
-	.long sys_stime		/* 25 */
-	.long sys_ptrace
-	.long sys_alarm
-	.long sys_fstat
-	.long sys_pause
-	.long sys_utime		/* 30 */
-	.long sys_ni_syscall	/* old stty syscall holder */
-	.long sys_ni_syscall	/* old gtty syscall holder */
-	.long sys_access
-	.long sys_nice
-	.long sys_ni_syscall	/* 35 */		/* old ftime syscall holder */
-	.long sys_sync
-	.long sys_kill
-	.long sys_rename
-	.long sys_mkdir
-	.long sys_rmdir		/* 40 */
-	.long sys_dup
-	.long sys_sh_pipe
-	.long sys_times
-	.long sys_ni_syscall	/* old prof syscall holder */
-	.long sys_brk		/* 45 */
-	.long sys_setgid16
-	.long sys_getgid16
-	.long sys_signal
-	.long sys_geteuid16
-	.long sys_getegid16	/* 50 */
-	.long sys_acct
-	.long sys_umount		/* recycled never used phys() */
-	.long sys_ni_syscall	/* old lock syscall holder */
-	.long sys_ioctl
-	.long sys_fcntl		/* 55 */
-	.long sys_ni_syscall	/* old mpx syscall holder */
-	.long sys_setpgid
-	.long sys_ni_syscall	/* old ulimit syscall holder */
-	.long sys_ni_syscall	/* sys_olduname */
-	.long sys_umask		/* 60 */
-	.long sys_chroot
-	.long sys_ustat
-	.long sys_dup2
-	.long sys_getppid
-	.long sys_getpgrp		/* 65 */
-	.long sys_setsid
-	.long sys_sigaction
-	.long sys_sgetmask
-	.long sys_ssetmask
-	.long sys_setreuid16	/* 70 */
-	.long sys_setregid16
-	.long sys_sigsuspend
-	.long sys_sigpending
-	.long sys_sethostname
-	.long sys_setrlimit	/* 75 */
-	.long sys_old_getrlimit
-	.long sys_getrusage
-	.long sys_gettimeofday
-	.long sys_settimeofday
-	.long sys_getgroups16	/* 80 */
-	.long sys_setgroups16
-	.long sys_ni_syscall	/* sys_oldselect */
-	.long sys_symlink
-	.long sys_lstat
-	.long sys_readlink		/* 85 */
-	.long sys_uselib
-	.long sys_swapon
-	.long sys_reboot
-	.long sys_old_readdir
-	.long old_mmap		/* 90 */
-	.long sys_munmap
-	.long sys_truncate
-	.long sys_ftruncate
-	.long sys_fchmod
-	.long sys_fchown16		/* 95 */
-	.long sys_getpriority
-	.long sys_setpriority
-	.long sys_ni_syscall	/* old profil syscall holder */
-	.long sys_statfs
-	.long sys_fstatfs		/* 100 */
-	.long sys_ni_syscall	/* ioperm */
-	.long sys_socketcall
-	.long sys_syslog
-	.long sys_setitimer
-	.long sys_getitimer	/* 105 */
-	.long sys_newstat
-	.long sys_newlstat
-	.long sys_newfstat
-	.long sys_uname
-	.long sys_ni_syscall	/* 110 */ /* iopl */
-	.long sys_vhangup
-	.long sys_ni_syscall	/* idle */
-	.long sys_ni_syscall	/* vm86old */
-	.long sys_wait4
-	.long sys_swapoff		/* 115 */
-	.long sys_sysinfo
-	.long sys_ipc
-	.long sys_fsync
-	.long sys_sigreturn
-	.long sys_clone		/* 120 */
-	.long sys_setdomainname
-	.long sys_newuname
-	.long sys_cacheflush	/* x86: sys_modify_ldt */
-	.long sys_adjtimex
-	.long sys_mprotect		/* 125 */
-	.long sys_sigprocmask
-	.long sys_ni_syscall	/* old "create_module" */
-	.long sys_init_module
-	.long sys_delete_module
-	.long sys_ni_syscall	/* 130: old "get_kernel_syms" */
-	.long sys_quotactl
-	.long sys_getpgid
-	.long sys_fchdir
-	.long sys_bdflush
-	.long sys_sysfs		/* 135 */
-	.long sys_personality
-	.long sys_ni_syscall	/* for afs_syscall */
-	.long sys_setfsuid16
-	.long sys_setfsgid16
-	.long sys_llseek		/* 140 */
-	.long sys_getdents
-	.long sys_select
-	.long sys_flock
-	.long sys_msync
-	.long sys_readv		/* 145 */
-	.long sys_writev
-	.long sys_getsid
-	.long sys_fdatasync
-	.long sys_sysctl
-	.long sys_mlock		/* 150 */
-	.long sys_munlock
-	.long sys_mlockall
-	.long sys_munlockall
-	.long sys_sched_setparam
-	.long sys_sched_getparam   /* 155 */
-	.long sys_sched_setscheduler
-	.long sys_sched_getscheduler
-	.long sys_sched_yield
-	.long sys_sched_get_priority_max
-	.long sys_sched_get_priority_min  /* 160 */
-	.long sys_sched_rr_get_interval
-	.long sys_nanosleep
-	.long sys_mremap
-	.long sys_setresuid16
-	.long sys_getresuid16	/* 165 */
-	.long sys_ni_syscall	/* vm86 */
-	.long sys_ni_syscall	/* old "query_module" */
-	.long sys_poll
-	.long sys_ni_syscall	/* was nfsservctl */
-	.long sys_setresgid16	/* 170 */
-	.long sys_getresgid16
-	.long sys_prctl
-	.long sys_rt_sigreturn
-	.long sys_rt_sigaction
-	.long sys_rt_sigprocmask	/* 175 */
-	.long sys_rt_sigpending
-	.long sys_rt_sigtimedwait
-	.long sys_rt_sigqueueinfo
-	.long sys_rt_sigsuspend
-	.long sys_pread_wrapper	   /* 180 */
-	.long sys_pwrite_wrapper
-	.long sys_chown16
-	.long sys_getcwd
-	.long sys_capget
-	.long sys_capset           /* 185 */
-	.long sys_sigaltstack
-	.long sys_sendfile
-	.long sys_ni_syscall	/* getpmsg */
-	.long sys_ni_syscall	/* putpmsg */
-	.long sys_vfork            /* 190 */
-	.long sys_getrlimit
-	.long sys_mmap2
-	.long sys_truncate64
-	.long sys_ftruncate64
-	.long sys_stat64		/* 195 */
-	.long sys_lstat64
-	.long sys_fstat64
-	.long sys_lchown
-	.long sys_getuid
-	.long sys_getgid		/* 200 */
-	.long sys_geteuid
-	.long sys_getegid
-	.long sys_setreuid
-	.long sys_setregid
-	.long sys_getgroups	/* 205 */
-	.long sys_setgroups
-	.long sys_fchown
-	.long sys_setresuid
-	.long sys_getresuid
-	.long sys_setresgid	/* 210 */
-	.long sys_getresgid
-	.long sys_chown
-	.long sys_setuid
-	.long sys_setgid
-	.long sys_setfsuid		/* 215 */
-	.long sys_setfsgid
-	.long sys_pivot_root
-	.long sys_mincore
-	.long sys_madvise
-	.long sys_getdents64	/* 220 */
-	.long sys_fcntl64
-	.long sys_ni_syscall	/* reserved for TUX */
-	.long sys_ni_syscall	/* Reserved for Security */
-	.long sys_gettid
-	.long sys_readahead	/* 225 */
-	.long sys_setxattr
-	.long sys_lsetxattr
-	.long sys_fsetxattr
-	.long sys_getxattr
-	.long sys_lgetxattr	/* 230 */
-	.long sys_fgetxattr
-	.long sys_listxattr
-	.long sys_llistxattr
-	.long sys_flistxattr
-	.long sys_removexattr	/* 235 */
-	.long sys_lremovexattr
-	.long sys_fremovexattr
-	.long sys_tkill
-	.long sys_sendfile64
-	.long sys_futex		/* 240 */
-	.long sys_sched_setaffinity
-	.long sys_sched_getaffinity
-	.long sys_ni_syscall	/* reserved for set_thread_area */
-	.long sys_ni_syscall	/* reserved for get_thread_area */
-	.long sys_io_setup	/* 245 */
-	.long sys_io_destroy
-	.long sys_io_getevents
-	.long sys_io_submit
-	.long sys_io_cancel
-	.long sys_fadvise64	/* 250 */
-	.long sys_ni_syscall
-	.long sys_exit_group
-	.long sys_lookup_dcookie
-	.long sys_epoll_create
-	.long sys_epoll_ctl	/* 255 */
-	.long sys_epoll_wait
- 	.long sys_remap_file_pages
- 	.long sys_set_tid_address
- 	.long sys_timer_create
- 	.long sys_timer_settime		/* 260 */
- 	.long sys_timer_gettime
- 	.long sys_timer_getoverrun
- 	.long sys_timer_delete
- 	.long sys_clock_settime
- 	.long sys_clock_gettime		/* 265 */
- 	.long sys_clock_getres
- 	.long sys_clock_nanosleep
-	.long sys_statfs64
-	.long sys_fstatfs64
-	.long sys_tgkill		/* 270 */
-	.long sys_utimes
- 	.long sys_fadvise64_64_wrapper
-	.long sys_ni_syscall	/* Reserved for vserver */
-	.long sys_mbind
-	.long sys_get_mempolicy		/* 275 */
-	.long sys_set_mempolicy
-	.long sys_mq_open
-	.long sys_mq_unlink
-	.long sys_mq_timedsend
-	.long sys_mq_timedreceive       /* 280 */
-	.long sys_mq_notify
-	.long sys_mq_getsetattr
-	.long sys_kexec_load
-	.long sys_waitid
-	.long sys_add_key		/* 285 */
-	.long sys_request_key
-	.long sys_keyctl
-	.long sys_ioprio_set
-	.long sys_ioprio_get
-	.long sys_inotify_init		/* 290 */
-	.long sys_inotify_add_watch
-	.long sys_inotify_rm_watch
-	.long sys_ni_syscall
-	.long sys_migrate_pages
-	.long sys_openat		/* 295 */
-	.long sys_mkdirat
-	.long sys_mknodat
-	.long sys_fchownat
-	.long sys_futimesat
-	.long sys_fstatat64		/* 300 */
-	.long sys_unlinkat
-	.long sys_renameat
-	.long sys_linkat
-	.long sys_symlinkat
-	.long sys_readlinkat		/* 305 */
-	.long sys_fchmodat
-	.long sys_faccessat
-	.long sys_pselect6
-	.long sys_ppoll
-	.long sys_unshare		/* 310 */
-	.long sys_set_robust_list
-	.long sys_get_robust_list
-	.long sys_splice
-	.long sys_sync_file_range
-	.long sys_tee			/* 315 */
-	.long sys_vmsplice
-	.long sys_move_pages
-	.long sys_getcpu
-	.long sys_epoll_pwait
-	.long sys_utimensat		/* 320 */
-	.long sys_signalfd
-	.long sys_timerfd_create
-	.long sys_eventfd
-	.long sys_fallocate
-	.long sys_timerfd_settime	/* 325 */
-	.long sys_timerfd_gettime
-	.long sys_signalfd4
-	.long sys_eventfd2
-	.long sys_epoll_create1
-	.long sys_dup3			/* 330 */
-	.long sys_pipe2
-	.long sys_inotify_init1
-	.long sys_preadv
-	.long sys_pwritev
-	.long sys_rt_tgsigqueueinfo	/* 335 */
-	.long sys_perf_event_open
-	.long sys_fanotify_init
-	.long sys_fanotify_mark
-	.long sys_prlimit64
-	/* Broken-out socket family */
-	.long sys_socket		/* 340 */
-	.long sys_bind
-	.long sys_connect
-	.long sys_listen
-	.long sys_accept
-	.long sys_getsockname	/* 345 */
-	.long sys_getpeername
-	.long sys_socketpair
-	.long sys_send
-	.long sys_sendto
-	.long sys_recv			/* 350 */
-	.long sys_recvfrom
-	.long sys_shutdown
-	.long sys_setsockopt
-	.long sys_getsockopt
-	.long sys_sendmsg		/* 355 */
-	.long sys_recvmsg
-	.long sys_recvmmsg
-	.long sys_accept4
-	.long sys_name_to_handle_at
-	.long sys_open_by_handle_at	/* 360 */
-	.long sys_clock_adjtime
-	.long sys_syncfs
-	.long sys_sendmmsg
-	.long sys_setns
-	.long sys_process_vm_readv	/* 365 */
-	.long sys_process_vm_writev
-	.long sys_kcmp
-	.long sys_finit_module
-	.long sys_sched_getattr
-	.long sys_sched_setattr		/* 370 */
-	.long sys_renameat2
-	.long sys_seccomp
-	.long sys_getrandom
-	.long sys_memfd_create
-	.long sys_bpf			/* 375 */
-	.long sys_execveat
-	.long sys_userfaultfd
-	.long sys_membarrier
-	.long sys_mlock2
-	.long sys_copy_file_range	/* 380 */
-	.long sys_preadv2
-	.long sys_pwritev2
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/3] sh: Rename NR_syscalls macro to __NR_syscalls
  2018-08-09  5:36 ` [PATCH 1/3] sh: Rename NR_syscalls macro to __NR_syscalls Firoz Khan
@ 2018-08-09 12:58   ` kbuild test robot
  2018-08-10 19:38     ` Steven Rostedt
  0 siblings, 1 reply; 7+ messages in thread
From: kbuild test robot @ 2018-08-09 12:58 UTC (permalink / raw)
  To: Firoz Khan
  Cc: kbuild-all, linux-sh, Yoshinori Sato, Rich Felker,
	Steven Rostedt, Ingo Molnar, Greg Kroah-Hartman,
	Philippe Ombredanne, Thomas Gleixner, Kate Stewart, y2038,
	linux-kernel, linux-arch, arnd, deepa.kernel, marcin.juszkiewicz,
	firoz.khan

[-- Attachment #1: Type: text/plain, Size: 10160 bytes --]

Hi Firoz,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v4.18-rc8 next-20180808]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Firoz-Khan/sh-Rename-NR_syscalls-macro-to-__NR_syscalls/20180809-171759
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=sh 

All errors (new ones prefixed by >>):

   In file included from kernel/trace/trace_selftest_dynamic.c:3:0:
>> kernel/trace/trace.h:243:53: error: 'NR_syscalls' undeclared here (not in a function); did you mean '__NR_syscalls'?
     struct trace_event_file __rcu *enter_syscall_files[NR_syscalls];
                                                        ^~~~~~~~~~~
                                                        __NR_syscalls
--
   In file included from kernel/trace/trace_output.h:6:0,
                    from kernel/trace/trace_syscalls.c:12:
>> kernel/trace/trace.h:243:53: error: 'NR_syscalls' undeclared here (not in a function); did you mean '__NR_syscalls'?
     struct trace_event_file __rcu *enter_syscall_files[NR_syscalls];
                                                        ^~~~~~~~~~~
                                                        __NR_syscalls
   In file included from include/linux/smp.h:11:0,
                    from include/linux/tracepoint.h:17,
                    from include/trace/syscall.h:5,
                    from kernel/trace/trace_syscalls.c:2:
   kernel/trace/trace_syscalls.c:559:23: warning: 'enabled_perf_exit_syscalls' defined but not used [-Wunused-variable]
    static DECLARE_BITMAP(enabled_perf_exit_syscalls, NR_syscalls);
                          ^
   include/linux/types.h:11:16: note: in definition of macro 'DECLARE_BITMAP'
     unsigned long name[BITS_TO_LONGS(bits)]
                   ^~~~
   kernel/trace/trace_syscalls.c:558:23: warning: 'enabled_perf_enter_syscalls' defined but not used [-Wunused-variable]
    static DECLARE_BITMAP(enabled_perf_enter_syscalls, NR_syscalls);
                          ^
   include/linux/types.h:11:16: note: in definition of macro 'DECLARE_BITMAP'
     unsigned long name[BITS_TO_LONGS(bits)]
                   ^~~~

vim +243 kernel/trace/trace.h

490901078 Steven Rostedt (Red Hat  2015-09-24  196) 
bc0c38d13 Steven Rostedt           2008-05-12  197  /*
bc0c38d13 Steven Rostedt           2008-05-12  198   * The trace array - an array of per-CPU trace arrays. This is the
bc0c38d13 Steven Rostedt           2008-05-12  199   * highest level data structure that individual tracers deal with.
bc0c38d13 Steven Rostedt           2008-05-12  200   * They have on/off state as well:
bc0c38d13 Steven Rostedt           2008-05-12  201   */
bc0c38d13 Steven Rostedt           2008-05-12  202  struct trace_array {
ae63b31e4 Steven Rostedt           2012-05-03  203  	struct list_head	list;
277ba0446 Steven Rostedt           2012-08-03  204  	char			*name;
12883efb6 Steven Rostedt (Red Hat  2013-03-05  205) 	struct trace_buffer	trace_buffer;
12883efb6 Steven Rostedt (Red Hat  2013-03-05  206) #ifdef CONFIG_TRACER_MAX_TRACE
12883efb6 Steven Rostedt (Red Hat  2013-03-05  207) 	/*
12883efb6 Steven Rostedt (Red Hat  2013-03-05  208) 	 * The max_buffer is used to snapshot the trace when a maximum
12883efb6 Steven Rostedt (Red Hat  2013-03-05  209) 	 * latency is reached, or when the user initiates a snapshot.
12883efb6 Steven Rostedt (Red Hat  2013-03-05  210) 	 * Some tracers will use this to store a maximum trace while
12883efb6 Steven Rostedt (Red Hat  2013-03-05  211) 	 * it continues examining live traces.
12883efb6 Steven Rostedt (Red Hat  2013-03-05  212) 	 *
12883efb6 Steven Rostedt (Red Hat  2013-03-05  213) 	 * The buffers for the max_buffer are set up the same as the trace_buffer
12883efb6 Steven Rostedt (Red Hat  2013-03-05  214) 	 * When a snapshot is taken, the buffer of the max_buffer is swapped
12883efb6 Steven Rostedt (Red Hat  2013-03-05  215) 	 * with the buffer of the trace_buffer and the buffers are reset for
12883efb6 Steven Rostedt (Red Hat  2013-03-05  216) 	 * the trace_buffer so the tracing can continue.
12883efb6 Steven Rostedt (Red Hat  2013-03-05  217) 	 */
12883efb6 Steven Rostedt (Red Hat  2013-03-05  218) 	struct trace_buffer	max_buffer;
45ad21ca5 Steven Rostedt (Red Hat  2013-03-05  219) 	bool			allocated_snapshot;
f971cc9aa Steven Rostedt (Red Hat  2016-09-07  220) #endif
f971cc9aa Steven Rostedt (Red Hat  2016-09-07  221) #if defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER)
6d9b3fa5e Steven Rostedt (Red Hat  2014-01-14  222) 	unsigned long		max_latency;
12883efb6 Steven Rostedt (Red Hat  2013-03-05  223) #endif
490901078 Steven Rostedt (Red Hat  2015-09-24  224) 	struct trace_pid_list	__rcu *filtered_pids;
0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  225) 	/*
0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  226) 	 * max_lock is used to protect the swapping of buffers
0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  227) 	 * when taking a max snapshot. The buffers themselves are
0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  228) 	 * protected by per_cpu spinlocks. But the action of the swap
0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  229) 	 * needs its own lock.
0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  230) 	 *
0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  231) 	 * This is defined as a arch_spinlock_t in order to help
0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  232) 	 * with performance when lockdep debugging is enabled.
0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  233) 	 *
0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  234) 	 * It is also used in other places outside the update_max_tr
0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  235) 	 * so it needs to be defined outside of the
0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  236) 	 * CONFIG_TRACER_MAX_TRACE.
0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  237) 	 */
0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  238) 	arch_spinlock_t		max_lock;
499e54705 Steven Rostedt           2012-02-22  239  	int			buffer_disabled;
12ab74ee0 Steven Rostedt           2012-08-08  240  #ifdef CONFIG_FTRACE_SYSCALLS
12ab74ee0 Steven Rostedt           2012-08-08  241  	int			sys_refcount_enter;
12ab74ee0 Steven Rostedt           2012-08-08  242  	int			sys_refcount_exit;
7f1d2f821 Steven Rostedt (Red Hat  2015-05-05 @243) 	struct trace_event_file __rcu *enter_syscall_files[NR_syscalls];
7f1d2f821 Steven Rostedt (Red Hat  2015-05-05  244) 	struct trace_event_file __rcu *exit_syscall_files[NR_syscalls];
12ab74ee0 Steven Rostedt           2012-08-08  245  #endif
2b6080f28 Steven Rostedt           2012-05-11  246  	int			stop_count;
2b6080f28 Steven Rostedt           2012-05-11  247  	int			clock_id;
37aea98b8 Steven Rostedt (Red Hat  2015-09-30  248) 	int			nr_topts;
065e63f95 Steven Rostedt (VMware   2017-08-31  249) 	bool			clear_trace;
2b6080f28 Steven Rostedt           2012-05-11  250  	struct tracer		*current_trace;
983f938ae Steven Rostedt (Red Hat  2015-09-30  251) 	unsigned int		trace_flags;
9a38a8856 Steven Rostedt (Red Hat  2015-09-30  252) 	unsigned char		trace_flags_index[TRACE_FLAGS_MAX_SIZE];
ae63b31e4 Steven Rostedt           2012-05-03  253  	unsigned int		flags;
2b6080f28 Steven Rostedt           2012-05-11  254  	raw_spinlock_t		start_lock;
ae63b31e4 Steven Rostedt           2012-05-03  255  	struct dentry		*dir;
2b6080f28 Steven Rostedt           2012-05-11  256  	struct dentry		*options;
2b6080f28 Steven Rostedt           2012-05-11  257  	struct dentry		*percpu_dir;
ae63b31e4 Steven Rostedt           2012-05-03  258  	struct dentry		*event_dir;
37aea98b8 Steven Rostedt (Red Hat  2015-09-30  259) 	struct trace_options	*topts;
ae63b31e4 Steven Rostedt           2012-05-03  260  	struct list_head	systems;
ae63b31e4 Steven Rostedt           2012-05-03  261  	struct list_head	events;
3dd809536 Steven Rostedt (VMware   2018-05-09  262) 	struct trace_event_file *trace_marker_file;
ccfe9e42e Alexander Z Lam          2013-08-08  263  	cpumask_var_t		tracing_cpumask; /* only trace on set CPUs */
a695cb581 Steven Rostedt (Red Hat  2013-03-06  264) 	int			ref;
f20a58062 Steven Rostedt (Red Hat  2013-11-07  265) #ifdef CONFIG_FUNCTION_TRACER
f20a58062 Steven Rostedt (Red Hat  2013-11-07  266) 	struct ftrace_ops	*ops;
345ddcc88 Steven Rostedt (Red Hat  2016-04-22  267) 	struct trace_pid_list	__rcu *function_pids;
04ec7bb64 Steven Rostedt (VMware   2017-04-05  268) #ifdef CONFIG_DYNAMIC_FTRACE
673feb9d7 Steven Rostedt (VMware   2017-06-23  269) 	/* All of these are protected by the ftrace_lock */
04ec7bb64 Steven Rostedt (VMware   2017-04-05  270) 	struct list_head	func_probes;
673feb9d7 Steven Rostedt (VMware   2017-06-23  271) 	struct list_head	mod_trace;
673feb9d7 Steven Rostedt (VMware   2017-06-23  272) 	struct list_head	mod_notrace;
04ec7bb64 Steven Rostedt (VMware   2017-04-05  273) #endif
f20a58062 Steven Rostedt (Red Hat  2013-11-07  274) 	/* function tracing enabled */
f20a58062 Steven Rostedt (Red Hat  2013-11-07  275) 	int			function_enabled;
f20a58062 Steven Rostedt (Red Hat  2013-11-07  276) #endif
00b414529 Tom Zanussi              2018-01-15  277  	int			time_stamp_abs_ref;
067fe038e Tom Zanussi              2018-01-15  278  	struct list_head	hist_vars;
bc0c38d13 Steven Rostedt           2008-05-12  279  };
bc0c38d13 Steven Rostedt           2008-05-12  280  

:::::: The code at line 243 was first introduced by commit
:::::: 7f1d2f8210195c8c309d424a77dbf06a6d2186f4 tracing: Rename ftrace_event_file to trace_event_file

:::::: TO: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
:::::: CC: Steven Rostedt <rostedt@goodmis.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 48548 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/3] sh: Rename NR_syscalls macro to __NR_syscalls
  2018-08-09 12:58   ` kbuild test robot
@ 2018-08-10 19:38     ` Steven Rostedt
  2018-09-18  9:06       ` Firoz Khan
  0 siblings, 1 reply; 7+ messages in thread
From: Steven Rostedt @ 2018-08-10 19:38 UTC (permalink / raw)
  To: kbuild test robot
  Cc: Firoz Khan, kbuild-all, linux-sh, Yoshinori Sato, Rich Felker,
	Ingo Molnar, Greg Kroah-Hartman, Philippe Ombredanne,
	Thomas Gleixner, Kate Stewart, y2038, linux-kernel, linux-arch,
	arnd, deepa.kernel, marcin.juszkiewicz

On Thu, 9 Aug 2018 20:58:58 +0800
kbuild test robot <lkp@intel.com> wrote:

> Hi Firoz,
> 
> Thank you for the patch! Yet something to improve:
> 
> [auto build test ERROR on linus/master]
> [also build test ERROR on v4.18-rc8 next-20180808]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
> 
> url:    https://github.com/0day-ci/linux/commits/Firoz-Khan/sh-Rename-NR_syscalls-macro-to-__NR_syscalls/20180809-171759
> config: sh-allmodconfig (attached as .config)
> compiler: sh4-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
> reproduce:
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # save the attached .config to linux build tree
>         GCC_VERSION=7.2.0 make.cross ARCH=sh 
> 
> All errors (new ones prefixed by >>):
> 
>    In file included from kernel/trace/trace_selftest_dynamic.c:3:0:
> >> kernel/trace/trace.h:243:53: error: 'NR_syscalls' undeclared here (not in a function); did you mean '__NR_syscalls'?  
>      struct trace_event_file __rcu *enter_syscall_files[NR_syscalls];
>                                                         ^~~~~~~~~~~
>                                                         __NR_syscalls
> --
>    In file included from kernel/trace/trace_output.h:6:0,
>                     from kernel/trace/trace_syscalls.c:12:
> >> kernel/trace/trace.h:243:53: error: 'NR_syscalls' undeclared here (not in a function); did you mean '__NR_syscalls'?  
>      struct trace_event_file __rcu *enter_syscall_files[NR_syscalls];
>                                                         ^~~~~~~~~~~
>                                                         __NR_syscalls

Most archs have a:

#define NR_syscalls __NR_syscalls

-- Steve

>    In file included from include/linux/smp.h:11:0,
>                     from include/linux/tracepoint.h:17,
>                     from include/trace/syscall.h:5,
>                     from kernel/trace/trace_syscalls.c:2:
>    kernel/trace/trace_syscalls.c:559:23: warning: 'enabled_perf_exit_syscalls' defined but not used [-Wunused-variable]
>     static DECLARE_BITMAP(enabled_perf_exit_syscalls, NR_syscalls);
>                           ^
>    include/linux/types.h:11:16: note: in definition of macro 'DECLARE_BITMAP'
>      unsigned long name[BITS_TO_LONGS(bits)]
>                    ^~~~
>    kernel/trace/trace_syscalls.c:558:23: warning: 'enabled_perf_enter_syscalls' defined but not used [-Wunused-variable]
>     static DECLARE_BITMAP(enabled_perf_enter_syscalls, NR_syscalls);
>                           ^
>    include/linux/types.h:11:16: note: in definition of macro 'DECLARE_BITMAP'
>      unsigned long name[BITS_TO_LONGS(bits)]
>                    ^~~~
> 
> vim +243 kernel/trace/trace.h
> 
> 490901078 Steven Rostedt (Red Hat  2015-09-24  196) 
> bc0c38d13 Steven Rostedt           2008-05-12  197  /*
> bc0c38d13 Steven Rostedt           2008-05-12  198   * The trace array - an array of per-CPU trace arrays. This is the
> bc0c38d13 Steven Rostedt           2008-05-12  199   * highest level data structure that individual tracers deal with.
> bc0c38d13 Steven Rostedt           2008-05-12  200   * They have on/off state as well:
> bc0c38d13 Steven Rostedt           2008-05-12  201   */
> bc0c38d13 Steven Rostedt           2008-05-12  202  struct trace_array {
> ae63b31e4 Steven Rostedt           2012-05-03  203  	struct list_head	list;
> 277ba0446 Steven Rostedt           2012-08-03  204  	char			*name;
> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  205) 	struct trace_buffer	trace_buffer;
> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  206) #ifdef CONFIG_TRACER_MAX_TRACE
> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  207) 	/*
> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  208) 	 * The max_buffer is used to snapshot the trace when a maximum
> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  209) 	 * latency is reached, or when the user initiates a snapshot.
> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  210) 	 * Some tracers will use this to store a maximum trace while
> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  211) 	 * it continues examining live traces.
> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  212) 	 *
> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  213) 	 * The buffers for the max_buffer are set up the same as the trace_buffer
> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  214) 	 * When a snapshot is taken, the buffer of the max_buffer is swapped
> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  215) 	 * with the buffer of the trace_buffer and the buffers are reset for
> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  216) 	 * the trace_buffer so the tracing can continue.
> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  217) 	 */
> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  218) 	struct trace_buffer	max_buffer;
> 45ad21ca5 Steven Rostedt (Red Hat  2013-03-05  219) 	bool			allocated_snapshot;
> f971cc9aa Steven Rostedt (Red Hat  2016-09-07  220) #endif
> f971cc9aa Steven Rostedt (Red Hat  2016-09-07  221) #if defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER)
> 6d9b3fa5e Steven Rostedt (Red Hat  2014-01-14  222) 	unsigned long		max_latency;
> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  223) #endif
> 490901078 Steven Rostedt (Red Hat  2015-09-24  224) 	struct trace_pid_list	__rcu *filtered_pids;
> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  225) 	/*
> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  226) 	 * max_lock is used to protect the swapping of buffers
> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  227) 	 * when taking a max snapshot. The buffers themselves are
> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  228) 	 * protected by per_cpu spinlocks. But the action of the swap
> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  229) 	 * needs its own lock.
> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  230) 	 *
> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  231) 	 * This is defined as a arch_spinlock_t in order to help
> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  232) 	 * with performance when lockdep debugging is enabled.
> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  233) 	 *
> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  234) 	 * It is also used in other places outside the update_max_tr
> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  235) 	 * so it needs to be defined outside of the
> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  236) 	 * CONFIG_TRACER_MAX_TRACE.
> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  237) 	 */
> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  238) 	arch_spinlock_t		max_lock;
> 499e54705 Steven Rostedt           2012-02-22  239  	int			buffer_disabled;
> 12ab74ee0 Steven Rostedt           2012-08-08  240  #ifdef CONFIG_FTRACE_SYSCALLS
> 12ab74ee0 Steven Rostedt           2012-08-08  241  	int			sys_refcount_enter;
> 12ab74ee0 Steven Rostedt           2012-08-08  242  	int			sys_refcount_exit;
> 7f1d2f821 Steven Rostedt (Red Hat  2015-05-05 @243) 	struct trace_event_file __rcu *enter_syscall_files[NR_syscalls];
> 7f1d2f821 Steven Rostedt (Red Hat  2015-05-05  244) 	struct trace_event_file __rcu *exit_syscall_files[NR_syscalls];
> 12ab74ee0 Steven Rostedt           2012-08-08  245  #endif
> 2b6080f28 Steven Rostedt           2012-05-11  246  	int			stop_count;
> 2b6080f28 Steven Rostedt           2012-05-11  247  	int			clock_id;
> 37aea98b8 Steven Rostedt (Red Hat  2015-09-30  248) 	int			nr_topts;
> 065e63f95 Steven Rostedt (VMware   2017-08-31  249) 	bool			clear_trace;
> 2b6080f28 Steven Rostedt           2012-05-11  250  	struct tracer		*current_trace;
> 983f938ae Steven Rostedt (Red Hat  2015-09-30  251) 	unsigned int		trace_flags;
> 9a38a8856 Steven Rostedt (Red Hat  2015-09-30  252) 	unsigned char		trace_flags_index[TRACE_FLAGS_MAX_SIZE];
> ae63b31e4 Steven Rostedt           2012-05-03  253  	unsigned int		flags;
> 2b6080f28 Steven Rostedt           2012-05-11  254  	raw_spinlock_t		start_lock;
> ae63b31e4 Steven Rostedt           2012-05-03  255  	struct dentry		*dir;
> 2b6080f28 Steven Rostedt           2012-05-11  256  	struct dentry		*options;
> 2b6080f28 Steven Rostedt           2012-05-11  257  	struct dentry		*percpu_dir;
> ae63b31e4 Steven Rostedt           2012-05-03  258  	struct dentry		*event_dir;
> 37aea98b8 Steven Rostedt (Red Hat  2015-09-30  259) 	struct trace_options	*topts;
> ae63b31e4 Steven Rostedt           2012-05-03  260  	struct list_head	systems;
> ae63b31e4 Steven Rostedt           2012-05-03  261  	struct list_head	events;
> 3dd809536 Steven Rostedt (VMware   2018-05-09  262) 	struct trace_event_file *trace_marker_file;
> ccfe9e42e Alexander Z Lam          2013-08-08  263  	cpumask_var_t		tracing_cpumask; /* only trace on set CPUs */
> a695cb581 Steven Rostedt (Red Hat  2013-03-06  264) 	int			ref;
> f20a58062 Steven Rostedt (Red Hat  2013-11-07  265) #ifdef CONFIG_FUNCTION_TRACER
> f20a58062 Steven Rostedt (Red Hat  2013-11-07  266) 	struct ftrace_ops	*ops;
> 345ddcc88 Steven Rostedt (Red Hat  2016-04-22  267) 	struct trace_pid_list	__rcu *function_pids;
> 04ec7bb64 Steven Rostedt (VMware   2017-04-05  268) #ifdef CONFIG_DYNAMIC_FTRACE
> 673feb9d7 Steven Rostedt (VMware   2017-06-23  269) 	/* All of these are protected by the ftrace_lock */
> 04ec7bb64 Steven Rostedt (VMware   2017-04-05  270) 	struct list_head	func_probes;
> 673feb9d7 Steven Rostedt (VMware   2017-06-23  271) 	struct list_head	mod_trace;
> 673feb9d7 Steven Rostedt (VMware   2017-06-23  272) 	struct list_head	mod_notrace;
> 04ec7bb64 Steven Rostedt (VMware   2017-04-05  273) #endif
> f20a58062 Steven Rostedt (Red Hat  2013-11-07  274) 	/* function tracing enabled */
> f20a58062 Steven Rostedt (Red Hat  2013-11-07  275) 	int			function_enabled;
> f20a58062 Steven Rostedt (Red Hat  2013-11-07  276) #endif
> 00b414529 Tom Zanussi              2018-01-15  277  	int			time_stamp_abs_ref;
> 067fe038e Tom Zanussi              2018-01-15  278  	struct list_head	hist_vars;
> bc0c38d13 Steven Rostedt           2008-05-12  279  };
> bc0c38d13 Steven Rostedt           2008-05-12  280  
> 
> :::::: The code at line 243 was first introduced by commit
> :::::: 7f1d2f8210195c8c309d424a77dbf06a6d2186f4 tracing: Rename ftrace_event_file to trace_event_file
> 
> :::::: TO: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
> :::::: CC: Steven Rostedt <rostedt@goodmis.org>
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/3] sh: Rename NR_syscalls macro to __NR_syscalls
  2018-08-10 19:38     ` Steven Rostedt
@ 2018-09-18  9:06       ` Firoz Khan
  0 siblings, 0 replies; 7+ messages in thread
From: Firoz Khan @ 2018-09-18  9:06 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: kbuild test robot, kbuild-all, linux-sh, Yoshinori Sato,
	Rich Felker, Ingo Molnar, Greg Kroah-Hartman,
	Philippe Ombredanne, Thomas Gleixner, Kate Stewart,
	y2038 Mailman List, Linux Kernel Mailing List, Linux-Arch,
	Arnd Bergmann, Deepa Dinamani, Marcin Juszkiewicz

On 11 August 2018 at 01:08, Steven Rostedt <rostedt@goodmis.org> wrote:
> On Thu, 9 Aug 2018 20:58:58 +0800
> kbuild test robot <lkp@intel.com> wrote:
>
>> Hi Firoz,
>>
>> Thank you for the patch! Yet something to improve:
>>
>> [auto build test ERROR on linus/master]
>> [also build test ERROR on v4.18-rc8 next-20180808]
>> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>>
>> url:    https://github.com/0day-ci/linux/commits/Firoz-Khan/sh-Rename-NR_syscalls-macro-to-__NR_syscalls/20180809-171759
>> config: sh-allmodconfig (attached as .config)
>> compiler: sh4-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
>> reproduce:
>>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>>         chmod +x ~/bin/make.cross
>>         # save the attached .config to linux build tree
>>         GCC_VERSION=7.2.0 make.cross ARCH=sh
>>
>> All errors (new ones prefixed by >>):
>>
>>    In file included from kernel/trace/trace_selftest_dynamic.c:3:0:
>> >> kernel/trace/trace.h:243:53: error: 'NR_syscalls' undeclared here (not in a function); did you mean '__NR_syscalls'?
>>      struct trace_event_file __rcu *enter_syscall_files[NR_syscalls];
>>                                                         ^~~~~~~~~~~
>>                                                         __NR_syscalls
>> --
>>    In file included from kernel/trace/trace_output.h:6:0,
>>                     from kernel/trace/trace_syscalls.c:12:
>> >> kernel/trace/trace.h:243:53: error: 'NR_syscalls' undeclared here (not in a function); did you mean '__NR_syscalls'?
>>      struct trace_event_file __rcu *enter_syscall_files[NR_syscalls];
>>                                                         ^~~~~~~~~~~
>>                                                         __NR_syscalls
>
> Most archs have a:
>
> #define NR_syscalls __NR_syscalls

Thanks for your reply!
Sorry for the delayed response :(

Yes. I'll add this change in the next version of the patch series.

- Firoz

>
>>    In file included from include/linux/smp.h:11:0,
>>                     from include/linux/tracepoint.h:17,
>>                     from include/trace/syscall.h:5,
>>                     from kernel/trace/trace_syscalls.c:2:
>>    kernel/trace/trace_syscalls.c:559:23: warning: 'enabled_perf_exit_syscalls' defined but not used [-Wunused-variable]
>>     static DECLARE_BITMAP(enabled_perf_exit_syscalls, NR_syscalls);
>>                           ^
>>    include/linux/types.h:11:16: note: in definition of macro 'DECLARE_BITMAP'
>>      unsigned long name[BITS_TO_LONGS(bits)]
>>                    ^~~~
>>    kernel/trace/trace_syscalls.c:558:23: warning: 'enabled_perf_enter_syscalls' defined but not used [-Wunused-variable]
>>     static DECLARE_BITMAP(enabled_perf_enter_syscalls, NR_syscalls);
>>                           ^
>>    include/linux/types.h:11:16: note: in definition of macro 'DECLARE_BITMAP'
>>      unsigned long name[BITS_TO_LONGS(bits)]
>>                    ^~~~
>>
>> vim +243 kernel/trace/trace.h
>>
>> 490901078 Steven Rostedt (Red Hat  2015-09-24  196)
>> bc0c38d13 Steven Rostedt           2008-05-12  197  /*
>> bc0c38d13 Steven Rostedt           2008-05-12  198   * The trace array - an array of per-CPU trace arrays. This is the
>> bc0c38d13 Steven Rostedt           2008-05-12  199   * highest level data structure that individual tracers deal with.
>> bc0c38d13 Steven Rostedt           2008-05-12  200   * They have on/off state as well:
>> bc0c38d13 Steven Rostedt           2008-05-12  201   */
>> bc0c38d13 Steven Rostedt           2008-05-12  202  struct trace_array {
>> ae63b31e4 Steven Rostedt           2012-05-03  203    struct list_head        list;
>> 277ba0446 Steven Rostedt           2012-08-03  204    char                    *name;
>> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  205)   struct trace_buffer     trace_buffer;
>> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  206) #ifdef CONFIG_TRACER_MAX_TRACE
>> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  207)   /*
>> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  208)    * The max_buffer is used to snapshot the trace when a maximum
>> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  209)    * latency is reached, or when the user initiates a snapshot.
>> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  210)    * Some tracers will use this to store a maximum trace while
>> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  211)    * it continues examining live traces.
>> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  212)    *
>> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  213)    * The buffers for the max_buffer are set up the same as the trace_buffer
>> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  214)    * When a snapshot is taken, the buffer of the max_buffer is swapped
>> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  215)    * with the buffer of the trace_buffer and the buffers are reset for
>> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  216)    * the trace_buffer so the tracing can continue.
>> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  217)    */
>> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  218)   struct trace_buffer     max_buffer;
>> 45ad21ca5 Steven Rostedt (Red Hat  2013-03-05  219)   bool                    allocated_snapshot;
>> f971cc9aa Steven Rostedt (Red Hat  2016-09-07  220) #endif
>> f971cc9aa Steven Rostedt (Red Hat  2016-09-07  221) #if defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER)
>> 6d9b3fa5e Steven Rostedt (Red Hat  2014-01-14  222)   unsigned long           max_latency;
>> 12883efb6 Steven Rostedt (Red Hat  2013-03-05  223) #endif
>> 490901078 Steven Rostedt (Red Hat  2015-09-24  224)   struct trace_pid_list   __rcu *filtered_pids;
>> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  225)   /*
>> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  226)    * max_lock is used to protect the swapping of buffers
>> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  227)    * when taking a max snapshot. The buffers themselves are
>> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  228)    * protected by per_cpu spinlocks. But the action of the swap
>> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  229)    * needs its own lock.
>> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  230)    *
>> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  231)    * This is defined as a arch_spinlock_t in order to help
>> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  232)    * with performance when lockdep debugging is enabled.
>> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  233)    *
>> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  234)    * It is also used in other places outside the update_max_tr
>> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  235)    * so it needs to be defined outside of the
>> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  236)    * CONFIG_TRACER_MAX_TRACE.
>> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  237)    */
>> 0b9b12c1b Steven Rostedt (Red Hat  2014-01-14  238)   arch_spinlock_t         max_lock;
>> 499e54705 Steven Rostedt           2012-02-22  239    int                     buffer_disabled;
>> 12ab74ee0 Steven Rostedt           2012-08-08  240  #ifdef CONFIG_FTRACE_SYSCALLS
>> 12ab74ee0 Steven Rostedt           2012-08-08  241    int                     sys_refcount_enter;
>> 12ab74ee0 Steven Rostedt           2012-08-08  242    int                     sys_refcount_exit;
>> 7f1d2f821 Steven Rostedt (Red Hat  2015-05-05 @243)   struct trace_event_file __rcu *enter_syscall_files[NR_syscalls];
>> 7f1d2f821 Steven Rostedt (Red Hat  2015-05-05  244)   struct trace_event_file __rcu *exit_syscall_files[NR_syscalls];
>> 12ab74ee0 Steven Rostedt           2012-08-08  245  #endif
>> 2b6080f28 Steven Rostedt           2012-05-11  246    int                     stop_count;
>> 2b6080f28 Steven Rostedt           2012-05-11  247    int                     clock_id;
>> 37aea98b8 Steven Rostedt (Red Hat  2015-09-30  248)   int                     nr_topts;
>> 065e63f95 Steven Rostedt (VMware   2017-08-31  249)   bool                    clear_trace;
>> 2b6080f28 Steven Rostedt           2012-05-11  250    struct tracer           *current_trace;
>> 983f938ae Steven Rostedt (Red Hat  2015-09-30  251)   unsigned int            trace_flags;
>> 9a38a8856 Steven Rostedt (Red Hat  2015-09-30  252)   unsigned char           trace_flags_index[TRACE_FLAGS_MAX_SIZE];
>> ae63b31e4 Steven Rostedt           2012-05-03  253    unsigned int            flags;
>> 2b6080f28 Steven Rostedt           2012-05-11  254    raw_spinlock_t          start_lock;
>> ae63b31e4 Steven Rostedt           2012-05-03  255    struct dentry           *dir;
>> 2b6080f28 Steven Rostedt           2012-05-11  256    struct dentry           *options;
>> 2b6080f28 Steven Rostedt           2012-05-11  257    struct dentry           *percpu_dir;
>> ae63b31e4 Steven Rostedt           2012-05-03  258    struct dentry           *event_dir;
>> 37aea98b8 Steven Rostedt (Red Hat  2015-09-30  259)   struct trace_options    *topts;
>> ae63b31e4 Steven Rostedt           2012-05-03  260    struct list_head        systems;
>> ae63b31e4 Steven Rostedt           2012-05-03  261    struct list_head        events;
>> 3dd809536 Steven Rostedt (VMware   2018-05-09  262)   struct trace_event_file *trace_marker_file;
>> ccfe9e42e Alexander Z Lam          2013-08-08  263    cpumask_var_t           tracing_cpumask; /* only trace on set CPUs */
>> a695cb581 Steven Rostedt (Red Hat  2013-03-06  264)   int                     ref;
>> f20a58062 Steven Rostedt (Red Hat  2013-11-07  265) #ifdef CONFIG_FUNCTION_TRACER
>> f20a58062 Steven Rostedt (Red Hat  2013-11-07  266)   struct ftrace_ops       *ops;
>> 345ddcc88 Steven Rostedt (Red Hat  2016-04-22  267)   struct trace_pid_list   __rcu *function_pids;
>> 04ec7bb64 Steven Rostedt (VMware   2017-04-05  268) #ifdef CONFIG_DYNAMIC_FTRACE
>> 673feb9d7 Steven Rostedt (VMware   2017-06-23  269)   /* All of these are protected by the ftrace_lock */
>> 04ec7bb64 Steven Rostedt (VMware   2017-04-05  270)   struct list_head        func_probes;
>> 673feb9d7 Steven Rostedt (VMware   2017-06-23  271)   struct list_head        mod_trace;
>> 673feb9d7 Steven Rostedt (VMware   2017-06-23  272)   struct list_head        mod_notrace;
>> 04ec7bb64 Steven Rostedt (VMware   2017-04-05  273) #endif
>> f20a58062 Steven Rostedt (Red Hat  2013-11-07  274)   /* function tracing enabled */
>> f20a58062 Steven Rostedt (Red Hat  2013-11-07  275)   int                     function_enabled;
>> f20a58062 Steven Rostedt (Red Hat  2013-11-07  276) #endif
>> 00b414529 Tom Zanussi              2018-01-15  277    int                     time_stamp_abs_ref;
>> 067fe038e Tom Zanussi              2018-01-15  278    struct list_head        hist_vars;
>> bc0c38d13 Steven Rostedt           2008-05-12  279  };
>> bc0c38d13 Steven Rostedt           2008-05-12  280
>>
>> :::::: The code at line 243 was first introduced by commit
>> :::::: 7f1d2f8210195c8c309d424a77dbf06a6d2186f4 tracing: Rename ftrace_event_file to trace_event_file
>>
>> :::::: TO: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
>> :::::: CC: Steven Rostedt <rostedt@goodmis.org>
>>
>> ---
>> 0-DAY kernel test infrastructure                Open Source Technology Center
>> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-09-18  9:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-09  5:36 [PATCH 0/3] System call table generation support Firoz Khan
2018-08-09  5:36 ` [PATCH 1/3] sh: Rename NR_syscalls macro to __NR_syscalls Firoz Khan
2018-08-09 12:58   ` kbuild test robot
2018-08-10 19:38     ` Steven Rostedt
2018-09-18  9:06       ` Firoz Khan
2018-08-09  5:36 ` [PATCH 2/3] sh: Added system call table generation support Firoz Khan
2018-08-09  5:36 ` [PATCH 3/3] sh: uapi header and system call table file generation Firoz Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).