mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:27:45 +00:00
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
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());
|
SpinlockLocker locker(process.address_space().get_lock());
|
||||||
|
|
||||||
String executable;
|
OwnPtr<KString> executable;
|
||||||
if (process.executable())
|
if (process.executable())
|
||||||
executable = process.executable()->absolute_path();
|
executable = MUST(process.executable()->try_serialize_absolute_path());
|
||||||
else
|
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,
|
[[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,
|
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) {
|
process.for_each_thread([&](auto& thread) {
|
||||||
[[maybe_unused]] auto rc = append_with_ip_and_bp(process.pid(), thread.tid().value(),
|
[[maybe_unused]] auto rc = append_with_ip_and_bp(process.pid(), thread.tid().value(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue