evisum/src/bin/system/process.h

108 lines
1.8 KiB
C
Raw Normal View History

2018-06-04 03:11:21 -07:00
#ifndef __PROC_H__
#define __PROC_H__
#include <Eina.h>
#include <stdint.h>
#include <unistd.h>
#if !defined(PID_MAX)
# define PID_MAX 99999
#endif
2020-04-16 14:03:25 -07:00
typedef struct _Proc_Info
2018-06-04 03:11:21 -07:00
{
pid_t pid;
2020-08-11 03:49:49 -07:00
pid_t ppid;
2018-06-04 03:11:21 -07:00
uid_t uid;
int8_t nice;
int8_t priority;
int cpu_id;
int32_t numthreads;
int64_t cpu_time;
2020-05-31 10:43:16 -07:00
double cpu_usage;
2021-02-02 05:54:49 -08:00
int64_t run_time;
int64_t start;
2020-04-22 07:08:16 -07:00
2020-07-09 15:39:15 -07:00
uint64_t mem_size;
uint64_t mem_virt;
uint64_t mem_rss;
uint64_t mem_shared;
2020-04-22 07:08:16 -07:00
2020-04-22 02:10:02 -07:00
char *command;
char *arguments;
2021-02-07 04:58:54 -08:00
int ssleep;
2021-02-02 12:18:54 -08:00
char state[32];
2018-06-04 03:11:21 -07:00
2020-11-11 19:56:37 -08:00
short is_kernel;
2020-05-15 13:17:00 -07:00
int tid;
char *thread_name;
Eina_List *threads;
2020-10-03 06:19:29 -07:00
Eina_List *children;
2020-04-16 14:03:25 -07:00
} Proc_Info;
2018-06-04 03:11:21 -07:00
Eina_List *
2020-05-13 13:13:01 -07:00
proc_info_all_get(void);
2018-06-04 03:11:21 -07:00
2020-04-16 14:03:25 -07:00
Proc_Info *
2020-05-13 13:13:01 -07:00
proc_info_by_pid(int pid);
2018-06-04 03:11:21 -07:00
2020-04-22 02:10:02 -07:00
void
2020-05-13 13:13:01 -07:00
proc_info_free(Proc_Info *proc);
2020-04-22 02:10:02 -07:00
void
proc_info_kthreads_show_set(Eina_Bool enabled);
Eina_Bool
proc_info_kthreads_show_get(void);
2020-10-03 06:19:29 -07:00
Eina_List *
proc_info_all_children_get(void);
Eina_List *
proc_info_pid_children_get(pid_t pid);
void
proc_info_pid_children_free(Proc_Info *procs);
2018-06-04 03:11:21 -07:00
2021-02-06 00:50:53 -08:00
int
proc_sort_by_pid(const void *p1, const void *p2);
int
proc_sort_by_uid(const void *p1, const void *p2);
int
proc_sort_by_nice(const void *p1, const void *p2);
int
proc_sort_by_pri(const void *p1, const void *p2);
int
proc_sort_by_cpu(const void *p1, const void *p2);
int
proc_sort_by_threads(const void *p1, const void *p2);
int
proc_sort_by_size(const void *p1, const void *p2);
int
proc_sort_by_rss(const void *p1, const void *p2);
int
proc_sort_by_time(const void *p1, const void *p2);
int
proc_sort_by_cpu_usage(const void *p1, const void *p2);
int
proc_sort_by_cmd(const void *p1, const void *p2);
int
proc_sort_by_state(const void *p1, const void *p2);
int
proc_sort_by_age(const void *p1, const void *p2);
2018-06-04 03:11:21 -07:00
#endif