diff --git a/Userland/DevTools/Profiler/Profile.cpp b/Userland/DevTools/Profiler/Profile.cpp index 74d3ad7afa4456..0d86ef028290c3 100644 --- a/Userland/DevTools/Profiler/Profile.cpp +++ b/Userland/DevTools/Profiler/Profile.cpp @@ -481,7 +481,7 @@ ErrorOr> Profile::load_from_perfcore_file(StringView path auto const& frame = stack_array.at(i); auto ptr = frame.as_integer(); u32 offset = 0; - DeprecatedFlyString object_name; + FlyString object_name; ByteString symbol; if (maybe_kernel_base.has_value() && ptr >= maybe_kernel_base.value()) { @@ -497,7 +497,7 @@ ErrorOr> Profile::load_from_perfcore_file(StringView path if (it != current_processes.end()) library_metadata = &it->value->library_metadata; if (auto const* library = library_metadata ? library_metadata->library_containing(ptr) : nullptr) { - object_name = library->name; + object_name = TRY(FlyString::from_utf8(library->name.view())); symbol = library->symbolicate(ptr, &offset); } else { symbol = ByteString::formatted("?? <{:p}>", ptr); @@ -681,7 +681,7 @@ ProfileNode::ProfileNode(Process const& process) { } -ProfileNode::ProfileNode(Process const& process, DeprecatedFlyString const& object_name, ByteString symbol, FlatPtr address, u32 offset, u64 timestamp, pid_t pid) +ProfileNode::ProfileNode(Process const& process, FlyString const& object_name, ByteString symbol, FlatPtr address, u32 offset, u64 timestamp, pid_t pid) : m_process(process) , m_symbol(move(symbol)) , m_pid(pid) @@ -690,12 +690,12 @@ ProfileNode::ProfileNode(Process const& process, DeprecatedFlyString const& obje , m_timestamp(timestamp) { ByteString object; - if (object_name.ends_with(": .text"sv)) { - object = object_name.view().substring_view(0, object_name.length() - 7); + if (object_name.ends_with_bytes(": .text"sv)) { + object = object_name.bytes_as_string_view().substring_view(0, object_name.bytes().size() - 7); } else { - object = object_name; + object = ByteString::from_utf8(object_name.bytes()).release_value_but_fixme_should_propagate_errors(); } - m_object_name = LexicalPath::basename(object); + m_object_name = FlyString::from_utf8(object.view()).release_value_but_fixme_should_propagate_errors(); } } diff --git a/Userland/DevTools/Profiler/Profile.h b/Userland/DevTools/Profiler/Profile.h index 00d7c431440742..c1aa9d26697859 100644 --- a/Userland/DevTools/Profiler/Profile.h +++ b/Userland/DevTools/Profiler/Profile.h @@ -16,7 +16,7 @@ #include "SignpostsModel.h" #include "SourceModel.h" #include -#include +#include #include #include #include @@ -35,7 +35,7 @@ extern OwnPtr g_kernel_debug_info; class ProfileNode : public RefCounted { public: - static NonnullRefPtr create(Process const& process, DeprecatedFlyString const& object_name, ByteString symbol, FlatPtr address, u32 offset, u64 timestamp, pid_t pid) + static NonnullRefPtr create(Process const& process, FlyString const& object_name, ByteString symbol, FlatPtr address, u32 offset, u64 timestamp, pid_t pid) { return adopt_ref(*new ProfileNode(process, object_name, move(symbol), address, offset, timestamp, pid)); } @@ -54,7 +54,7 @@ class ProfileNode : public RefCounted { bool has_seen_event(size_t event_index) const { return m_seen_events.get(event_index); } void did_see_event(size_t event_index) { m_seen_events.set(event_index, true); } - DeprecatedFlyString const& object_name() const { return m_object_name; } + FlyString const& object_name() const { return m_object_name; } ByteString const& symbol() const { return m_symbol; } FlatPtr address() const { return m_address; } u32 offset() const { return m_offset; } @@ -75,7 +75,7 @@ class ProfileNode : public RefCounted { m_children.append(child); } - ProfileNode& find_or_create_child(DeprecatedFlyString const& object_name, ByteString symbol, FlatPtr address, u32 offset, u64 timestamp, pid_t pid) + ProfileNode& find_or_create_child(FlyString const& object_name, ByteString symbol, FlatPtr address, u32 offset, u64 timestamp, pid_t pid) { for (size_t i = 0; i < m_children.size(); ++i) { auto& child = m_children[i]; @@ -113,12 +113,12 @@ class ProfileNode : public RefCounted { private: explicit ProfileNode(Process const&); - explicit ProfileNode(Process const&, DeprecatedFlyString const& object_name, ByteString symbol, FlatPtr address, u32 offset, u64 timestamp, pid_t); + explicit ProfileNode(Process const&, FlyString const& object_name, ByteString symbol, FlatPtr address, u32 offset, u64 timestamp, pid_t); bool m_root { false }; Process const& m_process; ProfileNode* m_parent { nullptr }; - DeprecatedFlyString m_object_name; + FlyString m_object_name; ByteString m_symbol; pid_t m_pid { 0 }; FlatPtr m_address { 0 }; @@ -167,7 +167,7 @@ class Profile { Vector> const& roots() const { return m_roots; } struct Frame { - DeprecatedFlyString object_name; + FlyString object_name; ByteString symbol; FlatPtr address { 0 }; u32 offset { 0 };