Merge tag 'powerpc-5.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[linux/fpc-iii.git] / tools / perf / arch / s390 / entry / syscalls / mksyscalltbl
blob72ecbb67637079f709262298981162b6cbb12c9f
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0
4 # Generate system call table for perf
6 # Copyright IBM Corp. 2017, 2018
7 # Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
10 SYSCALL_TBL=$1
12 if ! test -r $SYSCALL_TBL; then
13 echo "Could not read input file" >&2
14 exit 1
17 create_table()
19 local max_nr nr abi sc discard
21 echo 'static const char *syscalltbl_s390_64[] = {'
22 while read nr abi sc discard; do
23 printf '\t[%d] = "%s",\n' $nr $sc
24 max_nr=$nr
25 done
26 echo '};'
27 echo "#define SYSCALLTBL_S390_64_MAX_ID $max_nr"
30 grep -E "^[[:digit:]]+[[:space:]]+(common|64)" $SYSCALL_TBL \
31 |sort -k1 -n \
32 |create_table