diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2020-08-09 21:44:40 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-12 11:28:45 +0200 |
commit | 81b491a7a48cd9604fe321499dce71c556f693ac (patch) | |
tree | 78a5fda32305fd88259fee6e513acb5d37c0f589 /Applications | |
parent | dbbdb39c1f602f8be852ee82221e02b4b0bc95a3 (diff) | |
download | serenity-81b491a7a48cd9604fe321499dce71c556f693ac.zip |
SystemMonitor: Show PPID, PGID, SID
With this information, it's a bit easier to intuit the current 'process tree'.
If you're reading this, can I convince you to implement a nice process tree for
SystemMonitor? It could be via PPID (unbounded depth), or SID+PGID (depth 3).
Or something else entirely :D
Diffstat (limited to 'Applications')
-rw-r--r-- | Applications/SystemMonitor/ProcessModel.cpp | 24 | ||||
-rw-r--r-- | Applications/SystemMonitor/ProcessModel.h | 8 |
2 files changed, 31 insertions, 1 deletions
diff --git a/Applications/SystemMonitor/ProcessModel.cpp b/Applications/SystemMonitor/ProcessModel.cpp index 5fe3353781..26b94d1606 100644 --- a/Applications/SystemMonitor/ProcessModel.cpp +++ b/Applications/SystemMonitor/ProcessModel.cpp @@ -90,6 +90,12 @@ String ProcessModel::column_name(int column) const return "PID"; case Column::TID: return "TID"; + case Column::PPID: + return "PPID"; + case Column::PGID: + return "PGID"; + case Column::SID: + return "SID"; case Column::State: return "State"; case Column::User: @@ -165,6 +171,9 @@ GUI::Variant ProcessModel::data(const GUI::ModelIndex& index, Role role) const return Gfx::TextAlignment::CenterLeft; case Column::PID: case Column::TID: + case Column::PPID: + case Column::PGID: + case Column::SID: case Column::Priority: case Column::EffectivePriority: case Column::Virtual: @@ -202,6 +211,12 @@ GUI::Variant ProcessModel::data(const GUI::ModelIndex& index, Role role) const return thread.current_state.pid; case Column::TID: return thread.current_state.tid; + case Column::PPID: + return thread.current_state.ppid; + case Column::PGID: + return thread.current_state.pgid; + case Column::SID: + return thread.current_state.sid; case Column::State: return thread.current_state.state; case Column::User: @@ -273,6 +288,12 @@ GUI::Variant ProcessModel::data(const GUI::ModelIndex& index, Role role) const return thread.current_state.pid; case Column::TID: return thread.current_state.tid; + case Column::PPID: + return thread.current_state.ppid; + case Column::PGID: + return thread.current_state.pgid; + case Column::SID: + return thread.current_state.sid; case Column::State: return thread.current_state.state; case Column::User: @@ -366,7 +387,10 @@ void ProcessModel::update() state.name = thread.name; + state.ppid = it.value.ppid; state.tid = thread.tid; + state.pgid = it.value.pgid; + state.sid = it.value.sid; state.times_scheduled = thread.times_scheduled; state.cpu = thread.cpu; state.priority = thread.priority; diff --git a/Applications/SystemMonitor/ProcessModel.h b/Applications/SystemMonitor/ProcessModel.h index e6f254d9a4..a60053ef10 100644 --- a/Applications/SystemMonitor/ProcessModel.h +++ b/Applications/SystemMonitor/ProcessModel.h @@ -57,6 +57,9 @@ public: User, PID, TID, + PPID, + PGID, + SID, Virtual, Physical, DirtyPrivate, @@ -107,8 +110,11 @@ private: ProcessModel(); struct ThreadState { - int tid; + pid_t tid; pid_t pid; + pid_t ppid; + pid_t pgid; + pid_t sid; unsigned times_scheduled; String name; String state; |