Support generation of syscall probes for those with pointers
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 17 Sep 2011 01:47:48 +0000 (21:47 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 17 Sep 2011 01:47:48 +0000 (21:47 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
instrumentation/syscalls/lttng-syscalls-generate-headers.sh
lttng-syscalls.c
probes/lttng-events.h

index 91e282c4c9c1c62cb92b17d1efe894e4d548143a..231bd5c4929c1c7ae2bf7745393876b9046e86c8 100644 (file)
@@ -2,10 +2,13 @@
 
 # Generate system call probe description macros from syscall metadata dump file.
 # example usage:
-# lttng-syscalls-generate-headers.sh 3.0.4 x86-64-syscalls-3.0.4
+#
+# 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
 
-INPUTDIR=$1
-INPUTFILE=$2
+CLASS=$1
+INPUTDIR=$2
+INPUTFILE=$3
 INPUT=${INPUTDIR}/${INPUTFILE}
 SRCFILE=gen.tmp.0
 TMPFILE=gen.tmp.1
@@ -21,17 +24,18 @@ mv ${TMPFILE} ${SRCFILE}
 
 #Filter
 
-#select only syscalls we currently support
-#move non-pointers with and without arguments to a integer-only file.
-CLASS=integers
-grep -v "\\*\|cap_user_header_t" ${SRCFILE} > ${TMPFILE}
-mv ${TMPFILE} ${SRCFILE}
+if [ "$CLASS" = integers ]; then
+       #select integers and no-args.
+       grep -v "\\*\|cap_user_header_t" ${SRCFILE} > ${TMPFILE}
+       mv ${TMPFILE} ${SRCFILE}
+fi
+
 
-#TODO
-# move all system calls using pointers to a separate file.
-#CLASS=pointers
-#grep "\\*\|cap_#user_header_t" ${SRCFILE} > ${TMPFILE}
-#mv ${TMPFILE} ${SRCFILE}
+if [ "$CLASS" = pointers ]; then
+       #select system calls using pointers.
+       grep "\\*\|cap_#user_header_t" ${SRCFILE} > ${TMPFILE}
+       mv ${TMPFILE} ${SRCFILE}
+fi
 
 HEADER=headers/${INPUTFILE}-${CLASS}.h
 
@@ -50,6 +54,8 @@ echo \
 #include <linux/syscalls.h>
 " >> ${HEADER}
 
+if [ "$CLASS" = integers ]; then
+
 NRARGS=0
 
 echo \
@@ -68,6 +74,7 @@ sed 's/^syscall \([^ ]*\) nr \([^ ]*\) nbargs \([^ ]*\) '\
 '/g'\
        ${TMPFILE} >> ${HEADER}
 
+fi
 
 # types: 4
 # args   5
@@ -192,12 +199,14 @@ echo \
 
 
 NRARGS=0
-grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " ${SRCFILE} > ${TMPFILE}
 
+if [ "$CLASS" = integers ]; then
 #noargs
+grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " ${SRCFILE} > ${TMPFILE}
 sed 's/^syscall \([^ ]*\) nr \([^ ]*\) nbargs \([^ ]*\) .*$/'\
 'TRACE_SYSCALL_TABLE(syscalls_noargs, sys_\1, \2, \3)/g'\
        ${TMPFILE} >> ${HEADER}
+fi
 
 #others.
 grep -v "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " ${SRCFILE} > ${TMPFILE}
index 09e48c4573c4727c11dba36e7f13c20366c45f41..2a63ad5213d653d7ad7c4b57bf2f95959bc257c5 100644 (file)
@@ -50,8 +50,6 @@ struct trace_syscall_entry {
        unsigned int nrargs;
 };
 
-static int sc_table_desc_filled;
-
 #define CREATE_SYSCALL_TABLE
 
 #undef TRACE_SYSCALL_TABLE
index 022b4a8312d2363e818ac7eb6628831d467e3e4a..63bde18533a713df3d939ebbd98607e17861d64c 100644 (file)
@@ -293,7 +293,7 @@ static const struct lttng_event_desc *TP_ID(__event_desc___, TRACE_SYSTEM)[] = {
 #define TP_ID(_token, _system) TP_ID1(_token, _system)
 
 /* non-const because list head will be modified when registered. */
-static struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = {
+static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = {
        .event_desc = TP_ID(__event_desc___, TRACE_SYSTEM),
        .nr_events = ARRAY_SIZE(TP_ID(__event_desc___, TRACE_SYSTEM)),
 };
This page took 0.028709 seconds and 4 git commands to generate.