From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 6 12:50:51 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CC46FD93 for ; Wed, 6 Feb 2013 12:50:51 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com [209.85.217.169]) by mx1.freebsd.org (Postfix) with ESMTP id 2BE8C801 for ; Wed, 6 Feb 2013 12:50:50 +0000 (UTC) Received: by mail-lb0-f169.google.com with SMTP id m4so1159004lbo.28 for ; Wed, 06 Feb 2013 04:50:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:x-enigmail-version:content-type :x-gm-message-state; bh=nlOeQiygQmgSZwgXLwE+kOnAj3MtrgccQgXlvlECH2E=; b=ZF7O2WxZqoz+phX6pLtJKkAxe9TkbEe7BhkNoMFcwF38TEF/IkIdCZwCAoUTlFvdhl g+zTyFovARJX9e+Pz5B3ootK4rCEb6udbvBMoW6DtyNVzW0Y06O86icCG21YZ6SzqN5j F9HqgtkbnoyoJx4ravts1cVlCiSc95C4qfjQFmp31dTFeLKHyaySiJZXUaGxrtLiuVIX jMOiTMw9voSOeSFZorT6tGgUlzTL+/SytPQaoWnLqZ6AJa0AIlsdseJ6bkRrxC7QhPix 5y60G9PK9jEdsmHJ8aXpqXjb2UUjNNV0lb1YYe6Q6Gk9tndTm7BP6P3DjacbZD7F3YUU KMoA== X-Received: by 10.112.43.232 with SMTP id z8mr3649385lbl.135.1360155049591; Wed, 06 Feb 2013 04:50:49 -0800 (PST) Received: from dhcp170-82-red.yandex.net (dhcp170-82-red.yandex.net. [95.108.170.82]) by mx.google.com with ESMTPS id t7sm7761958lbf.12.2013.02.06.04.50.47 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Feb 2013 04:50:48 -0800 (PST) Sender: Andrey Zonov Message-ID: <511251A3.1090404@FreeBSD.org> Date: Wed, 06 Feb 2013 16:50:43 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: "Dr. Baud" Subject: Re: mutex_owner References: <1360075025.71615.YahooMailNeo@web142505.mail.bf1.yahoo.com> In-Reply-To: <1360075025.71615.YahooMailNeo@web142505.mail.bf1.yahoo.com> X-Enigmail-Version: 1.5 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2DXMVDQTOEQMUVFRHTIKI" X-Gm-Message-State: ALoCoQlSYjOeD1owKtvUAotQywR6gAnoKC6OygQPGvSGTIqx8AAV8TmAJBv6uVNgAluubCg7+wlt Cc: "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 12:50:51 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2DXMVDQTOEQMUVFRHTIKI Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2/5/13 6:37 PM, Dr. Baud wrote: > All, >=20 > Anyone use mutex_owner in a dtrace script, as the obvious does not= work for me: >=20 > Content of spin.d: >=20 > #!/usr/sbin/dtrace -qs >=20 > :::*spin > { > self->mutex =3D (kmutex_t *) arg0; > self->mutex_owner =3D mutex_owner((kmutex_t *) :self->mutex); > } >=20 Lock implementation in FreeBSD is different from in Solaris. The script below has to do what you want. :::*spin { self->mtx =3D (struct mtx *)arg0; self->mtx_owner =3D mutex_owner(self->mtx); } Implementation details of mutexes you can find in sys/sys/_mutex.h, sys/sys/mutex.h, sys/kern/kern_mutex.c. --=20 Andrey Zonov ------enig2DXMVDQTOEQMUVFRHTIKI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJRElGmAAoJEBWLemxX/CvTsykH/39B7lxGuYTTw0Yfj6NWu5EN XiJoNDRpr6H/14grx8Ps1rGlL3nMc5lsrZeEREIpbQPaEHsiu+SfFqJxt/BlQZZv KAjkvVj5mimDQFIZSBMsFORU7feAKLVAcWMo9WtsyoXkeqjYUrvr9KqJqNGvPr/s x2W43aAQWLF5MWta9cjYapzrumaV9s/hamIO0sNcXFeaRkAStXrp1qhy7Uf6gDN6 TCgCkHzid/WkwE/FjzBPHVX0LPUbYpCvqisCd8D2UniWQb2FR8G2b3W66eIxgDAX tUPYcUI7YQGulr1zNOpfj72dVdt2FXASkuDMdMiD5jXZyNAOdasTRqekm58dd8g= =46fn -----END PGP SIGNATURE----- ------enig2DXMVDQTOEQMUVFRHTIKI--