diff options
Diffstat (limited to 'Userland/DevTools')
-rw-r--r-- | Userland/DevTools/Profiler/Profile.cpp | 9 | ||||
-rw-r--r-- | Userland/DevTools/Profiler/Profile.h | 10 | ||||
-rw-r--r-- | Userland/DevTools/Profiler/SamplesModel.cpp | 9 | ||||
-rw-r--r-- | Userland/DevTools/Profiler/SamplesModel.h | 1 |
4 files changed, 28 insertions, 1 deletions
diff --git a/Userland/DevTools/Profiler/Profile.cpp b/Userland/DevTools/Profiler/Profile.cpp index b1bffb4529..1502e550fb 100644 --- a/Userland/DevTools/Profiler/Profile.cpp +++ b/Userland/DevTools/Profiler/Profile.cpp @@ -369,6 +369,15 @@ ErrorOr<NonnullOwnPtr<Profile>> Profile::load_from_perfcore_file(StringView path if (it != current_processes.end()) it->value->handle_thread_exit(event.tid, event.serial); continue; + } else if (type_string == "read"sv) { + const auto string_index = perf_event.get("filename_index"sv).to_number<FlatPtr>(); + event.data = Event::ReadData { + .fd = perf_event.get("fd"sv).to_number<int>(), + .size = perf_event.get("size"sv).to_number<size_t>(), + .path = profile_strings.get(string_index).value(), + .start_timestamp = perf_event.get("start_timestamp"sv).to_number<size_t>(), + .success = perf_event.get("success"sv).to_bool() + }; } else { dbgln("Unknown event type '{}'", type_string); VERIFY_NOT_REACHED(); diff --git a/Userland/DevTools/Profiler/Profile.h b/Userland/DevTools/Profiler/Profile.h index 15fff19f59..2881b8201f 100644 --- a/Userland/DevTools/Profiler/Profile.h +++ b/Userland/DevTools/Profiler/Profile.h @@ -221,7 +221,15 @@ public: pid_t parent_tid {}; }; - Variant<std::nullptr_t, SampleData, MallocData, FreeData, SignpostData, MmapData, MunmapData, ProcessCreateData, ProcessExecData, ThreadCreateData> data { nullptr }; + struct ReadData { + int fd; + size_t size; + String path; + size_t start_timestamp; + bool success; + }; + + Variant<std::nullptr_t, SampleData, MallocData, FreeData, SignpostData, MmapData, MunmapData, ProcessCreateData, ProcessExecData, ThreadCreateData, ReadData> data { nullptr }; }; Vector<Event> const& events() const { return m_events; } 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 {}; diff --git a/Userland/DevTools/Profiler/SamplesModel.h b/Userland/DevTools/Profiler/SamplesModel.h index f40702cb31..06079a9088 100644 --- a/Userland/DevTools/Profiler/SamplesModel.h +++ b/Userland/DevTools/Profiler/SamplesModel.h @@ -27,6 +27,7 @@ public: ExecutableName, LostSamples, InnermostStackFrame, + Path, __Count }; |