crash utility help page:  sbitmapq


NAME
  sbitmapq - sbitmap_queue struct contents

SYNOPSIS
  sbitmapq [-s struct[.member[,member]] -a address [-p] [-v]] -[x|d] address

DESCRIPTION
  The command dumps the contents of the sbitmap_queue structure and
  the used bits in the bitmap. Also, it shows the dump of a structure
  array associated with the sbitmap_queue.

  The arguments are as follows:

   -s struct  name of a C-code structure, that is stored in an array
              associated with sbitmap_queue structure. Use the
              "struct.member" format in order to display a particular
              member of the structure. -s option requires -a option
  -a address  address of a structure array associated with sbitmap_queue
              structure. The set bits in sbitmap are used for the index
              in an associated array.
          -p  associated with sbitmap_queue array contains the points of
              structure.
          -x  override default output format with hexadecimal format.
          -d  override default output format with decimal format.
          -v  By default, the sbitmap command shows only a used sbitmap
              index and a structure address in the associated array.
              This flag says to print a formatted display of the
              contents of a structure in an associated array. -v option
              requires of -s.

EXAMPLES

  All examples are shown on the base of Linux Target system with iSCSI
  transport.

  Display the common sbitmap information for target session:

    crash> struct -oh se_session 0xc0000000e118c760 | grep sbitmap_queue
      [c0000000e118c808] struct sbitmap_queue sess_tag_pool;
    crash>
    crash> sbitmapq c0000000e118c808
    depth = 136
    busy = 4
    cleared = 26
    bits_per_word = 32
    map_nr = 5
    alloc_hint = {74, 36, 123, 101}
    wake_batch = 8
    wake_index = 0
    ws_active = 0
    ws = {
            { .wait_cnt = 8, .wait = inactive },
            { .wait_cnt = 8, .wait = inactive },
            { .wait_cnt = 8, .wait = inactive },
            { .wait_cnt = 8, .wait = inactive },
            { .wait_cnt = 8, .wait = inactive },
            { .wait_cnt = 8, .wait = inactive },
            { .wait_cnt = 8, .wait = inactive },
            { .wait_cnt = 8, .wait = inactive },
    }
    round_robin = 0
    min_shallow_depth = 4294967295

    00000000: 0000 0000 0000 0000 0030 0000 0000 0000
    00000010: 00

  Display the addresses of structure are associated with
  sbitmap_queue (for iscsi it is 'iscsi_cmd' structure):

    crash> struct se_session 0xc0000000e118c760 | grep sess_cmd_map
      sess_cmd_map = 0xc0000000671c0000,
    crash>
    crash> sbitmapq -s iscsi_cmd -a 0xc0000000671c0000 c0000000e118c808
    76: 0xc0000000671d5600
    77: 0xc0000000671d5a80

  Dump of formatted content of structures:

    crash> sbitmapq -s iscsi_cmd -a 0xc0000000671c0000 -v c0000000e118c808
    76 (0xc0000000671d5600):
    struct iscsi_cmd {
      dataout_timer_flags = 0,
      dataout_timeout_retries = 0 '\000',
      error_recovery_count = 0 '\000',
      deferred_i_state = ISTATE_NO_STATE,
      i_state = ISTATE_SENT_STATUS,
      ...
      first_data_sg = 0xc0000000e306b080,
      first_data_sg_off = 0,
      kmapped_nents = 1,
      sense_reason = 0
    }
    77 (0xc0000000671d5a80):
    struct iscsi_cmd {
      dataout_timer_flags = 0,
      dataout_timeout_retries = 0 '\000',
      error_recovery_count = 0 '\000',
      deferred_i_state = ISTATE_NO_STATE,
      i_state = ISTATE_NEW_CMD,
      ...
      first_data_sg = 0x0,
      first_data_sg_off = 0,
      kmapped_nents = 0,
      sense_reason = 0
    }