blob: 45c369e4872f62938efa8f0b0ab05eb7767fd340 [file] [log] [blame] [raw]
/* Do not edit this file. It was automatically generated. */
#ifndef HEADER_linux_LinuxProcess
#define HEADER_linux_LinuxProcess
/*
htop - linux/LinuxProcess.h
(C) 2014 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
#ifdef __linux__
#endif
#define PROCESS_FLAG_LINUX_IOPRIO 0x0100
#define PROCESS_FLAG_LINUX_OPENVZ 0x0200
#define PROCESS_FLAG_LINUX_VSERVER 0x0400
#define PROCESS_FLAG_LINUX_CGROUP 0x0800
#define PROCESS_FLAG_LINUX_OOM 0x1000
typedef enum {
HTOP_FLAGS_FIELD = 9,
HTOP_ITREALVALUE_FIELD = 20,
HTOP_VSIZE_FIELD = 22,
HTOP_RSS_FIELD = 23,
HTOP_RLIM_FIELD = 24,
HTOP_STARTCODE_FIELD = 25,
HTOP_ENDCODE_FIELD = 26,
HTOP_STARTSTACK_FIELD = 27,
HTOP_KSTKESP_FIELD = 28,
HTOP_KSTKEIP_FIELD = 29,
HTOP_SIGNAL_FIELD = 30,
HTOP_BLOCKED_FIELD = 31,
HTOP_SSIGIGNORE_FIELD = 32,
HTOP_SIGCATCH_FIELD = 33,
HTOP_WCHAN_FIELD = 34,
HTOP_NSWAP_FIELD = 35,
HTOP_CNSWAP_FIELD = 36,
HTOP_EXIT_SIGNAL_FIELD = 37,
} UnsupportedProcessField;
typedef enum {
HTOP_CMINFLT_FIELD = 11,
HTOP_CMAJFLT_FIELD = 13,
HTOP_UTIME_FIELD = 14,
HTOP_STIME_FIELD = 15,
HTOP_CUTIME_FIELD = 16,
HTOP_CSTIME_FIELD = 17,
HTOP_M_SHARE_FIELD = 41,
HTOP_M_TRS_FIELD = 42,
HTOP_M_DRS_FIELD = 43,
HTOP_M_LRS_FIELD = 44,
HTOP_M_DT_FIELD = 45,
#ifdef HAVE_OPENVZ
HTOP_CTID_FIELD = 100,
HTOP_VPID_FIELD = 101,
#endif
#ifdef HAVE_VSERVER
HTOP_VXID_FIELD = 102,
#endif
#ifdef HAVE_TASKSTATS
HTOP_RCHAR_FIELD = 103,
HTOP_WCHAR_FIELD = 104,
HTOP_SYSCR_FIELD = 105,
HTOP_SYSCW_FIELD = 106,
HTOP_RBYTES_FIELD = 107,
HTOP_WBYTES_FIELD = 108,
HTOP_CNCLWB_FIELD = 109,
HTOP_IO_READ_RATE_FIELD = 110,
HTOP_IO_WRITE_RATE_FIELD = 111,
HTOP_IO_RATE_FIELD = 112,
#endif
#ifdef HAVE_CGROUP
HTOP_CGROUP_FIELD = 113,
#endif
HTOP_OOM_FIELD = 114,
HTOP_IO_PRIORITY_FIELD = 115,
#ifdef HAVE_DELAYACCT
HTOP_PERCENT_CPU_DELAY_FIELD = 116,
HTOP_PERCENT_IO_DELAY_FIELD = 117,
HTOP_PERCENT_SWAP_DELAY_FIELD = 118,
#endif
HTOP_LAST_PROCESSFIELD = 119,
} LinuxProcessField;
#include "IOPriority.h"
typedef struct LinuxProcess_ {
Process super;
bool is_kernel_process;
IOPriority ioPriority;
unsigned long int cminflt;
unsigned long int cmajflt;
unsigned long long int utime;
unsigned long long int stime;
unsigned long long int cutime;
unsigned long long int cstime;
long m_share;
long m_trs;
long m_drs;
long m_lrs;
long m_dt;
unsigned long long starttime;
#ifdef HAVE_TASKSTATS
unsigned long long io_rchar;
unsigned long long io_wchar;
unsigned long long io_syscr;
unsigned long long io_syscw;
unsigned long long io_read_bytes;
unsigned long long io_write_bytes;
unsigned long long io_cancelled_write_bytes;
unsigned long long io_rate_read_time;
unsigned long long io_rate_write_time;
double io_rate_read_bps;
double io_rate_write_bps;
#endif
#ifdef HAVE_OPENVZ
unsigned int ctid;
unsigned int vpid;
#endif
#ifdef HAVE_VSERVER
unsigned int vxid;
#endif
#ifdef HAVE_CGROUP
char* cgroup;
#endif
unsigned int oom;
char* ttyDevice;
#ifdef HAVE_DELAYACCT
unsigned long long int delay_read_time;
unsigned long long cpu_delay_total;
unsigned long long blkio_delay_total;
unsigned long long swapin_delay_total;
float cpu_delay_percent;
float blkio_delay_percent;
float swapin_delay_percent;
#endif
} LinuxProcess;
extern long long btime;
extern FieldData Process_fields[];
extern ProcessPidColumn Process_pidColumns[];
extern ProcessClass LinuxProcess_class;
LinuxProcess* LinuxProcess_new(Settings* settings);
void Process_delete(Object* cast);
/*
[1] Note that before kernel 2.6.26 a process that has not asked for
an io priority formally uses "none" as scheduling class, but the
io scheduler will treat such processes as if it were in the best
effort class. The priority within the best effort class will be
dynamically derived from the cpu nice level of the process:
extern io_priority;
*/
#define LinuxProcess_effectiveIOPriority(p_) (IOPriority_class(p_->ioPriority) == IOPRIO_CLASS_NONE ? IOPriority_tuple(IOPRIO_CLASS_BE, (p_->super.nice + 20) / 5) : p_->ioPriority)
IOPriority LinuxProcess_updateIOPriority(LinuxProcess* this);
bool LinuxProcess_setIOPriority(LinuxProcess* this, IOPriority ioprio);
#ifdef HAVE_DELAYACCT
void LinuxProcess_printDelay(float delay_percent, char* buffer, int n);
#endif
void LinuxProcess_writeField(const Process *this, RichString* str, ProcessField field);
long LinuxProcess_compare(const void* v1, const void* v2);
bool Process_isKernelProcess(const Process *this);
bool Process_isExtraThreadProcess(const Process *this);
char **Process_getKernelStackTrace(const Process *this);
#endif