Date: Tue, 25 Nov 2008 14:14:58 +0000 (UTC) From: Alexander Leidinger <netchild@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r185297 - user/netchild/linuxulator-dtrace/src/sys/compat/linux Message-ID: <200811251414.mAPEEwRw025683@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: netchild Date: Tue Nov 25 14:14:58 2008 New Revision: 185297 URL: http://svn.freebsd.org/changeset/base/185297 Log: First dtrace program to check the balancing of the amul_lock aquire/release. As of now this will show errors, as not all locking/release places are instrumented with dtrace probes. WIP warning: This dtrace script is not even compile tested. Added: user/netchild/linuxulator-dtrace/src/sys/compat/linux/check_emul_lock.d Added: user/netchild/linuxulator-dtrace/src/sys/compat/linux/check_emul_lock.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/netchild/linuxulator-dtrace/src/sys/compat/linux/check_emul_lock.d Tue Nov 25 14:14:58 2008 (r185297) @@ -0,0 +1,36 @@ +#!/usr/sbin/dtrace -qs + +/* + * Check if the emul lock is correctly acquired/released: + * - no recursive locking + * - no unlocking of already unlocked one + */ + +linuxulator*::emul_locked +/check[probeprov, arg0] > 0/ +{ + printf("ERROR: recursive lock of emul_lock (%p),", arg0); + printf(" or missing SDT probe in kernel. Stack trace follows:"); + stack(); +} + +linuxulator*::emul_locked +{ + ++check[probeprov, arg0]; +} + +linuxulator*::emul_unlock +/check[probeprov, arg0] == 0/ +{ + printf("ERROR: unlock attemt of unlocked emul_lock (%p),", arg0); + printf(" missing SDT probe in kernel, or dtrace program started"); + printf(" while the emul_lock was already held (race condition)."); + printf(" Stack trace follows:"); + stack(); +} + +linuxulator*::emul_unlock +{ + --check[probeprov, arg0]; +} +
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811251414.mAPEEwRw025683>