The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

IO::Socket::Netlink::Taskstats - Object interface to Taskstats generic netlink protocol sockets

SYNOPSIS

 use IO::Socket::Netlink::Taskstats;

 my $sock = IO::Socket::Netlink::Taskstats->new;

 my $stats = $sock->get_process_info_by_pid( $$ );

 printf "So far, %s has consumed %d usec in userland and %d in kernel\n",
    $stats->{ac_comm},
    $stats->{ac_utime},
    $stats->{ac_stime};

DESCRIPTION

This subclass of IO::Socket::Netlink::Generic implements the Taskstats generic netlink protocol. This protocol allows detailed statistics gathering of resource usage on a per-process basis, and notification of resources used by processes at the time they exit.

This module is currently a work-in-progress, and this documentation is fairly minimal. The reader is expected to be familiar with Taskstats, only a fairly minimal description of the Perl-level wrapping is given here.

METHODS

$info = $sock->get_process_info_by_pid( $pid )

Returns an information structure containing the statistics about the process with the given PID.

$sock->register_cpumask( $mask )

$sock->deregister_cpumask( $mask )

Register or deregister this socket to receive process exit notifications, for processes exiting on CPUs given by the $mask.

MESSAGE OBJECTS

Provides the following netlink attributes

  • pid => INT

  • tgid => INT

  • stats => HASH

  • aggr_pid => HASH

  • aggr_tgid => HASH

SEE ALSO

AUTHOR

Paul Evans <leonerd@leonerd.org.uk>