From owner-svn-src-user@FreeBSD.ORG Tue Nov 25 14:14:59 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33E0C1065673; Tue, 25 Nov 2008 14:14:59 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 277558FC28; Tue, 25 Nov 2008 14:14:59 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAPEEw3o025684; Tue, 25 Nov 2008 14:14:58 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAPEEwRw025683; Tue, 25 Nov 2008 14:14:58 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <200811251414.mAPEEwRw025683@svn.freebsd.org> From: Alexander Leidinger Date: Tue, 25 Nov 2008 14:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185297 - user/netchild/linuxulator-dtrace/src/sys/compat/linux X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Nov 2008 14:14:59 -0000 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]; +} +