mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:38:10 +00:00
ProfileViewer: Begin work on a visualization tool for profiles :^)
We begin with a simple treeview that shows a recorded profile. To record and view a profile of a process with <PID>, simply do this: $ profile <PID> on ... wait while PID does something interesting ... $ profile <PID> off $ cat /proc/profile > my-profile.prof $ ProfileViewer my-profile.prof
This commit is contained in:
parent
0f393148da
commit
19d8c675f1
8 changed files with 350 additions and 0 deletions
28
DevTools/ProfileViewer/ProfileModel.h
Normal file
28
DevTools/ProfileViewer/ProfileModel.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibGUI/GModel.h>
|
||||
|
||||
class Profile;
|
||||
|
||||
class ProfileModel final : public GModel {
|
||||
public:
|
||||
static NonnullRefPtr<ProfileModel> create(Profile& profile)
|
||||
{
|
||||
return adopt(*new ProfileModel(profile));
|
||||
}
|
||||
|
||||
virtual ~ProfileModel() override;
|
||||
|
||||
virtual int row_count(const GModelIndex& = GModelIndex()) const override;
|
||||
virtual int column_count(const GModelIndex& = GModelIndex()) const override;
|
||||
virtual GVariant data(const GModelIndex&, Role = Role::Display) const override;
|
||||
virtual GModelIndex index(int row, int column, const GModelIndex& parent = GModelIndex()) const override;
|
||||
virtual GModelIndex parent_index(const GModelIndex&) const override;
|
||||
virtual void update() override;
|
||||
|
||||
private:
|
||||
explicit ProfileModel(Profile&);
|
||||
|
||||
Profile& m_profile;
|
||||
GIcon m_frame_icon;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue