From 1df0f481922acfb5f7af0f3a5cb800ec0f77e48f Mon Sep 17 00:00:00 2001 From: Vadim Kochan Date: Thu, 19 Jan 2017 01:09:04 +0200 Subject: 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/ 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 Signed-off-by: Tobias Klauser --- proc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'proc.h') 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 +#include 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 */ -- cgit v1.2.3-54-g00ecf