Date: Mon, 1 May 2006 09:00:01 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 96477 for review Message-ID: <200605010900.k41901d4008500@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=96477 Change 96477 by jb@jb_freebsd2 on 2006/05/01 08:59:28 Implement the DTrace syscall provider callbacks. Affected files ... .. //depot/projects/dtrace/src/sys/i386/i386/trap.c#3 edit Differences ... ==== //depot/projects/dtrace/src/sys/i386/i386/trap.c#3 (text+ko) ==== @@ -115,6 +115,13 @@ * 'no-fault' DTrace probe. */ dtrace_instr_size_func_t dtrace_instr_size_func; + +/* + * This is a hook which is initialised by the systrace module + * when it is loaded. This keeps the DTrace syscall provider + * implementation opaque. + */ +systrace_probe_func_t systrace_probe_func; #endif extern void trap(struct trapframe frame); @@ -1086,6 +1093,17 @@ td->td_retval[0] = 0; td->td_retval[1] = frame.tf_edx; +#ifdef KDTRACE + /* + * If the systrace module has registered it's probe + * callback and if there is a probe active for the + * syscall 'entry', process the probe. + */ + if (systrace_probe_func != NULL && callp->sy_entry != 0) + (*systrace_probe_func)(callp->sy_entry, code, callp, + args); +#endif + STOPEVENT(p, S_SCE, narg); PTRACESTOP_SC(p, td, S_PT_SCE); @@ -1093,6 +1111,20 @@ AUDIT_SYSCALL_ENTER(code, td); error = (*callp->sy_call)(td, args); AUDIT_SYSCALL_EXIT(error, td); + +#ifdef KDTRACE + args[0] = error; + args[1] = error; + + /* + * If the systrace module has registered it's probe + * callback and if there is a probe active for the + * syscall 'return', process the probe. + */ + if (systrace_probe_func != NULL && callp->sy_return != 0) + (*systrace_probe_func)(callp->sy_return, code, NULL, + args); +#endif } switch (error) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200605010900.k41901d4008500>