mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 16:35:08 +00:00

We now have a little widget that sits above the terminal view in the build/application console. When a child process is running, we show its PID, name, scheduling counter, and amount of resident memory in a live little overview. This is not working right just yet, since we don't know how to get to the actually active PID on the TTY. Or, well, we find the active PID by looking at the PGID of our fork()ed child. This manages to find children spawned by Shell, but not children spawned by make, for instance. I need to figure out how to find those.
28 lines
505 B
C++
28 lines
505 B
C++
#pragma once
|
|
|
|
#include <LibGUI/GWidget.h>
|
|
|
|
class CTimer;
|
|
class GLabel;
|
|
|
|
class ProcessStateWidget final : public GWidget {
|
|
C_OBJECT(ProcessStateWidget)
|
|
public:
|
|
virtual ~ProcessStateWidget() override;
|
|
|
|
void set_pid(pid_t);
|
|
|
|
private:
|
|
explicit ProcessStateWidget(GWidget* parent);
|
|
|
|
void refresh();
|
|
|
|
RefPtr<GLabel> m_pid_label;
|
|
RefPtr<GLabel> m_state_label;
|
|
RefPtr<GLabel> m_cpu_label;
|
|
RefPtr<GLabel> m_memory_label;
|
|
|
|
RefPtr<CTimer> m_timer;
|
|
|
|
pid_t m_pid { -1 };
|
|
};
|