From e09a02ad3f95c9622be803d4074b85a55b91c2fa Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Sat, 7 Dec 2019 12:50:30 -0700 Subject: [PATCH] SystemMonitor: Show thread name instead of process name Add the thread name to CThreadStatistics and display it in the system monitor's process model instead of the process name. --- Applications/SystemMonitor/ProcessModel.cpp | 3 ++- Libraries/LibCore/CProcessStatisticsReader.cpp | 1 + Libraries/LibCore/CProcessStatisticsReader.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Applications/SystemMonitor/ProcessModel.cpp b/Applications/SystemMonitor/ProcessModel.cpp index d6a6b782de0..f79cb0b869f 100644 --- a/Applications/SystemMonitor/ProcessModel.cpp +++ b/Applications/SystemMonitor/ProcessModel.cpp @@ -295,11 +295,12 @@ void ProcessModel::update() state.ipv4_socket_write_bytes = thread.ipv4_socket_write_bytes; state.file_read_bytes = thread.file_read_bytes; state.file_write_bytes = thread.file_write_bytes; - state.name = it.value.name; state.amount_virtual = it.value.amount_virtual; state.amount_resident = it.value.amount_resident; state.icon_id = it.value.icon_id; + state.name = thread.name; + state.tid = thread.tid; state.times_scheduled = thread.times_scheduled; state.priority = thread.priority; diff --git a/Libraries/LibCore/CProcessStatisticsReader.cpp b/Libraries/LibCore/CProcessStatisticsReader.cpp index 39db980ee86..83e06424511 100644 --- a/Libraries/LibCore/CProcessStatisticsReader.cpp +++ b/Libraries/LibCore/CProcessStatisticsReader.cpp @@ -46,6 +46,7 @@ HashMap CProcessStatisticsReader::get_all() CThreadStatistics thread; thread.tid = thread_object.get("tid").to_u32(); thread.times_scheduled = thread_object.get("times_scheduled").to_u32(); + thread.name = thread_object.get("name").to_string(); thread.state = thread_object.get("state").to_string(); thread.ticks = thread_object.get("ticks").to_u32(); thread.priority = thread_object.get("priority").to_string(); diff --git a/Libraries/LibCore/CProcessStatisticsReader.h b/Libraries/LibCore/CProcessStatisticsReader.h index 05e9e9659e7..564c002ede0 100644 --- a/Libraries/LibCore/CProcessStatisticsReader.h +++ b/Libraries/LibCore/CProcessStatisticsReader.h @@ -20,6 +20,7 @@ struct CThreadStatistics { unsigned file_write_bytes; String state; String priority; + String name; }; struct CProcessStatistics {