0 Replies Latest reply: Aug 24, 2011 9:31 AM by gleng RSS

    How to get details on swapped out processes?

    gleng
      I am trying to get the details on some swapped out processes. Currently vmstat is showing 71 processes a swapped out:

      vmstat 3 3
      kthr      memory            page            disk          faults      cpu
      r b w   swap  free  re  mf pi po fr de sr vc vc vc --   in   sy   cs us sy id
      *0 0 6 5598448 512968 155 352 428 40 42 0 22 3 28 1 0 1982 3904 1905 7 14 79*
      *0 0 71 5091488 436568 0 4 0 0 0 0 0 0 1 0 0 976 1215 945 0 3 97*
      *0 0 71 5099088 440896 2 5 0 0 0 0 0 0 2 0 0 1004 1221 991 1 2 97*

      A search of the MOS knowledge base turned up Support Recommended doc 1009494.1 How to use DTrace and mdb to Interpret vmstat Statistics.

      The section titled "kthr: Swapped out Threads (w)" includes the following statements and commands:


      To see the kernel threads swapped out during the sample period:
      $ dtrace -q -n 'fbt::swapout_lwp:entry{ proc = (proc *)arg[0]->t_procp; printf("Lwp: %d of \t Proc: %s being swaped out\n",arg[0]->t_id, proc->p_user.u_comm);}'

      The vmstat output doesn't tell what processes are swapped out. Mdb(1) can be used to print swapped out processes:
      # echo "::walk thread myvar|::print kthread_t t_schedflag|::grep .==0x8|::eval <myvar=K|::print kthread_t t_procp|::print proc_t p_user.u_comm"|mdb -k


      The dtrace command does not pass edit:
      *dtrace -q -n 'fbt::swapout_lwp:entry{ proc = (proc *)arg[0]->t_procp; printf("Lwp: %d of \t Proc: %s being swaped out\n",arg[0]->t_id, proc->p_user.u_comm);}'*
      *dtrace: invalid probe specifier fbt::swapout_lwp:entry{ proc = (proc *)arg[0]->t_procp; printf("Lwp: %d of \t Proc: %s being swaped out\n",arg[0]->t_id, proc->p_user.u_comm);}: syntax error near ")"*

      The mdb command does not return any thing:
      *#echo "::walk thread myvar|::print kthread_t t_schedflag|::grep .==0x8|::eval <myvar=K|::print kthread_t t_procp|::print proc_t p_user.u_comm"|mdb -k*
      *#*


      The server is running:

      uname -a
      SunOS rizzotest 5.10 Generic_142900-11 sun4v sparc SUNW,SPARC-Enterprise-T5220
      cat /etc/release
      Solaris 10 10/09 s10s_u8wos_08a SPARC
      Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
      Use is subject to license terms.
      Assembled 16 September 2009

      Thanks,
      GlenG