mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 00:35:08 +00:00
Kernel+LibCore+SystemMonitor: Make thread statistics values 64-bit
Thread statistics values which count bytes are now 64-bit. This avoids overflow when these values go above 4GiB.
This commit is contained in:
parent
75307803a2
commit
8d721dc0f7
4 changed files with 36 additions and 36 deletions
|
@ -896,41 +896,41 @@ public:
|
|||
unsigned cow_faults() const { return m_cow_faults; }
|
||||
void did_cow_fault() { ++m_cow_faults; }
|
||||
|
||||
unsigned file_read_bytes() const { return m_file_read_bytes; }
|
||||
unsigned file_write_bytes() const { return m_file_write_bytes; }
|
||||
u64 file_read_bytes() const { return m_file_read_bytes; }
|
||||
u64 file_write_bytes() const { return m_file_write_bytes; }
|
||||
|
||||
void did_file_read(unsigned bytes)
|
||||
void did_file_read(u64 bytes)
|
||||
{
|
||||
m_file_read_bytes += bytes;
|
||||
}
|
||||
|
||||
void did_file_write(unsigned bytes)
|
||||
void did_file_write(u64 bytes)
|
||||
{
|
||||
m_file_write_bytes += bytes;
|
||||
}
|
||||
|
||||
unsigned unix_socket_read_bytes() const { return m_unix_socket_read_bytes; }
|
||||
unsigned unix_socket_write_bytes() const { return m_unix_socket_write_bytes; }
|
||||
u64 unix_socket_read_bytes() const { return m_unix_socket_read_bytes; }
|
||||
u64 unix_socket_write_bytes() const { return m_unix_socket_write_bytes; }
|
||||
|
||||
void did_unix_socket_read(unsigned bytes)
|
||||
void did_unix_socket_read(u64 bytes)
|
||||
{
|
||||
m_unix_socket_read_bytes += bytes;
|
||||
}
|
||||
|
||||
void did_unix_socket_write(unsigned bytes)
|
||||
void did_unix_socket_write(u64 bytes)
|
||||
{
|
||||
m_unix_socket_write_bytes += bytes;
|
||||
}
|
||||
|
||||
unsigned ipv4_socket_read_bytes() const { return m_ipv4_socket_read_bytes; }
|
||||
unsigned ipv4_socket_write_bytes() const { return m_ipv4_socket_write_bytes; }
|
||||
u64 ipv4_socket_read_bytes() const { return m_ipv4_socket_read_bytes; }
|
||||
u64 ipv4_socket_write_bytes() const { return m_ipv4_socket_write_bytes; }
|
||||
|
||||
void did_ipv4_socket_read(unsigned bytes)
|
||||
void did_ipv4_socket_read(u64 bytes)
|
||||
{
|
||||
m_ipv4_socket_read_bytes += bytes;
|
||||
}
|
||||
|
||||
void did_ipv4_socket_write(unsigned bytes)
|
||||
void did_ipv4_socket_write(u64 bytes)
|
||||
{
|
||||
m_ipv4_socket_write_bytes += bytes;
|
||||
}
|
||||
|
@ -1210,14 +1210,14 @@ private:
|
|||
unsigned m_zero_faults { 0 };
|
||||
unsigned m_cow_faults { 0 };
|
||||
|
||||
unsigned m_file_read_bytes { 0 };
|
||||
unsigned m_file_write_bytes { 0 };
|
||||
u64 m_file_read_bytes { 0 };
|
||||
u64 m_file_write_bytes { 0 };
|
||||
|
||||
unsigned m_unix_socket_read_bytes { 0 };
|
||||
unsigned m_unix_socket_write_bytes { 0 };
|
||||
u64 m_unix_socket_read_bytes { 0 };
|
||||
u64 m_unix_socket_write_bytes { 0 };
|
||||
|
||||
unsigned m_ipv4_socket_read_bytes { 0 };
|
||||
unsigned m_ipv4_socket_write_bytes { 0 };
|
||||
u64 m_ipv4_socket_read_bytes { 0 };
|
||||
u64 m_ipv4_socket_write_bytes { 0 };
|
||||
|
||||
FPUState m_fpu_state {};
|
||||
State m_state { Thread::State::Invalid };
|
||||
|
|
|
@ -123,12 +123,12 @@ private:
|
|||
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 };
|
||||
u64 unix_socket_read_bytes { 0 };
|
||||
u64 unix_socket_write_bytes { 0 };
|
||||
u64 ipv4_socket_read_bytes { 0 };
|
||||
u64 ipv4_socket_write_bytes { 0 };
|
||||
u64 file_read_bytes { 0 };
|
||||
u64 file_write_bytes { 0 };
|
||||
float cpu_percent { 0 };
|
||||
float cpu_percent_kernel { 0 };
|
||||
Process& process;
|
||||
|
|
|
@ -68,12 +68,12 @@ ErrorOr<AllProcessesStatistics> ProcessStatisticsReader::get_all(SeekableStream&
|
|||
thread.inode_faults = thread_object.get_u32("inode_faults"sv).value_or(0);
|
||||
thread.zero_faults = thread_object.get_u32("zero_faults"sv).value_or(0);
|
||||
thread.cow_faults = thread_object.get_u32("cow_faults"sv).value_or(0);
|
||||
thread.unix_socket_read_bytes = thread_object.get_u32("unix_socket_read_bytes"sv).value_or(0);
|
||||
thread.unix_socket_write_bytes = thread_object.get_u32("unix_socket_write_bytes"sv).value_or(0);
|
||||
thread.ipv4_socket_read_bytes = thread_object.get_u32("ipv4_socket_read_bytes"sv).value_or(0);
|
||||
thread.ipv4_socket_write_bytes = thread_object.get_u32("ipv4_socket_write_bytes"sv).value_or(0);
|
||||
thread.file_read_bytes = thread_object.get_u32("file_read_bytes"sv).value_or(0);
|
||||
thread.file_write_bytes = thread_object.get_u32("file_write_bytes"sv).value_or(0);
|
||||
thread.unix_socket_read_bytes = thread_object.get_u64("unix_socket_read_bytes"sv).value_or(0);
|
||||
thread.unix_socket_write_bytes = thread_object.get_u64("unix_socket_write_bytes"sv).value_or(0);
|
||||
thread.ipv4_socket_read_bytes = thread_object.get_u64("ipv4_socket_read_bytes"sv).value_or(0);
|
||||
thread.ipv4_socket_write_bytes = thread_object.get_u64("ipv4_socket_write_bytes"sv).value_or(0);
|
||||
thread.file_read_bytes = thread_object.get_u64("file_read_bytes"sv).value_or(0);
|
||||
thread.file_write_bytes = thread_object.get_u64("file_write_bytes"sv).value_or(0);
|
||||
process.threads.append(move(thread));
|
||||
});
|
||||
|
||||
|
|
|
@ -22,12 +22,12 @@ struct ThreadStatistics {
|
|||
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;
|
||||
u64 unix_socket_read_bytes;
|
||||
u64 unix_socket_write_bytes;
|
||||
u64 ipv4_socket_read_bytes;
|
||||
u64 ipv4_socket_write_bytes;
|
||||
u64 file_read_bytes;
|
||||
u64 file_write_bytes;
|
||||
DeprecatedString state;
|
||||
u32 cpu;
|
||||
u32 priority;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue