BSD-Process

 view release on metacpan or  search on metacpan

Process.pm  view on Meta::CPAN

        started_profiling        => 'profil',
        stopped_profiling        => 'stopprof',
        id_privs_set             => 'sugid',
        system_process           => 'system',
        single_exit_not_wait     => 'single_exit',
        traced_by_debugger       => 'traced',
        waited_on_by_other       => 'waited',
        working_on_exiting       => 'wexit',
        process_called_exec      => 'exec',
        kernel_session_flag      => 'kiflag',
        is_locked                => 'locked',
        controlling_tty_active   => 'isctty',
        is_session_leader        => 'issleader',
        process_status           => 'stat',
        is_being_forked          => 'stat_1',
        is_runnable              => 'stat_2',
        is_sleeping_on_addr      => 'stat_3',
        is_stopped               => 'stat_4',
        is_a_zombie              => 'stat_5',
        is_waiting_on_intr       => 'stat_6',
        is_blocked               => 'stat_7',
        old_command_name         => 'ocomm',
        name_of_lock             => 'lockname',
        priority_scheduling_class => 'pri_class',
        priority_level            => 'pri_level',
        priority_native           => 'pri_native',
        priority_user             => 'pri_user',
        user_time                 => 'utime',
        system_time               => 'stime',
        total_time                => 'time',
        max_resident_set_size     => 'maxrss',

Process.pm  view on Meta::CPAN

Percentage of CPU time used by the process (for the duration of
swtime, see below).

=item estimated_cpu, estcpu

Time averaged value of ki_cpticks. (as per the comment in user.h,
purpose?)

=item sleep_time, slptime

Number of seconds since the process was last blocked.

=item time_last_swap, swtime

Number of seconds since the process was last swapped in or out.

=item elapsed_time, runtime

Real time used by the process, in microseconds.

=item start_time, start

Process.pm  view on Meta::CPAN


=item process_called_exec, exec

Flag indicating that the process has called exec. B<F5+>

=item kernel_session_flag, kiflag

A bitmap described kernel session status of the process, described
via the following attributes. B<F5+>

=item is_locked, locked

Flag indicating that the process is waiting on a lock (whose name
may be obtained from the C<lock> attribute). B<F5+>

  if ($p->is_locked) {
    print "$p->{comm} is waiting on lock $p->{lockname}\n";
  }
  else {
    print "not waiting on a lock\n";
  }

=item controlling_tty_active, isctty

Flag indicating that the vnode of the controlling tty is active. B<F5+>

Process.pm  view on Meta::CPAN


=item is_a_zombie, stat_5

Status indicates the process is a zombie. It is waiting for its
parent to collect its exit code. B<F5+>

=item is_waiting_on_intr, stat_6

Status indicates the process is waiting for an interrupt. B<F5+>

=item is_blocked, stat_7

Status indicates the process is blocked by a lock. B<F5+>

=item nice_priority, nice

The nice value of the process. The more positive the value, the
nicer the process (that is, the less it seeks to sit on the CPU).

=item process_lock_count, lock

Process lock count. If locked, swapping is prevented.

=item run_queue_index, rqindex

When multiple processes are runnable, the run queue index shows the
order in which the processes will be scheduled to run on the CPU.

=item current_cpu, oncpu

Identifies which CPU the process is running on.

Process.xs  view on Meta::CPAN

    hv_store(h, "sugid",        5, newSViv(NO_FREEBSD_4x(P_FLAG(P_SUGID))), 0);
    hv_store(h, "system",       6, newSViv(NO_FREEBSD_4x(P_FLAG(P_SYSTEM))), 0);
    hv_store(h, "single_exit", 11, newSViv(NO_FREEBSD_4x(P_FLAG(P_SINGLE_EXIT))), 0);
    hv_store(h, "traced",       6, newSViv(NO_FREEBSD_4x(P_FLAG(P_TRACED))), 0);
    hv_store(h, "waited",       6, newSViv(NO_FREEBSD_4x(P_FLAG(P_WAITED))), 0);
    hv_store(h, "wexit",        5, newSViv(NO_FREEBSD_4x(P_FLAG(P_WEXIT))), 0);
    hv_store(h, "exec",         4, newSViv(NO_FREEBSD_4x(P_FLAG(P_EXEC))), 0);
    hv_store(h, "hadthreads",  10, newSViv(NO_FREEBSD_5x(P_FLAG(P_HADTHREADS))), 0);

    hv_store(h, "kiflag",    6, newSViv(NO_FREEBSD_4x(kp->ki_kiflag)), 0);
    hv_store(h, "locked",    6, newSViv(NO_FREEBSD_4x(KI_FLAG(KI_LOCKBLOCK))), 0);
    hv_store(h, "isctty",    6, newSViv(NO_FREEBSD_4x(KI_FLAG(KI_CTTY))), 0);
    hv_store(h, "issleader", 9, newSViv(NO_FREEBSD_4x(KI_FLAG(KI_SLEADER))), 0);

    hv_store(h, "stat",        4, newSViv(NO_FREEBSD_4x((int)kp->ki_stat)), 0);
    hv_store(h, "stat_1",      6, newSViv(NO_FREEBSD_4x((int)kp->ki_stat == 1 ? 1 : 0)), 0);
    hv_store(h, "stat_2",      6, newSViv(NO_FREEBSD_4x((int)kp->ki_stat == 2 ? 1 : 0)), 0);
    hv_store(h, "stat_3",      6, newSViv(NO_FREEBSD_4x((int)kp->ki_stat == 3 ? 1 : 0)), 0);
    hv_store(h, "stat_4",      6, newSViv(NO_FREEBSD_4x((int)kp->ki_stat == 4 ? 1 : 0)), 0);
    hv_store(h, "stat_5",      6, newSViv(NO_FREEBSD_4x((int)kp->ki_stat == 5 ? 1 : 0)), 0);
    hv_store(h, "stat_6",      6, newSViv(NO_FREEBSD_4x((int)kp->ki_stat == 6 ? 1 : 0)), 0);

eg/procinfo  view on Meta::CPAN

    print "process has started profiling\n"         if $proc->profil;
    print "process has stopped profiling\n"         if $proc->stopprof;
    print "process has had threads\n"               if !$RUNNING_ON_FREEBSD_5 and $proc->hadthreads;
    print "process has set id privileges\n"         if $proc->sugid;
    print "process is a system process\n"           if $proc->system;
    print "threads should exit not wait\n"          if $proc->single_exit;
    print "process is traced by a debugger\n"       if $proc->traced;
    print "something is waiting for this process\n" if $proc->waited;
    print "process is preparing to exit\n"          if $proc->wexit;
    print "process called exec\n"                   if $proc->exec;
    print "process is locked\n"                     if $proc->locked;
    print "controlling terminal active\n"           if $proc->isctty;
    print "process is session leader\n"             if $proc->issleader;
    print "\n" if @pid > 1;
}

t/01-func.t  view on Meta::CPAN

ok( defined( delete $info->{profil} ), 'attribute profil');
ok( defined( delete $info->{stopprof} ), 'attribute stopprof');
ok( defined( delete $info->{sugid} ), 'attribute sugid');
ok( defined( delete $info->{system} ), 'attribute system');
ok( defined( delete $info->{single_exit} ), 'attribute single_exit');
ok( defined( delete $info->{traced} ), 'attribute traced');
ok( defined( delete $info->{waited} ), 'attribute waited');
ok( defined( delete $info->{wexit} ), 'attribute wexit');
ok( defined( delete $info->{exec} ), 'attribute exec');
ok( defined( delete $info->{kiflag} ), 'attribute kiflag');
ok( defined( delete $info->{locked} ), 'attribute locked');
ok( defined( delete $info->{isctty} ), 'attribute isctty');
ok( defined( delete $info->{issleader} ), 'attribute issleader');
ok( defined( delete $info->{stat} ), 'attribute stat');
ok( defined( delete $info->{stat_1} ), 'attribute stat_1');
ok( defined( delete $info->{stat_2} ), 'attribute stat_2');
ok( defined( delete $info->{stat_3} ), 'attribute stat_3');
ok( defined( delete $info->{stat_4} ), 'attribute stat_4');
ok( defined( delete $info->{stat_5} ), 'attribute stat_5');
ok( defined( delete $info->{stat_6} ), 'attribute stat_6');
ok( defined( delete $info->{stat_7} ), 'attribute stat_7');

t/02-method.t  view on Meta::CPAN

    is($pe->profil,      delete $pe->{profil},      'method profil');
    is($pe->stopprof,    delete $pe->{stopprof},    'method stopprof');
    is($pe->sugid,       delete $pe->{sugid},       'method sugid');
    is($pe->system,      delete $pe->{system},      'method system');
    is($pe->single_exit, delete $pe->{single_exit}, 'method single_exit');
    is($pe->traced,      delete $pe->{traced},      'method traced');
    is($pe->waited,      delete $pe->{waited},      'method waited');
    is($pe->wexit,       delete $pe->{wexit},       'method wexit');
    is($pe->exec,        delete $pe->{exec},        'method exec');
    is($pe->kiflag,      delete $pe->{kiflag},      'method kiflag');
    is($pe->locked,      delete $pe->{locked},      'method locked');
    is($pe->isctty,      delete $pe->{isctty},      'method isctty');
    is($pe->issleader,   delete $pe->{issleader},   'method issleader');
    is($pe->stat,        delete $pe->{stat},        'method stat');
    is($pe->stat_1,      delete $pe->{stat_1},      'method stat_1');
    is($pe->stat_2,      delete $pe->{stat_2},      'method stat_2');
    is($pe->stat_3,      delete $pe->{stat_3},      'method stat_3');
    is($pe->stat_4,      delete $pe->{stat_4},      'method stat_4');
    is($pe->stat_5,      delete $pe->{stat_5},      'method stat_5');
    is($pe->stat_6,      delete $pe->{stat_6},      'method stat_6');
    is($pe->stat_7,      delete $pe->{stat_7},      'method stat_7');

t/02-method.t  view on Meta::CPAN

    is($pe->started_profiling,             delete $pe->{profil},      'alias started_profiling');
    is($pe->stopped_profiling,             delete $pe->{stopprof},    'alias stopped_profiling');
    is($pe->id_privs_set,                  delete $pe->{sugid},       'alias id_privs_set');
    is($pe->system_process,                delete $pe->{system},      'alias system_process');
    is($pe->single_exit_not_wait,          delete $pe->{single_exit}, 'alias single_exit_not_wait');
    is($pe->traced_by_debugger,            delete $pe->{traced},      'alias traced_by_debugger');
    is($pe->waited_on_by_other,            delete $pe->{waited},      'alias waited_on_by_other');
    is($pe->working_on_exiting,            delete $pe->{wexit},       'alias working_on_exiting');
    is($pe->process_called_exec,           delete $pe->{exec},        'alias process_called_exec');
    is($pe->kernel_session_flag,           delete $pe->{kiflag},      'alias kernel_session_flag');
    is($pe->is_locked,                     delete $pe->{locked},      'alias is_locked');
    is($pe->controlling_tty_active,        delete $pe->{isctty},      'alias controlling_tty_active');
    is($pe->is_session_leader,             delete $pe->{issleader},   'alias is_session_leader');
    is($pe->process_status,                delete $pe->{stat},        'alias process_status');
    is($pe->is_being_forked,               delete $pe->{stat_1},      'alias is_being_forked');
    is($pe->is_runnable,                   delete $pe->{stat_2},      'alias is_runnable');
    is($pe->is_sleeping_on_addr,           delete $pe->{stat_3},      'alias is_sleeping_on_addr');
    is($pe->is_stopped,                    delete $pe->{stat_4},      'alias is_stopped');
    is($pe->is_a_zombie,                   delete $pe->{stat_5},      'alias is_a_zombie');
    is($pe->is_waiting_on_intr,            delete $pe->{stat_6},      'alias is_waiting_on_intr');
    is($pe->is_blocked,                    delete $pe->{stat_7},      'alias is_blocked');
    is($pe->old_command_name,              delete $pe->{ocomm},       'alias old_command_name');
    is($pe->name_of_lock,                  delete $pe->{lockname},    'alias name_of_lock');
    is($pe->priority_scheduling_class,     delete $pe->{pri_class},   'alias priority_scheduling_class');
    is($pe->priority_level,                delete $pe->{pri_level},   'alias priority_level');
    is($pe->priority_native,               delete $pe->{pri_native},  'alias priority_native');
    is($pe->priority_user,                 delete $pe->{pri_user},    'alias priority_user');
    is($pe->user_time,                     delete $pe->{utime},       'alias user_time');
    is($pe->system_time,                   delete $pe->{stime},       'alias system_time');
    is($pe->total_time,                    delete $pe->{time},        'alias total_time');
    is($pe->max_resident_set_size,         delete $pe->{maxrss},      'alias max_resident_set_size');



( run in 0.782 second using v1.01-cache-2.11-cpan-49f99fa48dc )