mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:37:37 +00:00
Kernel: Expose per-thread information in /proc/all
Previously it was not possible to see what each thread in a process was up to, or how much CPU it was consuming. This patch fixes that. SystemMonitor and "top" now show threads instead of just processes. "ps" is gonna need some more fixing, but it at least builds for now. Fixes #66.
This commit is contained in:
parent
86a9a52355
commit
712ae73581
9 changed files with 243 additions and 123 deletions
|
@ -1,19 +1,26 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/String.h>
|
||||
#include <unistd.h>
|
||||
|
||||
struct CThreadStatistics {
|
||||
int tid;
|
||||
unsigned times_scheduled;
|
||||
unsigned ticks;
|
||||
String state;
|
||||
String priority;
|
||||
};
|
||||
|
||||
struct CProcessStatistics {
|
||||
// Keep this in sync with /proc/all.
|
||||
// From the kernel side:
|
||||
pid_t pid;
|
||||
unsigned times_scheduled;
|
||||
unsigned pgid;
|
||||
unsigned pgp;
|
||||
unsigned sid;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
String state;
|
||||
pid_t ppid;
|
||||
unsigned nfds;
|
||||
String name;
|
||||
|
@ -21,14 +28,14 @@ struct CProcessStatistics {
|
|||
size_t amount_virtual;
|
||||
size_t amount_resident;
|
||||
size_t amount_shared;
|
||||
unsigned ticks;
|
||||
String priority;
|
||||
unsigned syscall_count;
|
||||
unsigned inode_faults;
|
||||
unsigned zero_faults;
|
||||
unsigned cow_faults;
|
||||
int icon_id;
|
||||
|
||||
Vector<CThreadStatistics> threads;
|
||||
|
||||
// synthetic
|
||||
String username;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue