AFS-Monitor

 view release on metacpan or  search on metacpan

examples/cmdebug  view on Meta::CPAN

        print "symlink";
      }
      elsif ($centry->{mvstat} == 5) {
        print "microsoft dfs link";
      }
      elsif ($centry->{mvstat} == 6) {
        print "invalid link";
      }
      else {
        printf("bogus mvstat %d", $centry->{mvstat});
      }

      printf("\n    states (0x%x)", $centry->{states});
      if ($centry->{states} & 1) {
        print ", stat'd";
      }
      if ($centry->{states} & 2) {
        print ", backup";
      }
      if ($centry->{states} & 4) {
        print ", read-only";
      }
      if ($centry->{states} & 8) {
        print ", mt pt valid";
      }
      if ($centry->{states} & 0x10) {
        print ", pending core";
      }
      if ($centry->{states} & 0x40) {
        print ", wait-for-store";
      }
      if ($centry->{states} & 0x80) {
        print ", mapped";
      }
      print "\n";
    }
  }
}


sub print_lock {
  my $lock = shift;

  print "(";
  if ($lock->{waitStates}) {
    if($lock->{waitStates} & constant("READ_LOCK")) {
      print "reader_waiting";
    }
    if($lock->{waitStates} & constant("WRITE_LOCK")) {
      print "writer_waiting";
    }
    if($lock->{waitStates} & constant("SHARED_LOCK")) {
      print "upgrade_waiting";
    }
  }
  else {
    print "none_waiting";
  }
  if ($lock->{exclLocked}) {
    if ($lock->{exclLocked} & constant("WRITE_LOCK")) {
       print ", write_locked";
    }
    if ($lock->{exclLocked} & constant("SHARED_LOCK")) {
       print ", upgrade_locked";
    }
    printf("(pid:%d at:%d)",
            $lock->{pid_writer}, $lock->{src_indicator});
  }
  if ($lock->{readersReading}) {
    printf(", %d read_locks(pid:%d)",
            $lock->{readersReading}, $lock->{pid_last_reader});
  }
  if ($lock->{numWaiting}) {
    printf(", %d waiters", $lock->{numWaiting});
  }
  print ")";
}



( run in 1.705 second using v1.01-cache-2.11-cpan-39bf76dae61 )