Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 06 Feb 2013 16:50:43 +0400
From:      Andrey Zonov <zont@FreeBSD.org>
To:        "Dr. Baud" <drbaud@yahoo.com>
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: mutex_owner
Message-ID:  <511251A3.1090404@FreeBSD.org>
In-Reply-To: <1360075025.71615.YahooMailNeo@web142505.mail.bf1.yahoo.com>
References:  <1360075025.71615.YahooMailNeo@web142505.mail.bf1.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?511251A3.1090404>