From owner-freebsd-dtrace@freebsd.org Thu May 18 20:30:03 2017 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 C602ED738DD for ; Thu, 18 May 2017 20:30:03 +0000 (UTC) (envelope-from longwitz@incore.de) Received: from dss.incore.de (dss.incore.de [195.145.1.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E234112F for ; Thu, 18 May 2017 20:30:03 +0000 (UTC) (envelope-from longwitz@incore.de) Received: from inetmail.dmz (inetmail.dmz [10.3.0.3]) by dss.incore.de (Postfix) with ESMTP id C135867A78 for ; Thu, 18 May 2017 22:20:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at incore.de Received: from dss.incore.de ([10.3.0.3]) by inetmail.dmz (inetmail.dmz [10.3.0.3]) (amavisd-new, port 10024) with LMTP id s7kHStLDKJrV for ; Thu, 18 May 2017 22:20:05 +0200 (CEST) Received: from mail.local.incore (fwintern.dmz [10.0.0.253]) by dss.incore.de (Postfix) with ESMTP id B2AD067A16 for ; Thu, 18 May 2017 22:20:05 +0200 (CEST) Received: from bsdmhs.longwitz (unknown [192.168.99.6]) by mail.local.incore (Postfix) with ESMTP id 85800508A1 for ; Thu, 18 May 2017 22:20:05 +0200 (CEST) Message-ID: <591E01F5.8080208@incore.de> Date: Thu, 18 May 2017 22:20:05 +0200 From: Andreas Longwitz User-Agent: Thunderbird 2.0.0.19 (X11/20090113) MIME-Version: 1.0 To: freebsd-dtrace@freebsd.org Subject: fbt:kernel:breadn_flags:entry): invalid address (0x0) in action #7 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.23 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, 18 May 2017 20:30:03 -0000 Now running FreeBSD 10.3-STABLE #0 r317936 I try to understand the problem described in https://lists.freebsd.org/pipermail/freebsd-fs/2013-November/018610.html using DTrace. Therefore I like to use the probe fbt:kernel:breadn_flags:entry to see what is happening in ffs_vgetf() in source ffs_vfsops.c: #define bread(vp, blkno, size, cred, bpp) \ breadn_flags(vp, blkno, size, NULL, NULL, 0, cred, 0, bpp) /* Read in the disk contents for the inode, copy into the inode. */ error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, ino)), (int)fs->fs_bsize, NOCRED, &bp); I get the error dtrace: error on enabled probe ID 22 (ID 31371: fbt:kernel:breadn_flags:entry): invalid address (0x0) in action #6 probably because NOCRED is NULL: #define NOCRED ((struct ucred *)0) I like to know if this case can be handled in DTrace, the parameter args[6]: struct ucred * is sometimes a pointer and sometimes NOCRED. -- Dr. Andreas Longwitz From owner-freebsd-dtrace@freebsd.org Thu May 18 20:35:05 2017 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 04D7AD73C07 for ; Thu, 18 May 2017 20:35:05 +0000 (UTC) (envelope-from slepetit@apple.com) Received: from mail-in6.apple.com (mail-out6.apple.com [17.151.62.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF8A21A69 for ; Thu, 18 May 2017 20:35:04 +0000 (UTC) (envelope-from slepetit@apple.com) DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1495139698; h=From:Sender:Reply-To:Subject:Date:Message-id:To:Cc:MIME-version:Content-type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-reply-to:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=gQCdjA/mK2A06JjHrFUO4ieyK1NNB8wub6Dia98Wnao=; b=EVadPhzIE9wFBSX76eo5QuSIudIpNOYewx0F/bwuqpwWIQTdX1S958ztP9hFXxDe gaaZLc/dB8Yx5+2NPllV2IzSBVT2HXwUkkYsovbRLY4G1EP7duJj69XHY4qCGom8 gU1QXjWLdV36rCBvN1BvaDyYa+04tXnklgTeonypa/0n5NA1dPLQD3lpXgW+XhHt okHLTUc0GYarFE1C/XMHu7QpSpC9nSkSOm5Nr96/js+Bbc3jfXAwBL1Ity7hiHL0 lNDXonUvs41RUI6PIpI14vMhbMXyuGAhAVC1YcADFafszL0X8lm5A4+kH02FSttr bRpHZo8WpU8LwdJMXBbt4w==; Received: from relay6.apple.com (relay6.apple.com [17.128.113.90]) (using TLS with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail-in6.apple.com (Apple Secure Mail Relay) with SMTP id 8A.70.24649.1750E195; Thu, 18 May 2017 13:34:58 -0700 (PDT) X-AuditID: 11973e15-a3fff70000006049-82-591e057101ad Received: from nwk-mmpp-sz13.apple.com (nwk-mmpp-sz13.apple.com [17.128.115.216]) by relay6.apple.com (Apple SCV relay) with SMTP id 22.B6.09762.1750E195; Thu, 18 May 2017 13:34:57 -0700 (PDT) MIME-version: 1.0 Received: from da0603a-dhcp63.apple.com (da0603a-dhcp63.apple.com [17.226.35.63]) by nwk-mmpp-sz13.apple.com (Oracle Communications Messaging Server 8.0.1.2.20170210 64bit (built Feb 10 2017)) with ESMTPSA id <0OQ600LHZ169U000@nwk-mmpp-sz13.apple.com>; Thu, 18 May 2017 13:34:57 -0700 (PDT) Sender: slepetit@apple.com From: Samuel Lepetit Message-id: <6A020677-BC76-41E1-8372-10B7962F4EDE@apple.com> Subject: Re: fbt:kernel:breadn_flags:entry): invalid address (0x0) in action #7 Date: Thu, 18 May 2017 13:34:43 -0700 In-reply-to: <591E01F5.8080208@incore.de> Cc: freebsd-dtrace@freebsd.org To: Andreas Longwitz References: <591E01F5.8080208@incore.de> X-Mailer: Apple Mail (2.3430) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrPLMWRmVeSWpSXmKPExsUi2FAYpVvEKhdpMOE6o8WGz5+YLWafXcPi wOQx49N8Fo+P++0DmKK4bFJSczLLUov07RK4Ml5MechWsECt4seyGYwNjH8Uuhg5OSQETCTO 3/jM0sXIxSEksJpJYtfMU4xdjBxgifu3NUFqhAQOMUqceQdWzysgKPFj8j0WEJtZIExi0ra5 TBC9q5gkPpxcyAqSEBaQkpg78Q2YzSagKXFz/g2wmbwCNhJv3gtClPhLHHv1hxUkzCKgKjGn TxQkzAlU3dlwGWq8nMTi07PYQWwRoPi8m5tYIM7RkHj2tYMN4nxZieZzrcwgJ0gIHGCTaP5+ hGUCo9AsJKfOQnIqhK0l8f1RK1CcA8iWlzh4XhYirCnx7N4ndghbW+LJuwusCxjZVjEK5SZm 5uhm5pnpJRYU5KTqJefnbmIExcB0O9EdjGdWWR1iFOBgVOLhfbBCNlKINbGsuDL3EKM0B4uS OG/eV6CQQHpiSWp2ampBalF8UWlOavEhRiYOTqkGxgs9TfMtuAI2GwdWlS+22MDyY0L3t8kn tv6/wpXk+Dvk6eny31HPvaV955graCX4BT74sna1zemZrGLWvUIz/59+r2Q0Y/20Xy8fNs36 dW2Rd/jLw55WavxTc5V+BE99dYkxztVxZX6Joa5j+uotqpFevqHm//2iZ4TO95uzhr3KbFuF z2+R6UosxRmJhlrMRcWJABQSF7JiAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrJIsWRmVeSWpSXmKPExsUi2FB8Q7eQVS7SYPU6BYsNnz8xW8w+u4bF gcljxqf5LB4f99sHMEVx2aSk5mSWpRbp2yVwZbyY8pCtYIFaxY9lMxgbGP8odDFycEgImEjc v63ZxcjJISRwiFHizDsFEJtXQFDix+R7LCA2s0CYxKRtc5m6GLmAalYxSXw4uZAVJCEsICUx d+IbMJtNQFPi5vwbjCAzeQVsJN68F4Qo8Zc49uoPK0iYRUBVYk6fKEiYE6i6s+Ey1Hg5icWn Z7GD2CJA8Xk3N7FAnKMh8exrBxuILSEgK9F8rpV5AiP/LCTXzUJyHYStJfH9UStQnAPIlpc4 eF4WIqwp8ezeJ3YIW1viybsLrAsY2VYxChSl5iRWmuklFhTkpOol5+duYgSHbGHUDsaG5VaH GAU4GJV4eDuWyUYKsSaWFVfmAkOIg1lJhDfoJ1CINyWxsiq1KD++qDQntfgQ40RGoB8nMkuJ JucDIyqvJN7QxMTAxNjYzNjY3MSclsJK4rw6zHKRQgLpiSWp2ampBalFMEcxcXBKNTAKuq6e /+vd7axXux3Lq9dNFvNc8VWp3HrTzJi/t7+IKLYvPlHWoaQ/s+Gdx/vXCjdO/TFJk1w9I3hF dlF/YibX4mAHEc+CkgaXZy//6K2RldSMlopcPeV00809IidnJN5bX5qRv/ZQdVyEr+XU3PbN L7pWcz/fn7Mu92n1ogaD6ayvz3SsW1uvxFKckWioxVxUnAgArdYZYMwCAAA= Content-Type: text/plain; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.23 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, 18 May 2017 20:35:05 -0000 I suspect the easiest way here is just to check that your credential in args[6] is non-null in a predicate. - Samuel Lepetit - slepetit@apple.com > On 18 May 2017, at 13:20, Andreas Longwitz wrote: > > Now running FreeBSD 10.3-STABLE #0 r317936 I try to understand the > problem described in > > https://lists.freebsd.org/pipermail/freebsd-fs/2013-November/018610.html > > using DTrace. Therefore I like to use the probe > > fbt:kernel:breadn_flags:entry > > to see what is happening in ffs_vgetf() in source ffs_vfsops.c: > > #define bread(vp, blkno, size, cred, bpp) \ > breadn_flags(vp, blkno, size, NULL, NULL, 0, cred, 0, bpp) > > /* Read in the disk contents for the inode, copy into the inode. */ > error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, ino)), > (int)fs->fs_bsize, NOCRED, &bp); > > I get the error > > dtrace: error on enabled probe ID 22 (ID 31371: > fbt:kernel:breadn_flags:entry): invalid address (0x0) in action #6 > > probably because NOCRED is NULL: > > #define NOCRED ((struct ucred *)0) > > I like to know if this case can be handled in DTrace, the parameter > > args[6]: struct ucred * > > is sometimes a pointer and sometimes NOCRED. > > > -- > Dr. Andreas Longwitz > > _______________________________________________ > freebsd-dtrace@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace > To unsubscribe, send any mail to "freebsd-dtrace-unsubscribe@freebsd.org" From owner-freebsd-dtrace@freebsd.org Thu May 18 20:45:41 2017 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 C9756D7308A for ; Thu, 18 May 2017 20:45:41 +0000 (UTC) (envelope-from domagoj.stolfa@gmail.com) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (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 5B8B87D0 for ; Thu, 18 May 2017 20:45:41 +0000 (UTC) (envelope-from domagoj.stolfa@gmail.com) Received: by mail-wm0-x22a.google.com with SMTP id d127so65562836wmf.0 for ; Thu, 18 May 2017 13:45:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=IMq9P+Y8Fx92xta7HwSr3F9F43eQh3EsoREz+cXDZJY=; b=tO3w/U+XaycUrBzl+IPHBxjjvQkPejHRgCWHi5ywtOhpMwLePRlgh9Wemg6Xd853G1 HLCX2ACqU8b84+yuvhHdfCamlqbCzUtm7nZYkKhlv232YVMGzrPdEIU8Fcnh/oWVWDXj VE4COXPfRcdSBjIhEhLab0HyY2EUvoH+xhl+HUTd+TcASjveeawga+u7HosSaHjSHSpQ 7i09RSeo40ytWXVCTIi5EddG21Zh7sv7+BpHnwFGGlflEaWBuiYNAR8MbmDdKB0zDfdx eAqjv3tAkgBr+2E0wZ/90SQ2UwzeCJ2hyl+fHQAUAz6vmXg71/YMuVMtBCq5qytHShW9 +u0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=IMq9P+Y8Fx92xta7HwSr3F9F43eQh3EsoREz+cXDZJY=; b=EuU3eonHmrmint6vthzXaTcqXhE2Jq43Ra4a4YTccBI4/JsdaOwUItG/YwwYXPOu4V hr+ihFVgYdzy2OPwyDUETuj87BPRnOyydhMzg9T+YTrmPm8jP5zymX6S8lpK4kiw3wic F1fuzdQEBCfYNc2RkfTzqq9qv5gTMvo4XTbnHZZ5KN2SMZaNCavJo6tRV8HDpt7sLi3k sFREhcl6QTMna15bokMKQFNwZTo3gUmzDpqqyE2D+sVu7qT62TBif0atbw1TbchWYGUh VGKN7OECuamhF+maa3ZJytQwofD2i9FF28JZ+aIymPsyAb+n5j+FTvMsGsjHX6beIavD 0iog== X-Gm-Message-State: AODbwcBeE7yFDdVG4+cqOWyGU2eAR9qjYZ2PBCYFSnwXH0BNbcw8/Gcl 786IrH45obChBw== X-Received: by 10.28.61.215 with SMTP id k206mr4497715wma.133.1495140339783; Thu, 18 May 2017 13:45:39 -0700 (PDT) Received: from wraith (224-14.dsl.iskon.hr. [89.164.224.14]) by smtp.gmail.com with ESMTPSA id x126sm7942454wme.12.2017.05.18.13.45.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 May 2017 13:45:39 -0700 (PDT) Date: Thu, 18 May 2017 22:45:34 +0200 From: Domagoj Stolfa To: Samuel Lepetit Cc: Andreas Longwitz , freebsd-dtrace@freebsd.org Subject: Re: fbt:kernel:breadn_flags:entry): invalid address (0x0) in action #7 Message-ID: <20170518204534.GA37126@wraith> References: <591E01F5.8080208@incore.de> <6A020677-BC76-41E1-8372-10B7962F4EDE@apple.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="EeQfGwPcQSOJBaQU" Content-Disposition: inline In-Reply-To: <6A020677-BC76-41E1-8372-10B7962F4EDE@apple.com> User-Agent: Mutt/1.8.2 (2017-04-18) X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.23 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, 18 May 2017 20:45:41 -0000 --EeQfGwPcQSOJBaQU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, > I suspect the easiest way here is just to check that your credential in a= rgs[6] is non-null in a predicate. yes, you would likely have to enable the probe twice -- once with a non-null argument and once with a null argument (if required). --=20 Best regards, Domagoj Stolfa --EeQfGwPcQSOJBaQU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEHQB+y96lmmv+IXofwxT+ikb0YU4FAlkeB+wACgkQwxT+ikb0 YU6DZAf8CPuPmhPMpQLFa0Nj4889VpxO5EDf0r48kEG8f0DGP7IMGS/CQakZrRx3 fVSKi0jXUU4lhcZG04xz6QZHAj4SYLMgJHLAfJsrChdu2icfWFQRS6WD1IGJ6TZ+ b1h+D55fKwHHJIS4EOlWLxVii3wfhOqWhQZhSRZ7M//PIdhIXjlvk38eh3xbL/8t PVC3Zeof0mAB8ZexCkJXLh99v3wSTFN7DeLclV3CPAzqadcvx7GpWH9hWMI2fKjX J+hxG/Z39qKZ77ydbPFGZYjYMqJBEgG7PfZuXzKmjg+Ql5kYRGiomJvYbuxIkDCk Fx0d7dAgPuMEE8Jse/6s2w8YXjFLhw== =hV8p -----END PGP SIGNATURE----- --EeQfGwPcQSOJBaQU-- From owner-freebsd-dtrace@freebsd.org Thu May 18 23:52:18 2017 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 5B9B7D73E2C for ; Thu, 18 May 2017 23:52:18 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk0-x22f.google.com (mail-qk0-x22f.google.com [IPv6:2607:f8b0:400d:c09::22f]) (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 0F1A51A33 for ; Thu, 18 May 2017 23:52:18 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk0-x22f.google.com with SMTP id k74so49557570qke.1 for ; Thu, 18 May 2017 16:52:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=3DkVmaL9+f8aV6dIKT0zq0htTEWlQbKWsg163VLGavk=; b=fRIGwp0M01OLKpIsxE6ZzxAEWKoWQV4S6pFyB4cucdzE0CRj9TOCrIVYt1TT4Jdywc cMENWcCZ3RgtOTFT7oNGnTvcKaCx4u/Q0arv4n5CoDrJrsXyLmYtN80L+MUDCYIhEVMj XWHCHG2ahuvE0Gg2Sa7IQSVTdYkQtHPiLEZlsQZChn8UqT3AbGuztk93mZDX5OPEL4BM MosBx5hFlbPvqHCu2M7lwmCxky/z1BtUDvFafX4GUwHlhppTUUCTyfZj1R0+HU6+c8Ez 9XGbKzo7jKPMc6H3Ty5TiPXnISzI0pd2ynJ7A3wbbtV7+/y7xO6D9hQajNlnERerKBUk VwLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=3DkVmaL9+f8aV6dIKT0zq0htTEWlQbKWsg163VLGavk=; b=dgKpwOaZ2yYzICbvMv9dqNPjbSDIIrmJpNAtZMfXshOD2KUk6HxOSyyCobdyT3KgVP lei7Iy/G5p2+JpOAisK16aMVjl9Z15096grB7W8zUUb2JV+8xczRms8M8pQMvrwvMxnZ OXhN9UJP8Sf924YHlm2T/FULWZc90wM7wSeHVDMiv3DHGGtnJCLTT615ul/YgkWQxnUK evWA2PfoUsyB9mRtd4s3/SuWhY5kZea5mWaCuuDEMaT2A1FqncE38udR2PZUIe+WofcL pinohKmranj4Cg8Kv/7xnsnPv2Xk8N5nY8P4YNUadwCyMqoCGDVBVHj4NwVrFnIXibOQ yBSw== X-Gm-Message-State: AODbwcCrpGLZZoBxMKKP9AS32wIiskuGeCVGLyRz6iaCmZLeigr36Tm1 Oh4tIfAkZ+Hk4Q== X-Received: by 10.55.123.2 with SMTP id w2mr6185066qkc.13.1495151537138; Thu, 18 May 2017 16:52:17 -0700 (PDT) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id u19sm4743728qtc.64.2017.05.18.16.52.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 May 2017 16:52:16 -0700 (PDT) Date: Thu, 18 May 2017 16:52:07 -0700 From: Mark Johnston To: Domagoj Stolfa Cc: Samuel Lepetit , Andreas Longwitz , freebsd-dtrace@freebsd.org Subject: Re: fbt:kernel:breadn_flags:entry): invalid address (0x0) in action #7 Message-ID: <20170518235207.GB37643@wkstn-mjohnston.west.isilon.com> References: <591E01F5.8080208@incore.de> <6A020677-BC76-41E1-8372-10B7962F4EDE@apple.com> <20170518204534.GA37126@wraith> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170518204534.GA37126@wraith> User-Agent: Mutt/1.8.2 (2017-04-18) X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.23 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, 18 May 2017 23:52:18 -0000 On Thu, May 18, 2017 at 10:45:34PM +0200, Domagoj Stolfa wrote: > Hello, > > > I suspect the easiest way here is just to check that your credential in args[6] is non-null in a predicate. > > yes, you would likely have to enable the probe twice -- once with a non-null > argument and once with a null argument (if required). On FreeBSD head you can also use if-statements. :) fbt:kernel:breadn_flags:entry { if (args[6] != NULL) { ... } else { ... } } From owner-freebsd-dtrace@freebsd.org Sat May 20 09:15:48 2017 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 188EAD7571D for ; Sat, 20 May 2017 09:15:48 +0000 (UTC) (envelope-from zaphod@berentweb.com) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (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 ACE55186A for ; Sat, 20 May 2017 09:15:47 +0000 (UTC) (envelope-from zaphod@berentweb.com) Received: by mail-wm0-x22a.google.com with SMTP id 7so19074352wmo.1 for ; Sat, 20 May 2017 02:15:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=berentweb-com.20150623.gappssmtp.com; s=20150623; h=sender:date:from:to:subject:message-id:mime-version :content-transfer-encoding; bh=+GUwoS3iqtX65Hf6elv52BjBbM+9+m5eLxJE1t0Vlt0=; b=tT0rx5haVs1lwEeN2Tuovwn5LC7ahbgraHAUC7/azgsYac8lvk4YQYa4jq6Mq0rSLR qaGj+bwgUFEEbrN4T/Tr3OIwGeYAu0voVE3QZGm7rToeA3awDPAlMSrayVJTK1jy2HTR KaPApd6gSNhNTGoltkN8rnDqOa61VYKYpv8DF+P/uvi+uyEtR/KDMD+YEqDXKjhBCZlU alr0P8OU9OOqYXbLLPS9bWa76inhjoVmbfkYE3jU5LbmUmqc1sUzMWmbzpR4rfd6RdAQ dGI+WIS8cDQpM4X5+JIfNPaVoihSnT/iptBNm3ungGN8nNnDwlyLsO/pdoFG6JJ0xXLs vKwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:subject:message-id :mime-version:content-transfer-encoding; bh=+GUwoS3iqtX65Hf6elv52BjBbM+9+m5eLxJE1t0Vlt0=; b=oT0DGyI/EqbDgGTdlaZQNJP4Bi4Xq+nf2l4FFtlrbBqMUOUFxzSci5tVZlcUZXGlqt 78QlOpYI/fRBcXxbi52dQ4I1LKEdsh2uiLBTdDJVfZdbua2IqwGNfkRKWarztumBiwCY +8KmkYf4J7Kyz7bUmVoxOhT6YUfENoZ4Sl7T1dHcgDdfidXJZlkg1vRcVMANkj/g+7Do 4GAuRydBXbBo7vsaqXnrnaAyfPao/e7sT8FHluOZVA/rwVs8oiOti+YCm6R54zDUIaBx pvWZVTTrP3XGauPwWhfT3ZBPo3Bg+jmnQj59w8g3vCTYm5JUyORni3eGXYu6g0D/Dq7h zXWA== X-Gm-Message-State: AODbwcDl8AMBQunJurN05abunzqypiNOo9WiFlT/SJ0CKe+/BRFTgowg yylrzh1v4l9KEPoamjo= X-Received: by 10.28.26.71 with SMTP id a68mr19710841wma.75.1495271745678; Sat, 20 May 2017 02:15:45 -0700 (PDT) Received: from rsbsd ([24.133.238.42]) by smtp.gmail.com with ESMTPSA id f70sm17567659wmd.25.2017.05.20.02.15.43 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 20 May 2017 02:15:44 -0700 (PDT) Sender: "Raif S. Berent" Date: Sat, 20 May 2017 12:10:29 +0300 From: Beeblebrox To: freebsd-dtrace@freebsd.org Subject: dtrace noob: How is it used? Message-ID: <20170520121029.708bc827@rsbsd> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.23 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: Sat, 20 May 2017 09:15:48 -0000 Hello, simple noob question. Trying to use dtrace on my drm-next kernel that leaks memory to the extent that all swap space gets filled. easy enogh: kldload dtraceall But which parameters and exactly how am I supposed to capture afterwards? I assume most useful info would be a) memory leaks per minute and b) source of leak. Wiki page was not much help for understanding usage: https://wiki.freebsd.org/DTrace/One-Liners * /usr/share/dtrace has scirpts, are those sufficient for the problem or should I add sysutils/DTraceToolkit? * Which script(s) would provide adequate info for this problem and how could I log a per minute (or perhaps per event) output from the probes? Thanks --=20 FreeBSD_amd64_12-Current_RadeonKMS Please CC my email when responding, mail from list is not delivered. From owner-freebsd-dtrace@freebsd.org Sat May 20 11:35:35 2017 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 E8E3FD7616E for ; Sat, 20 May 2017 11:35:35 +0000 (UTC) (envelope-from domagoj.stolfa@gmail.com) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (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 7C4B01A7D for ; Sat, 20 May 2017 11:35:35 +0000 (UTC) (envelope-from domagoj.stolfa@gmail.com) Received: by mail-wm0-x22e.google.com with SMTP id p134so6199914wmg.1 for ; Sat, 20 May 2017 04:35:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GGcSmUWRXb0LEh2dBCxOGGKKZhbG+5G+aiX4hE/b+Us=; b=rx+yJOUL5H5Ivqz5ki4AiktaPxo1gTvUrarSEdEZd/4vdYXyhByl+j+dmuVPKzmKy0 zWCXUCERbXVu4ujWLe48sPVqwsSfMxbFS6Kv1NjcS9EyBWCO5n1Pe1M70brN1hhXLX7x 8Bw/DBejHm1OFDWUutoD2MNkRvA9sDvMXaqyQwwV24kvpR170kyRHGYUBqPOS3EXzjyR Z/dOTyix1UPFuahFeuDgTvcmeLsfikJSNn/E63AOpOCF6ZnYE3LU2pA1TSavbUj6zrGD bZ7PBccoJA2bTfZ/qS1GAF7f9EbPMdDQmKFwTeoDJhgjaVYY9CRNNWc98QrmgRGuuRzZ 82KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=GGcSmUWRXb0LEh2dBCxOGGKKZhbG+5G+aiX4hE/b+Us=; b=YEHYLVxF+ao1ParKoWTGrwVltZLZcdy+2e6nmFEVuVhyzrD+FVVWKZFzsHS7C4PF8S T+uixpS2NUBFzik0tnYJroo7cho6CEosV6uxjxNwIG7wJ0x9ZkUYB371+8eNzw1Xi2go +dfukulYt0Nh49wy9AAFK/DlsAzm12DBDHwB4JhwGyCDid4lQzJMurZhEevVD62oig2p TVZIWE6sY0njE6xci/7nvV40+nAESGC36dVbu7tVVMR/O4kbgj46ctJySEnp6kxzqW/V eCY1iR/Nl4p7WYII6jDkV07y3kReBfWCwDMFzAxESd6Nd3WGeHTvCYONDayrOx9gTuxJ XAjg== X-Gm-Message-State: AODbwcAj+2jSv4XzfRRFza2nZ6O2Z37sxVmlTr0MpTvLPUhP9zFAhhRW EVQBRKpheoxqvcpu9ac= X-Received: by 10.28.4.203 with SMTP id 194mr8898769wme.118.1495280133828; Sat, 20 May 2017 04:35:33 -0700 (PDT) Received: from wraith (157-197.dsl.iskon.hr. [89.164.157.197]) by smtp.gmail.com with ESMTPSA id m14sm32445152wmi.2.2017.05.20.04.35.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 May 2017 04:35:33 -0700 (PDT) Date: Sat, 20 May 2017 13:35:29 +0200 From: Domagoj Stolfa To: Beeblebrox Cc: freebsd-dtrace@freebsd.org Subject: Re: dtrace noob: How is it used? Message-ID: <20170520113529.GA49886@wraith> References: <20170520121029.708bc827@rsbsd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LZvS9be/3tNcYl/X" Content-Disposition: inline In-Reply-To: <20170520121029.708bc827@rsbsd> User-Agent: Mutt/1.8.2 (2017-04-18) X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.23 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: Sat, 20 May 2017 11:35:36 -0000 --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, > Trying to use dtrace on my drm-next kernel that leaks memory to the > extent that all swap space gets filled. > easy enogh: kldload dtraceall >=20 > But which parameters and exactly how am I supposed to capture > afterwards? I assume most useful info would be a) memory leaks per > minute and b) source of leak. Wiki page was not much help for > understanding usage: https://wiki.freebsd.org/DTrace/One-Liners =46rom my understanding, I don't think there are scripts that can explicltl= y tell you that there have been memory leaks somewhere, but FreeBSD, upon unloadin= g a module will tell you that a given module has leaked X bytes of memory. Howe= ver, DTrace on FreeBSD has a dtmalloc provider, which lets you inspect quite a b= it of things based on named memory in the kernel. You could try using that in ord= er to detect which memory hasn't been freed based on the expected code flow in the kernel. To do this, you would have to look at the kernel code of interest, use the = fbt provider in order to instrument the problems you want, and based on that in= spect whether or not a given dtmalloc probe has fired with a given memory region = (if you have access to it). Aside from that, I'm not aware of any other way to go about it. > * /usr/share/dtrace has scirpts, are those sufficient for the problem > or should I add sysutils/DTraceToolkit? > * Which script(s) would provide adequate info for this problem and how > could I log a per minute (or perhaps per event) output from the probes? The DTrace Toolkit is largely written with Solaris (now illumos) in mind, so there is a chance that some scripts in there might not work. --=20 Best regards, Domagoj Stolfa --LZvS9be/3tNcYl/X Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEHQB+y96lmmv+IXofwxT+ikb0YU4FAlkgKf8ACgkQwxT+ikb0 YU5WQQf+LVCPqNDBir/oU/PdWOd8Iz/yXKP39pMOaPQ+PAxBlcjrRrU3sajjn1A9 KOhGYGt377i3m476WDS4bmQ0yTUBVufJBNnYe2QhINjygcC2d9MkFDAV9uZRlFS1 09UiR6tiXWAXMeB9gUoqEGfdEkRzAgShDKjcD4pTzn6nq8IK0TQ8rGdegjyw3/Pf cmebrnBqe9pCswHXaiWcumJqOJ1VbFMkRYqP29TpLMHg7IPYsLv9qanQkb1c/f62 r4la/6+YnNjDuZveLkhyQPRfg/9cr8duIUckP0Z/5ePOXNOMYWBd9rUzF2CPYbNJ vHjDeda5EaaD6KQ4bGgSuOUilmReEQ== =jsB4 -----END PGP SIGNATURE----- --LZvS9be/3tNcYl/X--