Bug 183077 - [opensolaris] [patch] don't have the compiler inline txg_quiesce so that zilstat works
Summary: [opensolaris] [patch] don't have the compiler inline txg_quiesce so that zils...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 9.2-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-fs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-18 09:00 UTC by ruben
Modified: 2015-02-02 00:18 UTC (History)
2 users (show)

See Also:


Attachments
file.diff (556 bytes, patch)
2013-10-18 09:00 UTC, ruben
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ruben 2013-10-18 09:00:00 UTC
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

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:
How-To-Repeat: run zilstat on an unpatched system, it will report the missing probe for fbt::txg_quiesce:entry and exits
Comment 1 ruben 2014-01-08 15:28:50 UTC
This is also applicable to FreeBSD 10.0-PRERELEASE r260387M

Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
===================================================================
--- 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 = &dp->dp_tx;
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2014-05-05 04:18:50 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-fs

Over to maintainer(s).
Comment 3 Lacey Powers 2015-02-01 19:25:20 UTC
This is also missing on FreeBSD 10.1-RELEASE-p5, keeping the same zilstat script from working.
Comment 4 Steven Hartland freebsd_committer freebsd_triage 2015-02-02 00:18:31 UTC
Fixed by:
https://svnweb.freebsd.org/changeset/base/278040