Print this page
6583 remove whole-process swapping

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/mdb/common/modules/genunix/leaky_subr.c
          +++ new/usr/src/cmd/mdb/common/modules/genunix/leaky_subr.c
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * fields enclosed by brackets "[]" replaced with your own identifying
  18   18   * information: Portions Copyright [yyyy] [name of copyright owner]
  19   19   *
  20   20   * CDDL HEADER END
  21   21   */
  22   22  /*
  23   23   * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
  27      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  28      -
  29   27  #include <mdb/mdb_param.h>
  30   28  #include <mdb/mdb_modapi.h>
  31   29  
  32   30  #include <sys/fs/ufs_inode.h>
  33   31  #include <sys/kmem_impl.h>
  34   32  #include <sys/vmem_impl.h>
  35   33  #include <sys/modctl.h>
  36   34  #include <sys/kobj.h>
  37   35  #include <sys/kobj_impl.h>
  38   36  #include <vm/seg_vn.h>
↓ open down ↓ 232 lines elided ↑ open up ↑
 271  269          if (mdb_readstr(name, sizeof (name), (uintptr_t)m->mod_modname) == -1)
 272  270                  (void) mdb_snprintf(name, sizeof (name), "0x%p", addr);
 273  271  
 274  272          leaky_grep((uintptr_t)m->mod_mp, sizeof (struct module));
 275  273          leaky_grep((uintptr_t)mod.data, mod.data_size);
 276  274          leaky_grep((uintptr_t)mod.bss, mod.bss_size);
 277  275  
 278  276          return (WALK_NEXT);
 279  277  }
 280  278  
      279 +/*ARGSUSED*/
 281  280  static int
 282  281  leaky_thread(uintptr_t addr, const kthread_t *t, unsigned long *pagesize)
 283  282  {
 284  283          uintptr_t size, base = (uintptr_t)t->t_stkbase;
 285  284          uintptr_t stk = (uintptr_t)t->t_stk;
 286      -
 287      -        /*
 288      -         * If this thread isn't in memory, we can't look at its stack.  This
 289      -         * may result in false positives, so we print a warning.
 290      -         */
 291      -        if (!(t->t_schedflag & TS_LOAD)) {
 292      -                mdb_printf("findleaks: thread %p's stack swapped out; "
 293      -                    "false positives possible\n", addr);
 294      -                return (WALK_NEXT);
 295      -        }
 296  285  
 297  286          if (t->t_state != TS_FREE)
 298  287                  leaky_grep(base, stk - base);
 299  288  
 300  289          /*
 301  290           * There is always gunk hanging out between t_stk and the page
 302  291           * boundary.  If this thread structure wasn't kmem allocated,
 303  292           * this will include the thread structure itself.  If the thread
 304  293           * _is_ kmem allocated, we'll be able to get to it via allthreads.
 305  294           */
↓ open down ↓ 619 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX