summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authornetchild <netchild@FreeBSD.org>2012-05-05 19:42:38 +0000
committernetchild <netchild@FreeBSD.org>2012-05-05 19:42:38 +0000
commit9895b5ca9df1f0d045ee00e77007e80d4c202ca4 (patch)
tree2c944ca220ef9f94f80b967133cbd2ab53caa81c /sys/amd64
parent096ede817a595e57dafce2910385344f389c8dbd (diff)
downloadFreeBSD-src-9895b5ca9df1f0d045ee00e77007e80d4c202ca4.zip
FreeBSD-src-9895b5ca9df1f0d045ee00e77007e80d4c202ca4.tar.gz
- >500 static DTrace probes for the linuxulator
- DTrace scripts to check for errors, performance, ... they serve mostly as examples of what you can do with the static probe;s with moderate load the scripts may be overwhelmed, excessive lock-tracing may influence program behavior (see the last design decission) Design decissions: - use "linuxulator" as the provider for the native bitsize; add the bitsize for the non-native emulation (e.g. "linuxuator32" on amd64) - Add probes only for locks which are acquired in one function and released in another function. Locks which are aquired and released in the same function should be easy to pair in the code, inter-function locking is more easy to verify in DTrace. - Probes for locks should be fired after locking and before releasing to prevent races (to provide data/function stability in DTrace, see the man-page of "dtrace -v ..." and the corresponding DTrace docs).
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/linux32/linux.h1
-rw-r--r--sys/amd64/linux32/linux32_dummy.c9
2 files changed, 10 insertions, 0 deletions
diff --git a/sys/amd64/linux32/linux.h b/sys/amd64/linux32/linux.h
index 4eb1425..2c269d3 100644
--- a/sys/amd64/linux32/linux.h
+++ b/sys/amd64/linux32/linux.h
@@ -42,6 +42,7 @@ extern u_char linux_debug_map[];
#define ldebug(name) isclr(linux_debug_map, LINUX_SYS_linux_ ## name)
#define ARGS(nm, fmt) "linux(%ld): "#nm"("fmt")\n", (long)td->td_proc->p_pid
#define LMSG(fmt) "linux(%ld): "fmt"\n", (long)td->td_proc->p_pid
+#define LINUX_DTRACE linuxulator32
#ifdef MALLOC_DECLARE
MALLOC_DECLARE(M_LINUX);
diff --git a/sys/amd64/linux32/linux32_dummy.c b/sys/amd64/linux32/linux32_dummy.c
index 9abc0ee..95bf3ec 100644
--- a/sys/amd64/linux32/linux32_dummy.c
+++ b/sys/amd64/linux32/linux32_dummy.c
@@ -29,14 +29,23 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_compat.h"
+#include "opt_kdtrace.h"
+
#include <sys/param.h>
+#include <sys/kernel.h>
+#include <sys/sdt.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <amd64/linux32/linux.h>
#include <amd64/linux32/linux32_proto.h>
+#include <compat/linux/linux_dtrace.h>
#include <compat/linux/linux_util.h>
+/* DTrace init */
+LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE);
+
DUMMY(stime);
DUMMY(olduname);
DUMMY(syslog);
OpenPOWER on IntegriCloud