syscall detail: add override capability
[lttng-modules.git] / instrumentation / syscalls / lttng-syscalls-generate-headers.sh
index f9746f5ca0b2667316f97d4e7090ff7dd289cc89..e90f5ed4d57a041ac31b3176815b5426bcce2e2d 100644 (file)
@@ -53,6 +53,7 @@ echo \
 
 #include <linux/tracepoint.h>
 #include <linux/syscalls.h>
+#include \"${INPUTFILE}_${CLASS}_override.h\"
 " >> ${HEADER}
 
 if [ "$CLASS" = integers ]; then
@@ -71,8 +72,9 @@ grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " ${SRCFILE} > ${TMPFILE}
 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
@@ -86,13 +88,15 @@ grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " ${SRCFILE} > ${TMPFILE}
 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
@@ -103,13 +107,15 @@ grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " ${SRCFILE} > ${TMPFILE}
 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
@@ -120,13 +126,15 @@ grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " ${SRCFILE} > ${TMPFILE}
 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}
 
 
@@ -138,13 +146,15 @@ grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " ${SRCFILE} > ${TMPFILE}
 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
@@ -155,13 +165,15 @@ grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " ${SRCFILE} > ${TMPFILE}
 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}
 
 
@@ -173,13 +185,15 @@ grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " ${SRCFILE} > ${TMPFILE}
 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
This page took 0.025619 seconds and 4 git commands to generate.