mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
Kernel: Don't record sys$perf_event() if profiling is not enabled
If you want to record perf events, just enable profiling. This allows us to add random perf events to programs without littering the file system with perfcore files.
This commit is contained in:
parent
0c39f8128d
commit
a29788e58a
Notes:
sideshowbarker
2024-07-18 07:06:08 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/a29788e58a1
1 changed files with 3 additions and 6 deletions
|
@ -12,12 +12,9 @@ namespace Kernel {
|
|||
KResultOr<FlatPtr> Process::sys$perf_event(int type, FlatPtr arg1, FlatPtr arg2)
|
||||
{
|
||||
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
|
||||
auto events_buffer = current_perf_events_buffer();
|
||||
if (!events_buffer) {
|
||||
if (!create_perf_events_buffer_if_needed())
|
||||
return ENOMEM;
|
||||
events_buffer = perf_events();
|
||||
}
|
||||
auto* events_buffer = current_perf_events_buffer();
|
||||
if (!events_buffer)
|
||||
return KSuccess;
|
||||
return events_buffer->append(type, arg1, arg2, nullptr);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue