summaryrefslogtreecommitdiff
path: root/Userland/DevTools/Profiler/Profile.h
diff options
context:
space:
mode:
authorStephan Unverwerth <s.unverwerth@serenityos.org>2021-12-27 01:25:58 +0100
committerAndreas Kling <kling@serenityos.org>2021-12-28 23:17:24 +0100
commitcf8427b7b46798f7e26929bb05dc5ffa33c359a5 (patch)
tree1281982d6f6857bc3e7a3713ce5060a17cc4b294 /Userland/DevTools/Profiler/Profile.h
parente6df1c998804cca1848c634411b42d277d9ff265 (diff)
downloadserenity-cf8427b7b46798f7e26929bb05dc5ffa33c359a5.zip
Profiler: Add source code view
This adds a new view mode to profiler which displays source lines and samples that occured at those lines. This view can be opened via the menu or by pressing CTRL-S. It does this by mapping file names from DWARF to "/usr/src/serenity/..." i.e. source code should be copied to /usr/src/serenity/Userland and /usr/src/serenity/Kernel to be visible in this mode. Currently *all* files contributing to the selected function are loaded completely which could be a lot of data when dealing with lots of inlined code.
Diffstat (limited to 'Userland/DevTools/Profiler/Profile.h')
-rw-r--r--Userland/DevTools/Profiler/Profile.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Userland/DevTools/Profiler/Profile.h b/Userland/DevTools/Profiler/Profile.h
index e153a9bc70..78ff901eab 100644
--- a/Userland/DevTools/Profiler/Profile.h
+++ b/Userland/DevTools/Profiler/Profile.h
@@ -12,6 +12,7 @@
#include "ProfileModel.h"
#include "SamplesModel.h"
#include "SignpostsModel.h"
+#include "SourceModel.h"
#include <AK/Bitmap.h>
#include <AK/FlyString.h>
#include <AK/JsonArray.h>
@@ -147,6 +148,7 @@ public:
GUI::Model& samples_model();
GUI::Model& signposts_model();
GUI::Model* disassembly_model();
+ GUI::Model* source_model();
const Process* find_process(pid_t pid, EventSerialNumber serial) const
{
@@ -157,6 +159,7 @@ public:
}
void set_disassembly_index(const GUI::ModelIndex&);
+ void set_source_index(const GUI::ModelIndex&);
const Vector<NonnullRefPtr<ProfileNode>>& roots() const { return m_roots; }
@@ -281,8 +284,10 @@ private:
RefPtr<SamplesModel> m_samples_model;
RefPtr<SignpostsModel> m_signposts_model;
RefPtr<DisassemblyModel> m_disassembly_model;
+ RefPtr<SourceModel> m_source_model;
GUI::ModelIndex m_disassembly_index;
+ GUI::ModelIndex m_source_index;
Vector<NonnullRefPtr<ProfileNode>> m_roots;
Vector<size_t> m_filtered_event_indices;