Print this page
4469 DTrace helper tracing should be dynamic

@@ -20,10 +20,11 @@
  */
 
 /*
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
  */
 
 /*
  * explicitly define DTRACE_ERRDEBUG to pull in definition of dtrace_errhash_t
  * explicitly define _STDARG_H to avoid stdarg.h/varargs.h u/k defn conflict

@@ -1271,23 +1272,23 @@
 
 int
 dtrace_helptrace_init(mdb_walk_state_t *wsp)
 {
         uint32_t next;
-        int enabled;
+        uintptr_t buffer;
 
         if (wsp->walk_addr != NULL) {
                 mdb_warn("dtrace_helptrace only supports global walks\n");
                 return (WALK_ERR);
         }
 
-        if (mdb_readvar(&enabled, "dtrace_helptrace_enabled") == -1) {
-                mdb_warn("couldn't read 'dtrace_helptrace_enabled'");
+        if (mdb_readvar(&buffer, "dtrace_helptrace_buffer") == -1) {
+                mdb_warn("couldn't read 'dtrace_helptrace_buffer'");
                 return (WALK_ERR);
         }
 
-        if (!enabled) {
+        if (buffer == NULL) {
                 mdb_warn("helper tracing is not enabled\n");
                 return (WALK_ERR);
         }
 
         if (mdb_readvar(&next, "dtrace_helptrace_next") == -1) {