From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14782 invoked by alias); 20 Jul 2007 08:51:30 -0000 Received: (qmail 14774 invoked by uid 22791); 20 Jul 2007 08:51:30 -0000 X-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_05,DK_POLICY_SIGNSOME,FORGED_RCVD_HELO X-Spam-Check-By: sourceware.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (83.160.170.119) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 20 Jul 2007 08:51:26 +0000 Received: from dijkstra.wildebeest.org ([192.168.1.29]) by gnu.wildebeest.org with esmtp (Exim 4.43) id 1IBoFJ-0007P1-NQ; Fri, 20 Jul 2007 10:53:58 +0200 Subject: Re: Extending Frysk to trace user-space lockings From: Mark Wielaard To: Eugene Teo Cc: frysk@sourceware.org In-Reply-To: <46A02732.3090900@redhat.com> References: <46A02732.3090900@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-mO0ED0EVH/zwDDXroFkP" Date: Fri, 20 Jul 2007 08:51:00 -0000 Message-Id: <1184921481.3611.17.camel@dijkstra.wildebeest.org> Mime-Version: 1.0 X-Mailer: Evolution 2.8.3 (2.8.3-2.fc6) X-Spam-Score: -4.4 (----) X-Virus-Checked: Checked by ClamAV on sourceware.org X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2007-q3/txt/msg00162.txt.bz2 --=-mO0ED0EVH/zwDDXroFkP Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Content-length: 1381 Hi Eugene, On Fri, 2007-07-20 at 11:08 +0800, Eugene Teo wrote: > Is it possible to extend Frysk to trace user-space lockings? I am trying = to > write a tool that basically outputs the lock used and the backtrace showi= ng > who is holding on to it. I don't really have an example output that I can= show, > but if you have an idea to share, do let me know! I am afraid I know too little about user space locking or even know how various user space locking mechanisms are implemented to give a real answer. Lets assume you are interested in pthread mutexes. Then what you can do at this point with frysk is get a simple stack trace of all threads of a process using ftrace this should include things like pthread_cond_wait() calls. This at least gives you info on whether or not threads are contending. We could build on that by extracting the mutex argument from that call and then get the owner from that (although I am not sure how standardized all this is and whether or not you are supposed to be able to get at the owner field). But that needs some creative hacking on the frysk sources to make your own specialized ftrace-pthread-mutex variant and possibly you will need the debug info for the program you are examining to munch through the stack frame, function call argument list and mutex fields. Hope some of the above rambling makes sense. Cheers, Mark --=-mO0ED0EVH/zwDDXroFkP Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part Content-length: 189 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBGoHeCxVhZCJWr9QwRAhifAJ9nB05wryKmOfqYABQfnePsAt0WQwCbBDeY +8gO+0y3SuUMnG3qrCl7fSc= =aapc -----END PGP SIGNATURE----- --=-mO0ED0EVH/zwDDXroFkP--