From owner-freebsd-dtrace@freebsd.org Thu Mar 31 22:56:00 2016 Return-Path: Delivered-To: freebsd-dtrace@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0277CAE4CBB; Thu, 31 Mar 2016 22:56:00 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pa0-x230.google.com (mail-pa0-x230.google.com [IPv6:2607:f8b0:400e:c03::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C55481D85; Thu, 31 Mar 2016 22:55:59 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pa0-x230.google.com with SMTP id td3so75467517pab.2; Thu, 31 Mar 2016 15:55:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=wF0ojhRAoZ5w6Cg97vdSCdVmt2jf573b43JF3MITYZE=; b=IUpiKC9cfS2pT2URcOU4xGneXxMGcgBvBhD2Ceaz66nkT0OjJnJth59MP5P+jKApiz DSr/GxjfmVOfI1IRzFgg8RqoIOZ7ldxWgBUTGWAbqqknsACpGWRNPFmIpAv/qK2EOKl1 WRNRiIIi96ca7YQe/FzvIJNWq3qK3ZQd+MIM5gNWcoZqIVFRexBnQo7O5vrPGYFtr4pa 9cLWaMDPALZUdcb+CTFds2sX9ypxJhBiHMQFtwj+SHpcD4mdmpm3lirruTqh/dlO+DWN uparZ6T9VkQg5l3fxL7IpG6ZlOXR3tHLyYZZ/XP40SuO4wkpAi8p9REu+z3mr0TLAnxm eSFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=wF0ojhRAoZ5w6Cg97vdSCdVmt2jf573b43JF3MITYZE=; b=H4uQBITO+uTc1iPiz664UKKY6+nCi7wRqLqhJfIsqMq28Jzg2XNrYGZbj5rFAECo0F Wa6Ghla36Y9XNFQog870nmezRd2eDcdbqBXuSJBsPKb3nbBB7BJhrezphYaDvjesnQno EIwyI4/hwXjUhIQ77dDGja34cjIs9FL/Dy+GghNpnDD1xDKELNUdPcQDun0/bSLvthcC tknO50pLMzmcZEPRdZH/Q/nLtrA3j6TMOP/7FfTc373sRCMgoRX+/q8KthhLPHXOogHd UHTiMUoDiGFSDn6wN56z0R91nw0UZc+/zi7FajSV1UchqHTSkIa04vuyePK0CCPBkscX SbCg== X-Gm-Message-State: AD7BkJLC7Wqo//Du/I++zDJWeYpza/nv4qamIwTwsoEqZov+Bz5cXChcrL6ye4SY0BHpCg== X-Received: by 10.66.254.168 with SMTP id aj8mr25866829pad.18.1459464959409; Thu, 31 Mar 2016 15:55:59 -0700 (PDT) Received: from wkstn-mjohnston.west.isilon.com (c-67-182-131-225.hsd1.wa.comcast.net. [67.182.131.225]) by smtp.gmail.com with ESMTPSA id d12sm15709164pfj.85.2016.03.31.15.55.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Mar 2016 15:55:58 -0700 (PDT) Sender: Mark Johnston Date: Thu, 31 Mar 2016 15:59:02 -0700 From: Mark Johnston To: Aleksander Alekseev Cc: Adrian Chadd , Hans Petter Selasky , Andriy Voskoboinyk , freebsd-dtrace@freebsd.org, "freebsd-hackers@freebsd.org" Subject: Re: I need a little help in fixing `exclusive sleep mutex urtwn0_com_lock` in CURRENT Message-ID: <20160331225902.GA32570@wkstn-mjohnston.west.isilon.com> References: <20160330123048.3361a9e4@fujitsu> <56FBBC62.6040905@selasky.org> <20160331204256.5cb1fdaf@portege> <20160331180333.GA25235@wkstn-mjohnston.west.isilon.com> <20160401002337.36700d9b@portege> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160401002337.36700d9b@portege> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 22:56:00 -0000 On Fri, Apr 01, 2016 at 12:23:37AM +0300, Aleksander Alekseev wrote: > > > By any chance is it possible to trace mtx_lock / mtx_unlock calls > > > using DTrace? I see number of probes in `dtrace -l` which look like > > > something I need. Unfortunately they are named like knlist_mtx_lock > > > or do_lock_umutex so I can't figure out whether these are probes I > > > looking for or not. > > > > Yes. You can use the lockstat provider to trace lock events: > > "dtrace -l -P lockstat". Predicates can be used to isolate events > > related to a specific lock. For example: > > > > # dtrace -n > > 'lockstat:::adaptive-acquire /args[0]->lock_object.lo_name == > > "so_snd"/{stack();}' > > > > will print a stack every time a socket send buffer lock is acquired. > > In general, the lock name is specified as an initialization parameter. > > In your case it'll be "urtwn0_com_lock". > > > > lockstat(1) is a command-line program that's good at aggregating data > > collected from lockstat probes; for the type of debugging you're doing > > it's probably not very useful. > > > > Note that DTrace probably isn't very helpful here if the panic occurs > > immediately after the event you're interested in occurs, since > > dtrace(1) won't have time to retrieve the trace record and print it. > > Thanks, Mark. > > Here is a funny thing. I thought that by writing debug.witness.watch=0 > to /etc/sysctl.conf and rebooting I will give DTrace some time to > report who acquired a lock and didn't released it. But in this case > kernel crashed differently (I checked twice): > > http://pastebin.com/raw/f08Fd70B > > And here is saved DTrace log for lock "urtwn0_com_lock": > > http://pastebin.com/raw/0X9zgeiY > > If I'm not wrong everything is OK. No missing mtx_unlock this time. Looking at your original post, the problem isn't related to a missing unlock. The attempt to lock the ieee80211com is triggering a fault, presumably because it was freed while the lock was dropped. So DTrace isn't going to help much here.