PERFORCE change 134819 for review
John Birrell
jb at FreeBSD.org
Mon Feb 4 21:38:06 PST 2008
http://perforce.freebsd.org/chv.cgi?CH=134819
Change 134819 by jb at jb_freebsd1 on 2008/02/05 05:37:35
Follow-up change to match the fact that entry and return probes
have the same arguments.
Affected files ...
.. //depot/projects/dtrace/src/sys/cddl/dev/systrace/systrace.c#8 edit
Differences ...
==== //depot/projects/dtrace/src/sys/cddl/dev/systrace/systrace.c#8 (text+ko) ====
@@ -75,6 +75,7 @@
static d_open_t systrace_open;
static int systrace_unload(void);
+static void systrace_getargdesc(void *, dtrace_id_t, void *, dtrace_argdesc_t *);
static void systrace_args(int, void *, u_int64_t *, int *);
static void systrace_probe(u_int32_t, int, struct sysent *, void *);
static void systrace_provide(void *, dtrace_probedesc_t *);
@@ -104,7 +105,7 @@
systrace_disable,
NULL,
NULL,
- NULL,
+ systrace_getargdesc,
NULL,
NULL,
systrace_destroy
@@ -119,33 +120,18 @@
*/
#include <kern/systrace_args.c>
-/* ARGSUSED */
static void
systrace_probe(u_int32_t id, int sysnum, struct sysent *sysent, void *params)
{
int n_args = 0;
u_int64_t uargs[8];
- /* Is this a return syscall? */
- if (sysent == NULL) {
- /*
- * Yes. Just convert the first two parameters which are
- * both set to the return error number.
- */
- int64_t *iargs = (int64_t *) uargs;
- int *iparams = (int *) params;
- iargs[0] = iparams[0];
- iargs[1] = iparams[1];
- uargs[2] = 0;
- uargs[3] = 0;
- uargs[4] = 0;
-
/*
* Check if this syscall has a custom argument conversion
* function registered. If so, it is a syscall registered
* by a loaded module.
*/
- } else if (sysent->sy_systrace_args_func != NULL)
+ if (sysent->sy_systrace_args_func != NULL)
/*
* Convert the syscall parameters using the registered
* function.
@@ -164,7 +150,17 @@
dtrace_probe(id, uargs[0], uargs[1], uargs[2], uargs[3], uargs[4]);
}
-/*ARGSUSED*/
+static void
+systrace_getargdesc(void *arg, dtrace_id_t id, void *parg, dtrace_argdesc_t *desc)
+{
+ int sysnum = SYSTRACE_SYSNUM((uintptr_t)parg);
+
+ systrace_setargdesc(sysnum, desc->dtargd_ndx, desc->dtargd_native,
+ sizeof(desc->dtargd_native));
+
+ return;
+}
+
static void
systrace_provide(void *arg, dtrace_probedesc_t *desc)
{
@@ -187,7 +183,6 @@
}
}
-/* ARGSUSED */
static void
systrace_destroy(void *arg, dtrace_id_t id, void *parg)
{
@@ -206,7 +201,6 @@
#endif
}
-/* ARGSUSED */
static void
systrace_enable(void *arg, dtrace_id_t id, void *parg)
{
@@ -218,7 +212,6 @@
sysent[sysnum].sy_return = id;
}
-/* ARGSUSED */
static void
systrace_disable(void *arg, dtrace_id_t id, void *parg)
{
@@ -258,7 +251,6 @@
return (error);
}
-/* ARGSUSED */
static int
systrace_modevent(module_t mod __unused, int type, void *data __unused)
{
@@ -282,7 +274,6 @@
return (error);
}
-/* ARGSUSED */
static int
systrace_open(struct cdev *dev __unused, int oflags __unused, int devtype __unused, struct thread *td __unused)
{
More information about the p4-projects
mailing list