From nobody@FreeBSD.org  Fri Oct 18 07:50:44 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id 990863BD
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 18 Oct 2013 07:50:44 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 6D17427EB
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 18 Oct 2013 07:50:44 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r9I7oh6a093949
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 18 Oct 2013 07:50:43 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r9I7ohSS093756;
	Fri, 18 Oct 2013 07:50:43 GMT
	(envelope-from nobody)
Message-Id: <201310180750.r9I7ohSS093756@oldred.freebsd.org>
Date: Fri, 18 Oct 2013 07:50:43 GMT
From: Ruben van Staveren <ruben@verweg.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: don't have the compiler inline txg_quiesce so that zilstat works
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         183077
>Category:       kern
>Synopsis:       [opensolaris] [patch] don't have the compiler inline txg_quiesce so that zilstat works
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-fs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 18 08:00:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Mon May 05 03:19:32 UTC 2014
>Originator:     Ruben van Staveren
>Release:        FreeBSD 9.2-STABLE r256452M
>Organization:
>Environment:
FreeBSD helium.niet.verweg.com 9.2-STABLE FreeBSD 9.2-STABLE #1 r256452M: Thu Oct 17 14:01:31 CEST 2013     root@helium.niet.verweg.com:/usr/obj/usr/svn/9-stable/src/sys/GENERIC  amd64

>Description:
On unpatched systems, txg_quiesce gets inlined and is hidden from dtrace. The zilstat script (http://www.richardelling.com/Home/scripts-and-programs-1/zilstat) will report that no probes could be found for fbt::txg_quiesce:entry

After patching zilstat will report lines like these:


   N-Bytes  N-Bytes/s N-Max-Rate    B-Bytes  B-Bytes/s B-Max-Rate    ops  <=4kB 4-32kB >=32kB
         0          0          0          0          0          0      0      0      0      0
       504        504        504     131072     131072     131072      1      0      0      1
         0          0          0          0          0          0      0      0      0      0
         0          0          0          0          0          0      0      0      0      0
         0          0          0          0          0          0      0      0      0      0
         0          0          0          0          0          0      0      0      0      0

>How-To-Repeat:
run zilstat on an unpatched system, it will report the missing probe for fbt::txg_quiesce:entry and exits
>Fix:
In sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c, prefix the txg_quiesce function with 

__attribute__ ((noinline))


Patch attached with submission follows:

Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
===================================================================
--- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c	(revision 256452)
+++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c	(working copy)
@@ -354,7 +354,7 @@
  * On return, the transaction group has reached a stable state in which it can
  * then be passed off to the syncing context.
  */
-static void
+static __attribute__ ((noinline)) void
 txg_quiesce(dsl_pool_t *dp, uint64_t txg)
 {
 	tx_state_t *tx = &dp->dp_tx;


>Release-Note:
>Audit-Trail:

From: Ruben van Staveren <ruben@verweg.com>
To: bug-followup@FreeBSD.org, Ruben van Staveren <ruben@verweg.com>
Cc:  
Subject: Re: kern/183077: don't have the compiler inline txg_quiesce so that zilstat works
Date: Wed, 8 Jan 2014 16:28:50 +0100

 --Apple-Mail=_C4725950-B205-4C65-B29C-4D6B3A39551E
 Content-Transfer-Encoding: quoted-printable
 Content-Type: text/plain;
 	charset=us-ascii
 
 This is also applicable to FreeBSD 10.0-PRERELEASE r260387M
 
 Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c        =
 (revision 260387)
 +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c        (working =
 copy)
 @@ -354,7 +354,7 @@
   * On return, the transaction group has reached a stable state in which =
 it can
   * then be passed off to the syncing context.
   */
 -static void
 +static __attribute__ ((noinline)) void
  txg_quiesce(dsl_pool_t *dp, uint64_t txg)
  {
         tx_state_t *tx =3D &dp->dp_tx;
 
 
 --Apple-Mail=_C4725950-B205-4C65-B29C-4D6B3A39551E
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename=signature.asc
 Content-Type: application/pgp-signature;
 	name=signature.asc
 Content-Description: Message signed with OpenPGP using GPGMail
 
 -----BEGIN PGP SIGNATURE-----
 Comment: GPGTools - http://gpgtools.org
 
 iEYEARECAAYFAlLNbrIACgkQZ88+mcQxRw0W5QCeNuWTu/yR/4AE5iDnvv0QZdn8
 mGUAnihSjg3xpKW8f7F5cImZnPmALeyl
 =+URu
 -----END PGP SIGNATURE-----
 
 --Apple-Mail=_C4725950-B205-4C65-B29C-4D6B3A39551E--
Responsible-Changed-From-To: freebsd-bugs->freebsd-fs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon May 5 03:18:50 UTC 2014 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=183077 
>Unformatted:
