SystemMonitor: Default initialize all thread state variables

Having bogus values here when we just initialize the thread state with a
process can lead to all sorts of bad things down the line, like infinite
draws.
This commit is contained in:
kleines Filmröllchen 2022-04-06 21:02:40 +02:00 committed by Andreas Kling
parent bafaff61c9
commit 8545e2dec0
Notes: sideshowbarker 2024-07-17 14:33:07 +09:00

View file

@ -94,41 +94,41 @@ private:
struct Process;
struct ThreadState {
pid_t tid;
pid_t pid;
pid_t ppid;
pid_t pgid;
pid_t sid;
u64 time_user;
u64 time_kernel;
bool kernel;
String executable;
String name;
uid_t uid;
String state;
String user;
String pledge;
String veil;
u32 cpu;
u32 priority;
size_t amount_virtual;
size_t amount_resident;
size_t amount_dirty_private;
size_t amount_clean_inode;
size_t amount_purgeable_volatile;
size_t amount_purgeable_nonvolatile;
unsigned syscall_count;
unsigned inode_faults;
unsigned zero_faults;
unsigned cow_faults;
unsigned unix_socket_read_bytes;
unsigned unix_socket_write_bytes;
unsigned ipv4_socket_read_bytes;
unsigned ipv4_socket_write_bytes;
unsigned file_read_bytes;
unsigned file_write_bytes;
float cpu_percent;
float cpu_percent_kernel;
pid_t tid { 0 };
pid_t pid { 0 };
pid_t ppid { 0 };
pid_t pgid { 0 };
pid_t sid { 0 };
u64 time_user { 0 };
u64 time_kernel { 0 };
bool kernel { false };
String executable { "" };
String name { "" };
uid_t uid { 0 };
String state { "" };
String user { "" };
String pledge { "" };
String veil { "" };
u32 cpu { 0 };
u32 priority { 0 };
size_t amount_virtual { 0 };
size_t amount_resident { 0 };
size_t amount_dirty_private { 0 };
size_t amount_clean_inode { 0 };
size_t amount_purgeable_volatile { 0 };
size_t amount_purgeable_nonvolatile { 0 };
unsigned syscall_count { 0 };
unsigned inode_faults { 0 };
unsigned zero_faults { 0 };
unsigned cow_faults { 0 };
unsigned unix_socket_read_bytes { 0 };
unsigned unix_socket_write_bytes { 0 };
unsigned ipv4_socket_read_bytes { 0 };
unsigned ipv4_socket_write_bytes { 0 };
unsigned file_read_bytes { 0 };
unsigned file_write_bytes { 0 };
float cpu_percent { 0 };
float cpu_percent_kernel { 0 };
Process& process;
ThreadState(Process& argument_process)