diff options
author | Andreas Kling <kling@serenityos.org> | 2020-10-10 23:46:40 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-10-10 23:47:53 +0200 |
commit | ac8fe3d0625ffc95f9b042e990b122ccf5abe2d3 (patch) | |
tree | 006f37916dca1b1208dcb6864e3a25e51aa0ac54 | |
parent | 31791945abc170bbfbc17b6c39a5b9f125c89281 (diff) | |
download | serenity-ac8fe3d0625ffc95f9b042e990b122ccf5abe2d3.zip |
Kernel: Remove FIXME about unsurfaced error and log something
If something goes wrong when trying to write out a perfcore file during
process finalization, there's nowhere to report an error to, other than
the debug log. So write it to the debug log.
-rw-r--r-- | Kernel/Process.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index e427316652..96393d0fb0 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -597,9 +597,11 @@ void Process::finalize() if (!description_or_error.is_error()) { auto& description = description_or_error.value(); auto json = m_perf_event_buffer->to_json(m_pid, m_executable ? m_executable->absolute_path() : ""); - // FIXME: Should this error path be surfaced somehow? auto json_buffer = UserOrKernelBuffer::for_kernel_buffer(json.data()); - (void)description->write(json_buffer, json.size()); + auto result = description->write(json_buffer, json.size()); + if (result.is_error()) { + dbgln("Error while writing perfcore file: {}", result.error().error()); + } } } |