summaryrefslogtreecommitdiffstats
path: root/sys/kern/makesyscalls.sh
diff options
context:
space:
mode:
authorrstone <rstone@FreeBSD.org>2011-11-11 03:49:42 +0000
committerrstone <rstone@FreeBSD.org>2011-11-11 03:49:42 +0000
commitf6710005c7b5cbaa57962878278d7b6ee1bd22e2 (patch)
treeadc6573d0b6fbc3271e9159bd4a895d56ccd401c /sys/kern/makesyscalls.sh
parent85b2830346b20c323d2332a339c06ffca315b1b0 (diff)
downloadFreeBSD-src-f6710005c7b5cbaa57962878278d7b6ee1bd22e2.zip
FreeBSD-src-f6710005c7b5cbaa57962878278d7b6ee1bd22e2.tar.gz
Correct the types of the arguments to return probes of the syscall
provider. Previously we were erroneously supplying the argument types of the corresponding entry probe. Reviewed by: rpaulo MFC after: 1 week
Diffstat (limited to 'sys/kern/makesyscalls.sh')
-rw-r--r--sys/kern/makesyscalls.sh24
1 files changed, 20 insertions, 4 deletions
diff --git a/sys/kern/makesyscalls.sh b/sys/kern/makesyscalls.sh
index d1162b5..1f081ce 100644
--- a/sys/kern/makesyscalls.sh
+++ b/sys/kern/makesyscalls.sh
@@ -38,6 +38,7 @@ sysinc="sysinc.switch.$$"
sysarg="sysarg.switch.$$"
sysprotoend="sysprotoend.$$"
systracetmp="systrace.$$"
+systraceret="systraceret.$$"
if [ -r capabilities.conf ]; then
capenabled=`cat capabilities.conf | grep -v "^#" | grep -v "^$"`
@@ -46,9 +47,9 @@ else
capenabled=""
fi
-trap "rm $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp" 0
+trap "rm $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp $systraceret" 0
-touch $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp
+touch $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp $systraceret
case $# in
0) echo "usage: $0 input-file <config-file>" 1>&2
@@ -96,6 +97,7 @@ s/\$//g
sysmk = \"$sysmk\"
systrace = \"$systrace\"
systracetmp = \"$systracetmp\"
+ systraceret = \"$systraceret\"
compat = \"$compat\"
compat4 = \"$compat4\"
compat6 = \"$compat6\"
@@ -179,9 +181,12 @@ s/\$//g
printf "\tint64_t *iarg = (int64_t *) uarg;\n" > systrace
printf "\tswitch (sysnum) {\n" > systrace
- printf "static void\nsystrace_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)\n{\n\tconst char *p = NULL;\n" > systracetmp
+ printf "static void\nsystrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)\n{\n\tconst char *p = NULL;\n" > systracetmp
printf "\tswitch (sysnum) {\n" > systracetmp
+ printf "static void\nsystrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)\n{\n\tconst char *p = NULL;\n" > systraceret
+ printf "\tswitch (sysnum) {\n" > systraceret
+
next
}
NF == 0 || $1 ~ /^;/ {
@@ -202,6 +207,7 @@ s/\$//g
print > sysnames
print > systrace
print > systracetmp
+ print > systraceret
savesyscall = syscall
next
}
@@ -216,6 +222,7 @@ s/\$//g
print > sysnames
print > systrace
print > systracetmp
+ print > systraceret
syscall = savesyscall
next
}
@@ -230,6 +237,7 @@ s/\$//g
print > sysnames
print > systrace
print > systracetmp
+ print > systraceret
next
}
syscall != $1 {
@@ -303,7 +311,8 @@ s/\$//g
parserr($end, ")")
end--
- f++ #function return type
+ syscallret=$f
+ f++
funcname=$f
@@ -387,6 +396,7 @@ s/\$//g
parseline()
printf("\t/* %s */\n\tcase %d: {\n", funcname, syscall) > systrace
printf("\t/* %s */\n\tcase %d:\n", funcname, syscall) > systracetmp
+ printf("\t/* %s */\n\tcase %d:\n", funcname, syscall) > systraceret
if (argc > 0) {
printf("\t\tswitch(ndx) {\n") > systracetmp
printf("\t\tstruct %s *p = params;\n", argalias) > systrace
@@ -406,6 +416,10 @@ s/\$//g
argname[i], argtype[i]) > systrace
}
printf("\t\tdefault:\n\t\t\tbreak;\n\t\t};\n") > systracetmp
+
+ printf("\t\tif (ndx == 0 || ndx == 1)\n") > systraceret
+ printf("\t\t\tp = \"%s\";\n", syscallret) > systraceret
+ printf("\t\tbreak;\n") > systraceret
}
printf("\t\t*n_args = %d;\n\t\tbreak;\n\t}\n", argc) > systrace
printf("\t\tbreak;\n") > systracetmp
@@ -623,6 +637,7 @@ s/\$//g
> syshdr
printf "\tdefault:\n\t\t*n_args = 0;\n\t\tbreak;\n\t};\n}\n" > systrace
printf "\tdefault:\n\t\tbreak;\n\t};\n\tif (p != NULL)\n\t\tstrlcpy(desc, p, descsz);\n}\n" > systracetmp
+ printf "\tdefault:\n\t\tbreak;\n\t};\n\tif (p != NULL)\n\t\tstrlcpy(desc, p, descsz);\n}\n" > systraceret
} '
cat $sysinc $sysent >> $syssw
@@ -633,4 +648,5 @@ cat $sysarg $sysdcl \
$syscompat7 $syscompat7dcl \
$sysaue $sysprotoend > $sysproto
cat $systracetmp >> $systrace
+cat $systraceret >> $systrace
OpenPOWER on IntegriCloud