Gather detailed info from x86 64 32-bit compat syscall instrumentation
[lttng-modules.git] / instrumentation / syscalls / lttng-syscalls-generate-headers.sh
index c6636e7688da16f562d0b32ffe067bc757c9d2c2..5eddb2746801eb38612eb7e9452e677a2c36ae4e 100644 (file)
@@ -3,12 +3,13 @@
 # Generate system call probe description macros from syscall metadata dump file.
 # example usage:
 #
-# lttng-syscalls-generate-headers.sh integers 3.0.4 x86-64-syscalls-3.0.4
-# lttng-syscalls-generate-headers.sh pointers 3.0.4 x86-64-syscalls-3.0.4
+# lttng-syscalls-generate-headers.sh integers 3.0.4 x86-64-syscalls-3.0.4 64
+# lttng-syscalls-generate-headers.sh pointers 3.0.4 x86-64-syscalls-3.0.4 64
 
 CLASS=$1
 INPUTDIR=$2
 INPUTFILE=$3
+BITNESS=$4
 INPUT=${INPUTDIR}/${INPUTFILE}
 SRCFILE=gen.tmp.0
 TMPFILE=gen.tmp.1
@@ -51,6 +52,7 @@ echo \
 #include <linux/tracepoint.h>
 #include <linux/syscalls.h>
 #include \"${INPUTFILE}_${CLASS}_override.h\"
+#include \"syscalls_${CLASS}_override.h\"
 " >> ${HEADER}
 
 if [ "$CLASS" = integers ]; then
@@ -69,7 +71,7 @@ grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " ${SRCFILE} > ${TMPFILE}
 perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) '\
 'types: \(([^)]*)\) '\
 'args: \(([^)]*)\)/'\
-'#ifndef OVERRIDE_sys_$1\n'\
+'#ifndef OVERRIDE_'"${BITNESS}"'_sys_$1\n'\
 'SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_$1)\n'\
 '#endif/g'\
        ${TMPFILE} >> ${HEADER}
@@ -85,7 +87,7 @@ grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " ${SRCFILE} > ${TMPFILE}
 perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) '\
 'types: \(([^)]*)\) '\
 'args: \(([^)]*)\)/'\
-'#ifndef OVERRIDE_sys_$1\n'\
+'#ifndef OVERRIDE_'"${BITNESS}"'_sys_$1\n'\
 'SC_TRACE_EVENT(sys_$1,\n'\
 '      TP_PROTO($4 $5),\n'\
 '      TP_ARGS($5),\n'\
@@ -104,7 +106,7 @@ grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " ${SRCFILE} > ${TMPFILE}
 perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) '\
 'types: \(([^,]*), ([^)]*)\) '\
 'args: \(([^,]*), ([^)]*)\)/'\
-'#ifndef OVERRIDE_sys_$1\n'\
+'#ifndef OVERRIDE_'"${BITNESS}"'_sys_$1\n'\
 'SC_TRACE_EVENT(sys_$1,\n'\
 '      TP_PROTO($4 $6, $5 $7),\n'\
 '      TP_ARGS($6, $7),\n'\
@@ -123,7 +125,7 @@ grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " ${SRCFILE} > ${TMPFILE}
 perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) '\
 'types: \(([^,]*), ([^,]*), ([^)]*)\) '\
 'args: \(([^,]*), ([^,]*), ([^)]*)\)/'\
-'#ifndef OVERRIDE_sys_$1\n'\
+'#ifndef OVERRIDE_'"${BITNESS}"'_sys_$1\n'\
 'SC_TRACE_EVENT(sys_$1,\n'\
 '      TP_PROTO($4 $7, $5 $8, $6 $9),\n'\
 '      TP_ARGS($7, $8, $9),\n'\
@@ -143,7 +145,7 @@ grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " ${SRCFILE} > ${TMPFILE}
 perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) '\
 'types: \(([^,]*), ([^,]*), ([^,]*), ([^)]*)\) '\
 'args: \(([^,]*), ([^,]*), ([^,]*), ([^)]*)\)/'\
-'#ifndef OVERRIDE_sys_$1\n'\
+'#ifndef OVERRIDE_'"${BITNESS}"'_sys_$1\n'\
 'SC_TRACE_EVENT(sys_$1,\n'\
 '      TP_PROTO($4 $8, $5 $9, $6 $10, $7 $11),\n'\
 '      TP_ARGS($8, $9, $10, $11),\n'\
@@ -162,7 +164,7 @@ grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " ${SRCFILE} > ${TMPFILE}
 perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) '\
 'types: \(([^,]*), ([^,]*), ([^,]*), ([^,]*), ([^)]*)\) '\
 'args: \(([^,]*), ([^,]*), ([^,]*), ([^,]*), ([^)]*)\)/'\
-'#ifndef OVERRIDE_sys_$1\n'\
+'#ifndef OVERRIDE_'"${BITNESS}"'_sys_$1\n'\
 'SC_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'\
@@ -182,7 +184,7 @@ grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " ${SRCFILE} > ${TMPFILE}
 perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) '\
 'types: \(([^,]*), ([^,]*), ([^,]*), ([^,]*), ([^,]*), ([^\)]*)\) '\
 'args: \(([^,]*), ([^,]*), ([^,]*), ([^,]*), ([^,]*), ([^\)]*)\)/'\
-'#ifndef OVERRIDE_sys_$1\n'\
+'#ifndef OVERRIDE_'"${BITNESS}"'_sys_$1\n'\
 'SC_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'\
@@ -210,6 +212,7 @@ echo \
 #else /* CREATE_SYSCALL_TABLE */
 
 #include \"${INPUTFILE}_${CLASS}_override.h\"
+#include \"syscalls_${CLASS}_override.h\"
 " >> ${HEADER}
 
 NRARGS=0
@@ -218,7 +221,7 @@ if [ "$CLASS" = integers ]; then
 #noargs
 grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " ${SRCFILE} > ${TMPFILE}
 perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) .*$/'\
-'#ifndef OVERRIDE_TABLE_sys_$1\n'\
+'#ifndef OVERRIDE_TABLE_'"${BITNESS}"'_sys_$1\n'\
 'TRACE_SYSCALL_TABLE\(syscalls_noargs, sys_$1, $2, $3\)\n'\
 '#endif/g'\
        ${TMPFILE} >> ${HEADER}
@@ -227,7 +230,7 @@ fi
 #others.
 grep -v "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " ${SRCFILE} > ${TMPFILE}
 perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) .*$/'\
-'#ifndef OVERRIDE_TABLE_sys_$1\n'\
+'#ifndef OVERRIDE_TABLE_'"${BITNESS}"'_sys_$1\n'\
 'TRACE_SYSCALL_TABLE(sys_$1, sys_$1, $2, $3)\n'\
 '#endif/g'\
        ${TMPFILE} >> ${HEADER}
This page took 0.024386 seconds and 4 git commands to generate.