33 lines · plain
1#!/bin/sh2# SPDX-License-Identifier: GPL-2.03#4# Generate system call table for perf5#6# Copyright IBM Corp. 2017, 20187# Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com>8#9 10SYSCALL_TBL=$111 12if ! test -r $SYSCALL_TBL; then13 echo "Could not read input file" >&214 exit 115fi16 17create_table()18{19 local max_nr nr abi sc discard20 21 echo 'static const char *const syscalltbl_s390_64[] = {'22 while read nr abi sc discard; do23 printf '\t[%d] = "%s",\n' $nr $sc24 max_nr=$nr25 done26 echo '};'27 echo "#define SYSCALLTBL_S390_64_MAX_ID $max_nr"28}29 30grep -E "^[[:digit:]]+[[:space:]]+(common|64)" $SYSCALL_TBL \31 |sort -k1 -n \32 |create_table33