Print this page
OS-2366 ddi_periodic_add(9F) is entirely rubbish (MORE)

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/mdb/common/modules/genunix/ddi_periodic.c
          +++ new/usr/src/cmd/mdb/common/modules/genunix/ddi_periodic.c
↓ open down ↓ 7 lines elided ↑ open up ↑
   8    8   * source.  A copy of the CDDL is also available via the Internet at
   9    9   * http://www.illumos.org/license/CDDL.
  10   10   */
  11   11  /*
  12   12   * Copyright (c) 2013, Joyent, Inc. All rights reserved.
  13   13   */
  14   14  
  15   15  #include "ddi_periodic.h"
  16   16  
  17   17  #include <mdb/mdb_modapi.h>
  18      -#include <sys/ddi_timer.h>
       18 +#include <sys/ddi_periodic.h>
  19   19  #include <sys/sysmacros.h>
  20   20  #include <stdio.h>
  21   21  
  22   22  /*ARGSUSED*/
  23   23  int
  24   24  dprinfo(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
  25   25  {
  26   26          char prflags[4];
  27   27          ddi_periodic_impl_t dpr;
  28   28          boolean_t verbose = B_FALSE;
↓ open down ↓ 13 lines elided ↑ open up ↑
  42   42  
  43   43          if (mdb_vread(&dpr, sizeof (dpr), addr) == -1) {
  44   44                  mdb_warn("could not read ddi_periodic_impl_t at %p", addr);
  45   45                  return (DCMD_ERR);
  46   46          }
  47   47  
  48   48          if (DCMD_HDRSPEC(flags)) {
  49   49                  mdb_printf("%16s %4s %3s %5s %5s %12s %s\n", "ADDR", "ID",
  50   50                      "LVL", "FLAGS", "MS", "FIRE_COUNT", "HANDLER");
  51   51                  if (verbose) {
  52      -                        mdb_printf("%33s %16s %s\n", "", "CYCLIC_ID",
  53      -                            "ARGUMENT");
       52 +                        mdb_printf("%16s %16s %16s %s\n", "", "THREAD",
       53 +                            "CYCLIC_ID", "ARGUMENT");
  54   54                  }
  55   55          }
  56   56  
  57   57          prflags[0] = dpr.dpr_flags & DPF_DISPATCHED ? 'D' : '-';
  58   58          prflags[1] = dpr.dpr_flags & DPF_EXECUTING ? 'X' : '-';
  59   59          prflags[2] = dpr.dpr_flags & DPF_CANCELLED ? 'C' : '-';
  60   60          prflags[3] = '\0';
  61   61  
  62   62          mdb_printf("%16p %4x %3d %5s %5d %12x %a\n", addr, dpr.dpr_id,
  63   63              dpr.dpr_level, prflags, (int)(dpr.dpr_interval / 1000000),
  64   64              dpr.dpr_fire_count, dpr.dpr_handler);
  65   65          if (verbose) {
  66      -                mdb_printf("%33s %16p %a\n", "", dpr.dpr_cyclic_id,
  67      -                    dpr.dpr_arg);
       66 +                mdb_printf("%16s %16p %16p %a\n", "", dpr.dpr_thread,
       67 +                    dpr.dpr_cyclic_id, dpr.dpr_arg);
  68   68          }
  69   69  
  70   70          return (DCMD_OK);
  71   71  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX