#include <linux/tracepoint.h>
#include <linux/syscalls.h>
+#include \"${INPUTFILE}_${CLASS}_override.h\"
" >> ${HEADER}
if [ "$CLASS" = integers ]; then
perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) '\
'types: \(([^)]*)\) '\
'args: \(([^)]*)\)/'\
-'DEFINE_EVENT_NOARGS(syscalls_noargs, sys_$1)'\
-'/g'\
+'#ifndef OVERRIDE_sys_$1\n'\
+'DEFINE_EVENT_NOARGS(syscalls_noargs, sys_$1)\n'\
+'#endif/g'\
${TMPFILE} >> ${HEADER}
fi
perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) '\
'types: \(([^)]*)\) '\
'args: \(([^)]*)\)/'\
+'#ifndef OVERRIDE_sys_$1\n'\
'TRACE_EVENT(sys_$1,\n'\
' TP_PROTO($4 $5),\n'\
' TP_ARGS($5),\n'\
' TP_STRUCT__entry(__field($4, $5)),\n'\
' TP_fast_assign(tp_assign($5, $5)),\n'\
' TP_printk()\n'\
-')/g'\
+')\n'\
+'#endif/g'\
${TMPFILE} >> ${HEADER}
# types: 4 5
perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) '\
'types: \(([^,]*), ([^)]*)\) '\
'args: \(([^,]*), ([^)]*)\)/'\
+'#ifndef OVERRIDE_sys_$1\n'\
'TRACE_EVENT(sys_$1,\n'\
' TP_PROTO($4 $6, $5 $7),\n'\
' TP_ARGS($6, $7),\n'\
' TP_STRUCT__entry(__field($4, $6) __field($5, $7)),\n'\
' TP_fast_assign(tp_assign($6, $6) tp_assign($7, $7)),\n'\
' TP_printk()\n'\
-')/g'\
+')\n'\
+'#endif/g'\
${TMPFILE} >> ${HEADER}
# types: 4 5 6
perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) '\
'types: \(([^,]*), ([^,]*), ([^)]*)\) '\
'args: \(([^,]*), ([^,]*), ([^)]*)\)/'\
+'#ifndef OVERRIDE_sys_$1\n'\
'TRACE_EVENT(sys_$1,\n'\
' TP_PROTO($4 $7, $5 $8, $6 $9),\n'\
' TP_ARGS($7, $8, $9),\n'\
' TP_STRUCT__entry(__field($4, $7) __field($5, $8) __field($6, $9)),\n'\
' TP_fast_assign(tp_assign($7, $7) tp_assign($8, $8) tp_assign($9, $9)),\n'\
' TP_printk()\n'\
-')/g'\
+')\n'\
+'#endif/g'\
${TMPFILE} >> ${HEADER}
perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) '\
'types: \(([^,]*), ([^,]*), ([^,]*), ([^)]*)\) '\
'args: \(([^,]*), ([^,]*), ([^,]*), ([^)]*)\)/'\
+'#ifndef OVERRIDE_sys_$1\n'\
'TRACE_EVENT(sys_$1,\n'\
' TP_PROTO($4 $8, $5 $9, $6 $10, $7 $11),\n'\
' TP_ARGS($8, $9, $10, $11),\n'\
' TP_STRUCT__entry(__field($4, $8) __field($5, $9) __field($6, $10) __field($7, $11)),\n'\
' TP_fast_assign(tp_assign($8, $8) tp_assign($9, $9) tp_assign($10, $10) tp_assign($11, $11)),\n'\
' TP_printk()\n'\
-')/g'\
+')\n'\
+'#endif/g'\
${TMPFILE} >> ${HEADER}
# types: 4 5 6 7 8
perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) '\
'types: \(([^,]*), ([^,]*), ([^,]*), ([^,]*), ([^)]*)\) '\
'args: \(([^,]*), ([^,]*), ([^,]*), ([^,]*), ([^)]*)\)/'\
+'#ifndef OVERRIDE_sys_$1\n'\
'TRACE_EVENT(sys_$1,\n'\
' TP_PROTO($4 $9, $5 $10, $6 $11, $7 $12, $8 $13),\n'\
' TP_ARGS($9, $10, $11, $12, $13),\n'\
' TP_STRUCT__entry(__field($4, $9) __field($5, $10) __field($6, $11) __field($7, $12) __field($8, $13)),\n'\
' TP_fast_assign(tp_assign($9, $9) tp_assign($10, $10) tp_assign($11, $11) tp_assign($12, $12) tp_assign($13, $13)),\n'\
' TP_printk()\n'\
-')/g'\
+')\n'\
+'#endif/g'\
${TMPFILE} >> ${HEADER}
perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) '\
'types: \(([^,]*), ([^,]*), ([^,]*), ([^,]*), ([^,]*), ([^\)]*)\) '\
'args: \(([^,]*), ([^,]*), ([^,]*), ([^,]*), ([^,]*), ([^\)]*)\)/'\
+'#ifndef OVERRIDE_sys_$1\n'\
'TRACE_EVENT(sys_$1,\n'\
' TP_PROTO($4 $10, $5 $11, $6 $12, $7 $13, $8 $14, $9 $15),\n'\
' TP_ARGS($10, $11, $12, $13, $14, $15),\n'\
' TP_STRUCT__entry(__field($4, $10) __field($5, $11) __field($6, $12) __field($7, $13) __field($8, $14) __field($9, $15)),\n'\
' TP_fast_assign(tp_assign($10, $10) tp_assign($11, $11) tp_assign($12, $12) tp_assign($13, $13) tp_assign($14, $14) tp_assign($15, $15)),\n'\
' TP_printk()\n'\
-')/g'\
+')\n'\
+'#endif/g'\
${TMPFILE} >> ${HEADER}
# Macro for tracing syscall table