summaryrefslogtreecommitdiff
path: root/proc.h
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2017-01-19 01:09:04 +0200
committerTobias Klauser <tklauser@distanz.ch>2017-01-25 13:23:38 +0100
commit1df0f481922acfb5f7af0f3a5cb800ec0f77e48f (patch)
tree6386a0c66c673a43bef386d58203712da0e27ef3 /proc.h
parent60648a858b83b63e8dbdd1c45bb901d1206ae444 (diff)
flowtop: Add process UI tab entry
Add process UI tab entry to show flows statistics per pid. Also changed flow_entry which now has pointer to new struct proc_entry object which contains process related info. On each 1 second refresh proc_entry is checked if it exists by checking /proc/<pid> path, and is deleted if there is no any flows related to it (flows_count is 0), if the process exists then dst & src rates info is zeroed and summed from the all related flows which are in the proc_entry->flows list. The bytes & pkts amount info is collected during all the time process exists. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'proc.h')
-rw-r--r--proc.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/proc.h b/proc.h
index 6e5f3ac..4c34a64 100644
--- a/proc.h
+++ b/proc.h
@@ -1,7 +1,7 @@
#ifndef PROC_H
#define PROC_H
-#include <stdlib.h>
+#include <stdbool.h>
extern void cpu_affinity(int cpu);
extern int set_proc_prio(int prio);
@@ -9,5 +9,6 @@ extern int set_sched_status(int policy, int priority);
extern ssize_t proc_get_cmdline(unsigned int pid, char *cmdline, size_t len);
extern int proc_exec(const char *proc, char *const argv[]);
extern int proc_find_by_inode(ino_t ino, char *cmdline, size_t len, pid_t *pid);
+extern bool proc_exists(pid_t pid);
#endif /* PROC_H */