ProfileViewer: Show kernel frames with a red icon :^)

This commit is contained in:
Andreas Kling 2019-12-14 15:46:18 +01:00
parent f692577559
commit e4267020c4
Notes: sideshowbarker 2024-07-19 10:51:42 +09:00
3 changed files with 10 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

View File

@ -7,7 +7,8 @@
ProfileModel::ProfileModel(Profile& profile)
: m_profile(profile)
{
m_frame_icon.set_bitmap_for_size(16, GraphicsBitmap::load_from_file("/res/icons/16x16/inspector-object.png"));
m_user_frame_icon.set_bitmap_for_size(16, GraphicsBitmap::load_from_file("/res/icons/16x16/inspector-object.png"));
m_kernel_frame_icon.set_bitmap_for_size(16, GraphicsBitmap::load_from_file("/res/icons/16x16/inspector-object-red.png"));
}
ProfileModel::~ProfileModel()
@ -90,8 +91,11 @@ GVariant ProfileModel::data(const GModelIndex& index, Role role) const
{
auto* node = static_cast<ProfileNode*>(index.internal_data());
if (role == Role::Icon) {
if (index.column() == Column::StackFrame)
return m_frame_icon;
if (index.column() == Column::StackFrame) {
if (node->address() < (8 * MB))
return m_kernel_frame_icon;
return m_user_frame_icon;
}
return {};
}
if (role == Role::Display) {

View File

@ -33,5 +33,7 @@ private:
explicit ProfileModel(Profile&);
Profile& m_profile;
GIcon m_frame_icon;
GIcon m_user_frame_icon;
GIcon m_kernel_frame_icon;
};