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
This commit is contained in:
parent
5249ac8610
commit
493b584dbd
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=227441
File diff suppressed because it is too large
Load Diff
@ -213,6 +213,7 @@ systrace_probe(u_int32_t id, int sysnum, struct sysent *sysent, void *params,
|
||||
/* Process the probe using the converted argments. */
|
||||
dtrace_probe(id, uargs[0], uargs[1], uargs[2], uargs[3], uargs[4]);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void
|
||||
@ -220,8 +221,12 @@ systrace_getargdesc(void *arg, dtrace_id_t id, void *parg, dtrace_argdesc_t *des
|
||||
{
|
||||
int sysnum = SYSTRACE_SYSNUM((uintptr_t)parg);
|
||||
|
||||
systrace_setargdesc(sysnum, desc->dtargd_ndx, desc->dtargd_native,
|
||||
sizeof(desc->dtargd_native));
|
||||
if (SYSTRACE_ISENTRY((uintptr_t)parg))
|
||||
systrace_entry_setargdesc(sysnum, desc->dtargd_ndx,
|
||||
desc->dtargd_native, sizeof(desc->dtargd_native));
|
||||
else
|
||||
systrace_return_setargdesc(sysnum, desc->dtargd_ndx,
|
||||
desc->dtargd_native, sizeof(desc->dtargd_native));
|
||||
|
||||
if (desc->dtargd_native[0] == '\0')
|
||||
desc->dtargd_ndx = DTRACE_ARGNONE;
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user