mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00
SystemMonitor: ProcessStack is now ThreadStack
This is a follow-up to #3095. In particular: https://github.com/SerenityOS/serenity/pull/3095#discussion_r469113354
This commit is contained in:
parent
46e53417c9
commit
cebf8ae3b7
4 changed files with 12 additions and 12 deletions
|
@ -7,8 +7,8 @@ set(SOURCES
|
||||||
ProcessFileDescriptorMapWidget.cpp
|
ProcessFileDescriptorMapWidget.cpp
|
||||||
ProcessMemoryMapWidget.cpp
|
ProcessMemoryMapWidget.cpp
|
||||||
ProcessModel.cpp
|
ProcessModel.cpp
|
||||||
ProcessStackWidget.cpp
|
|
||||||
ProcessUnveiledPathsWidget.cpp
|
ProcessUnveiledPathsWidget.cpp
|
||||||
|
ThreadStackWidget.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
serenity_bin(SystemMonitor)
|
serenity_bin(SystemMonitor)
|
||||||
|
|
|
@ -24,13 +24,13 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ProcessStackWidget.h"
|
#include "ThreadStackWidget.h"
|
||||||
#include <AK/ByteBuffer.h>
|
#include <AK/ByteBuffer.h>
|
||||||
#include <LibCore/File.h>
|
#include <LibCore/File.h>
|
||||||
#include <LibCore/Timer.h>
|
#include <LibCore/Timer.h>
|
||||||
#include <LibGUI/BoxLayout.h>
|
#include <LibGUI/BoxLayout.h>
|
||||||
|
|
||||||
ProcessStackWidget::ProcessStackWidget()
|
ThreadStackWidget::ThreadStackWidget()
|
||||||
{
|
{
|
||||||
set_layout<GUI::VerticalBoxLayout>();
|
set_layout<GUI::VerticalBoxLayout>();
|
||||||
layout()->set_margins({ 4, 4, 4, 4 });
|
layout()->set_margins({ 4, 4, 4, 4 });
|
||||||
|
@ -40,11 +40,11 @@ ProcessStackWidget::ProcessStackWidget()
|
||||||
m_timer = add<Core::Timer>(1000, [this] { refresh(); });
|
m_timer = add<Core::Timer>(1000, [this] { refresh(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessStackWidget::~ProcessStackWidget()
|
ThreadStackWidget::~ThreadStackWidget()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProcessStackWidget::set_ids(pid_t pid, pid_t tid)
|
void ThreadStackWidget::set_ids(pid_t pid, pid_t tid)
|
||||||
{
|
{
|
||||||
if (m_pid == pid && m_tid == tid)
|
if (m_pid == pid && m_tid == tid)
|
||||||
return;
|
return;
|
||||||
|
@ -53,7 +53,7 @@ void ProcessStackWidget::set_ids(pid_t pid, pid_t tid)
|
||||||
refresh();
|
refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProcessStackWidget::refresh()
|
void ThreadStackWidget::refresh()
|
||||||
{
|
{
|
||||||
auto file = Core::File::construct(String::format("/proc/%d/stacks/%d", m_pid, m_tid));
|
auto file = Core::File::construct(String::format("/proc/%d/stacks/%d", m_pid, m_tid));
|
||||||
if (!file->open(Core::IODevice::ReadOnly)) {
|
if (!file->open(Core::IODevice::ReadOnly)) {
|
|
@ -29,16 +29,16 @@
|
||||||
#include <LibGUI/TextEditor.h>
|
#include <LibGUI/TextEditor.h>
|
||||||
#include <LibGUI/Widget.h>
|
#include <LibGUI/Widget.h>
|
||||||
|
|
||||||
class ProcessStackWidget final : public GUI::Widget {
|
class ThreadStackWidget final : public GUI::Widget {
|
||||||
C_OBJECT(ProcessStackWidget)
|
C_OBJECT(ThreadStackWidget)
|
||||||
public:
|
public:
|
||||||
virtual ~ProcessStackWidget() override;
|
virtual ~ThreadStackWidget() override;
|
||||||
|
|
||||||
void set_ids(pid_t pid, pid_t tid);
|
void set_ids(pid_t pid, pid_t tid);
|
||||||
void refresh();
|
void refresh();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ProcessStackWidget();
|
ThreadStackWidget();
|
||||||
|
|
||||||
pid_t m_pid { -1 };
|
pid_t m_pid { -1 };
|
||||||
pid_t m_tid { -1 };
|
pid_t m_tid { -1 };
|
|
@ -31,7 +31,7 @@
|
||||||
#include "ProcessFileDescriptorMapWidget.h"
|
#include "ProcessFileDescriptorMapWidget.h"
|
||||||
#include "ProcessMemoryMapWidget.h"
|
#include "ProcessMemoryMapWidget.h"
|
||||||
#include "ProcessModel.h"
|
#include "ProcessModel.h"
|
||||||
#include "ProcessStackWidget.h"
|
#include "ThreadStackWidget.h"
|
||||||
#include "ProcessUnveiledPathsWidget.h"
|
#include "ProcessUnveiledPathsWidget.h"
|
||||||
#include <LibCore/Timer.h>
|
#include <LibCore/Timer.h>
|
||||||
#include <LibGUI/AboutDialog.h>
|
#include <LibGUI/AboutDialog.h>
|
||||||
|
@ -316,7 +316,7 @@ int main(int argc, char** argv)
|
||||||
auto& memory_map_widget = process_tab_widget.add_tab<ProcessMemoryMapWidget>("Memory map");
|
auto& memory_map_widget = process_tab_widget.add_tab<ProcessMemoryMapWidget>("Memory map");
|
||||||
auto& open_files_widget = process_tab_widget.add_tab<ProcessFileDescriptorMapWidget>("Open files");
|
auto& open_files_widget = process_tab_widget.add_tab<ProcessFileDescriptorMapWidget>("Open files");
|
||||||
auto& unveiled_paths_widget = process_tab_widget.add_tab<ProcessUnveiledPathsWidget>("Unveiled paths");
|
auto& unveiled_paths_widget = process_tab_widget.add_tab<ProcessUnveiledPathsWidget>("Unveiled paths");
|
||||||
auto& stack_widget = process_tab_widget.add_tab<ProcessStackWidget>("Stack");
|
auto& stack_widget = process_tab_widget.add_tab<ThreadStackWidget>("Stack");
|
||||||
|
|
||||||
process_table_view.on_selection = [&](auto&) {
|
process_table_view.on_selection = [&](auto&) {
|
||||||
auto pid = selected_id(ProcessModel::Column::PID);
|
auto pid = selected_id(ProcessModel::Column::PID);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue