2017-12-07 15:27:59 +07:00
|
|
|
#!/bin/sh
|
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
#
|
|
|
|
# Generate system call table for perf
|
|
|
|
#
|
2018-02-08 18:47:50 +07:00
|
|
|
# Copyright IBM Corp. 2017, 2018
|
2017-12-07 15:27:59 +07:00
|
|
|
# Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
|
|
|
|
#
|
|
|
|
|
2018-02-08 18:47:50 +07:00
|
|
|
SYSCALL_TBL=$1
|
2017-12-07 15:27:59 +07:00
|
|
|
|
2018-02-08 18:47:50 +07:00
|
|
|
if ! test -r $SYSCALL_TBL; then
|
2017-12-07 15:27:59 +07:00
|
|
|
echo "Could not read input file" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
create_table()
|
|
|
|
{
|
2018-02-08 18:47:50 +07:00
|
|
|
local max_nr nr abi sc discard
|
2017-12-07 15:27:59 +07:00
|
|
|
|
|
|
|
echo 'static const char *syscalltbl_s390_64[] = {'
|
2018-02-08 18:47:50 +07:00
|
|
|
while read nr abi sc discard; do
|
2017-12-07 15:27:59 +07:00
|
|
|
printf '\t[%d] = "%s",\n' $nr $sc
|
|
|
|
max_nr=$nr
|
|
|
|
done
|
|
|
|
echo '};'
|
|
|
|
echo "#define SYSCALLTBL_S390_64_MAX_ID $max_nr"
|
|
|
|
}
|
|
|
|
|
2018-02-08 18:47:50 +07:00
|
|
|
grep -E "^[[:digit:]]+[[:space:]]+(common|64)" $SYSCALL_TBL \
|
|
|
|
|sort -k1 -n \
|
2017-12-07 15:27:59 +07:00
|
|
|
|create_table
|