Fix: lttng modules system call generation script
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 22 May 2014 12:06:10 +0000 (08:06 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 22 May 2014 12:06:10 +0000 (08:06 -0400)
Fixes #771

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
instrumentation/syscalls/3.10.0-rc7/x86-64-syscalls-3.10.0-rc7
instrumentation/syscalls/README
instrumentation/syscalls/lttng-syscalls-generate-headers.sh

index d9f81c0f2127c910476d4e164ed27e384f326f21..5db1a4f1dca50c0e2427ed0808aa99708377646a 100644 (file)
@@ -287,4 +287,3 @@ syscall sys_getcpu nr 309 nbargs 3 types: (unsigned *, unsigned *, struct getcpu
 syscall sys_process_vm_readv nr 310 nbargs 6 types: (pid_t, const struct iovec *, unsigned long, const struct iovec *, unsigned long, unsigned long) args: (pid, lvec, liovcnt, rvec, riovcnt, flags)
 syscall sys_process_vm_writev nr 311 nbargs 6 types: (pid_t, const struct iovec *, unsigned long, const struct iovec *, unsigned long, unsigned long) args: (pid, lvec, liovcnt, rvec, riovcnt, flags)
 syscall sys_finit_module nr 313 nbargs 3 types: (int, const char *, int) args: (fd, uargs, flags)
-SUCCESS
index 1e9bec49c5e3a207fb5597030f6657e147d97069..a2a66fa038ae48ce0d43f82a1d1c8701aa06c289 100644 (file)
@@ -10,9 +10,25 @@ is expected). See the dmesg output for system call metadata.
 
 2) Generate system call TRACE_EVENT().
 
-Take the dmesg metadata and feed it to lttng-syscalls-generate-headers.sh, e.g.,
-from the instrumentation/syscalls directory. See the script header for
-usage example. It should be run for both the integers and pointers types.
+Take the dmesg metadata and feed it to lttng-syscalls-generate-headers.sh
+(do not include the ending SUCCESS line), e.g., from the
+instrumentation/syscalls directory. See the script header for usage example.
+It should be run for both the integers and pointers types.
 
 After these are created, we just need to follow the new system call additions,
 no need to regenerate the whole thing, since system calls are only appended to.
+
+3) Override headers
+
+You need to provide override headers (even if they don't contain
+overrides) for each architecture. Those are meant to contain manual
+overrides for specific system calls for cases where the script do not
+generate the correct typing for specific system calls.
+
+4) Integrating the new architecture, updating architecture header
+
+Edit instrumentation/syscalls/headers/syscalls_integers.h and
+syscalls_pointers.h. Add the new architecture
+(e.g. CONFIG_X86_64) to the newly-generated headers
+(e.g. changing the current x86-64-syscalls-3.10.0-rc7_<CLASS>.h into
+x86-64-syscalls-3.13.7_<CLASS>.h), then rebuild lttng-modules.
index 4ab4599befc16479465b4a8b5557ede22a3f9da0..a0ae0f2a2405ce30c7b2971fc3c92df5ae7aea50 100755 (executable)
@@ -19,6 +19,21 @@ SRCFILE=gen.tmp.0
 TMPFILE=gen.tmp.1
 HEADER=headers/${INPUTFILE}_${CLASS}.h
 
+if [ x"$INPUTDIR" = x"" ]; then
+       echo "Error: Please specify input directory as second argument"
+       exit 1
+fi
+
+if [ x"$INPUTFILE" = x"" ]; then
+       echo "Error: Please specify input file as third argument"
+       exit 1
+fi
+
+if [ x"$BITNESS" != x"32" ] && [ x"$BITNESS" != x"64" ]; then
+       echo "Error: Please specify bitness as fourth argument (\"32\" or \"64\")"
+       exit 1
+fi
+
 cp ${INPUT} ${SRCFILE}
 
 #Cleanup
@@ -45,6 +60,12 @@ if [ "$CLASS" = pointers ]; then
        mv ${TMPFILE} ${SRCFILE}
 fi
 
+if [ x"$CLASSCAP" = x"" ]; then
+       echo "Error: Please specify \"integers\" or \"pointers\" as first argument"
+       rm -f ${SRCFILE}
+       exit 1
+fi
+
 echo "/* THIS FILE IS AUTO-GENERATED. DO NOT EDIT */" > ${HEADER}
 
 echo \
@@ -68,7 +89,7 @@ printf \
 '      TP_STRUCT__entry(),\n'\
 '      TP_fast_assign(),\n'\
 '      TP_printk()\n'\
-')'\
+')\n'\
        >> ${HEADER}
 
 grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " ${SRCFILE} > ${TMPFILE}
@@ -201,11 +222,6 @@ perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) '\
 
 # Macro for tracing syscall table
 
-rm -f ${TMPFILE}
-for NRARGS in $(seq 0 6); do
-       grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " ${SRCFILE} >> ${TMPFILE}
-done
-
 echo \
 "
 #endif /*  _TRACE_SYSCALLS_${CLASSCAP}_H */
This page took 0.027627 seconds and 4 git commands to generate.