2019-05-16 18:47:47 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AK/AKString.h>
|
|
|
|
#include <AK/HashMap.h>
|
|
|
|
|
|
|
|
struct CProcessStatistics {
|
|
|
|
pid_t pid;
|
|
|
|
unsigned nsched;
|
|
|
|
String name;
|
|
|
|
String state;
|
|
|
|
String username;
|
|
|
|
uid_t uid;
|
|
|
|
String priority;
|
2019-06-07 12:44:29 +02:00
|
|
|
size_t virtual_size;
|
|
|
|
size_t physical_size;
|
2019-05-16 18:47:47 +02:00
|
|
|
unsigned syscalls;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CProcessStatisticsReader {
|
|
|
|
public:
|
2019-07-10 13:56:28 +02:00
|
|
|
static HashMap<pid_t, CProcessStatistics> get_all();
|
2019-05-16 18:47:47 +02:00
|
|
|
|
|
|
|
private:
|
2019-07-10 13:56:28 +02:00
|
|
|
static String username_from_uid(uid_t);
|
|
|
|
static HashMap<uid_t, String> s_usernames;
|
2019-05-16 18:47:47 +02:00
|
|
|
};
|