summaryrefslogtreecommitdiff
path: root/Userland/DevTools/Profiler/SamplesModel.cpp
diff options
context:
space:
mode:
authorJakub Berkop <jakub.berkop@gmail.com>2022-02-12 16:58:01 +0100
committerAndreas Kling <kling@serenityos.org>2022-02-14 11:38:13 +0100
commitcdfb388154a757f0658545cc2f66055aa2773f9e (patch)
tree2c68676ea171b843bd3d7ef87472d4f0cc6bc10f /Userland/DevTools/Profiler/SamplesModel.cpp
parentfae991f59931a6a28b01921a4331e405b32848aa (diff)
downloadserenity-cdfb388154a757f0658545cc2f66055aa2773f9e.zip
Profiler: Add ability to process read syscalls
Profiler can now process and display read events.
Diffstat (limited to 'Userland/DevTools/Profiler/SamplesModel.cpp')
-rw-r--r--Userland/DevTools/Profiler/SamplesModel.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Userland/DevTools/Profiler/SamplesModel.cpp b/Userland/DevTools/Profiler/SamplesModel.cpp
index 7f0890e087..e9123af0a6 100644
--- a/Userland/DevTools/Profiler/SamplesModel.cpp
+++ b/Userland/DevTools/Profiler/SamplesModel.cpp
@@ -48,6 +48,8 @@ String SamplesModel::column_name(int column) const
return "Lost Samples";
case Column::InnermostStackFrame:
return "Innermost Frame";
+ case Column::Path:
+ return "Path";
default:
VERIFY_NOT_REACHED();
}
@@ -89,6 +91,13 @@ GUI::Variant SamplesModel::data(GUI::ModelIndex const& index, GUI::ModelRole rol
if (index.column() == Column::InnermostStackFrame) {
return event.frames.last().symbol;
}
+
+ if (index.column() == Column::Path) {
+ if (!event.data.has<Profile::Event::ReadData>())
+ return "";
+ return event.data.get<Profile::Event::ReadData>().path;
+ }
+
return {};
}
return {};