Kernel: Use try_serialize_absolute_path in PerformanceEventBuffer
This only moves the issue, as PerformanceEventBuffer::add_process can't fail yet, but this will allow us to remove the non-failable Custody::absolute_path API.
This commit is contained in:
parent
a482f7718d
commit
174056a479
Notes:
sideshowbarker
2024-07-17 21:03:45 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/174056a479f Pull-request: https://github.com/SerenityOS/serenity/pull/11817 Reviewed-by: https://github.com/bgianfo ✅
1 changed files with 4 additions and 4 deletions
|
@ -317,15 +317,15 @@ void PerformanceEventBuffer::add_process(const Process& process, ProcessEventTyp
|
|||
{
|
||||
SpinlockLocker locker(process.address_space().get_lock());
|
||||
|
||||
String executable;
|
||||
OwnPtr<KString> executable;
|
||||
if (process.executable())
|
||||
executable = process.executable()->absolute_path();
|
||||
executable = MUST(process.executable()->try_serialize_absolute_path());
|
||||
else
|
||||
executable = String::formatted("<{}>", process.name());
|
||||
executable = MUST(KString::formatted("<{}>", process.name()));
|
||||
|
||||
[[maybe_unused]] auto rc = append_with_ip_and_bp(process.pid(), 0, 0, 0,
|
||||
event_type == ProcessEventType::Create ? PERF_EVENT_PROCESS_CREATE : PERF_EVENT_PROCESS_EXEC,
|
||||
0, process.pid().value(), 0, executable);
|
||||
0, process.pid().value(), 0, executable->view());
|
||||
|
||||
process.for_each_thread([&](auto& thread) {
|
||||
[[maybe_unused]] auto rc = append_with_ip_and_bp(process.pid(), thread.tid().value(),
|
||||
|
|
Loading…
Add table
Reference in a new issue