Adds support for linux delay accounting (#667)

Adds support for showing columns with linux delay accounting.

This information can be read from the netlink interface, and thus we set up a socket to read from that when initializing the LinuxProcessList (LinuxProcessList_initNetlinkSocket). After that, for each process we call LinuxProcessList_readDelayAcctData, which sends a message thru the socket after setting up a callback to get the answer from the Kernel. That callback sets the process total delay time attribute. We then set the delay percent as the percentage of time process cpu time since last scan.
This commit is contained in:
André Carvalho
2017-12-04 00:15:29 -02:00
committed by Hisham Muhammad
parent 52831955c7
commit b7b66b76a5
6 changed files with 209 additions and 2 deletions

View File

@ -9,6 +9,9 @@ Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
#ifdef HAVE_DELAYACCT
#endif
#include "ProcessList.h"
@ -53,6 +56,10 @@ typedef struct LinuxProcessList_ {
CPUData* cpus;
TtyDriver* ttyDrivers;
#ifdef HAVE_DELAYACCT
struct nl_sock *netlink_socket;
int netlink_family;
#endif
} LinuxProcessList;
#ifndef PROCDIR
@ -80,6 +87,10 @@ typedef struct LinuxProcessList_ {
#define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x)))
#endif
#ifdef HAVE_DELAYACCT
#endif
ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId);
void ProcessList_delete(ProcessList* pl);
@ -101,6 +112,10 @@ void ProcessList_delete(ProcessList* pl);
#endif
#ifdef HAVE_DELAYACCT
#endif
void ProcessList_goThroughEntries(ProcessList* super);
#endif