Print this page
4469 DTrace helper tracing should be dynamic

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/mdb/common/modules/dtrace/dtrace.c
          +++ new/usr/src/cmd/mdb/common/modules/dtrace/dtrace.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   * Copyright (c) 2013 by Delphix. All rights reserved.
       25 + * Copyright (c) 2012, Joyent, Inc. All rights reserved.
  25   26   */
  26   27  
  27   28  /*
  28   29   * explicitly define DTRACE_ERRDEBUG to pull in definition of dtrace_errhash_t
  29   30   * explicitly define _STDARG_H to avoid stdarg.h/varargs.h u/k defn conflict
  30   31   */
  31   32  #define DTRACE_ERRDEBUG
  32   33  #define _STDARG_H
  33   34  
  34   35  #include <mdb/mdb_param.h>
↓ open down ↓ 1231 lines elided ↑ open up ↑
1266 1267          if (msg[strlen(msg) - 1] != '\n')
1267 1268                  mdb_printf("\n");
1268 1269  
1269 1270          return (DCMD_OK);
1270 1271  }
1271 1272  
1272 1273  int
1273 1274  dtrace_helptrace_init(mdb_walk_state_t *wsp)
1274 1275  {
1275 1276          uint32_t next;
1276      -        int enabled;
     1277 +        uintptr_t buffer;
1277 1278  
1278 1279          if (wsp->walk_addr != NULL) {
1279 1280                  mdb_warn("dtrace_helptrace only supports global walks\n");
1280 1281                  return (WALK_ERR);
1281 1282          }
1282 1283  
1283      -        if (mdb_readvar(&enabled, "dtrace_helptrace_enabled") == -1) {
1284      -                mdb_warn("couldn't read 'dtrace_helptrace_enabled'");
     1284 +        if (mdb_readvar(&buffer, "dtrace_helptrace_buffer") == -1) {
     1285 +                mdb_warn("couldn't read 'dtrace_helptrace_buffer'");
1285 1286                  return (WALK_ERR);
1286 1287          }
1287 1288  
1288      -        if (!enabled) {
     1289 +        if (buffer == NULL) {
1289 1290                  mdb_warn("helper tracing is not enabled\n");
1290 1291                  return (WALK_ERR);
1291 1292          }
1292 1293  
1293 1294          if (mdb_readvar(&next, "dtrace_helptrace_next") == -1) {
1294 1295                  mdb_warn("couldn't read 'dtrace_helptrace_next'");
1295 1296                  return (WALK_ERR);
1296 1297          }
1297 1298  
1298 1299          wsp->walk_addr = next;
↓ open down ↓ 1493 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX