mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 17:52:26 -05:00
Kernel: Make perf_event() work for global profiles
Previously calls to perf_event() would end up in a process-specific perfcore file even though global profiling was enabled. This changes the behavior for perf_event() so that these events are stored into the global profile instead.
This commit is contained in:
parent
704bfe54b6
commit
4ab9d8736b
Notes:
sideshowbarker
2024-07-18 18:06:27 +09:00
Author: https://github.com/gunnarbeutner Commit: https://github.com/SerenityOS/serenity/commit/4ab9d8736b9 Pull-request: https://github.com/SerenityOS/serenity/pull/7139
1 changed files with 7 additions and 3 deletions
|
@ -11,9 +11,13 @@ namespace Kernel {
|
|||
|
||||
KResultOr<int> Process::sys$perf_event(int type, FlatPtr arg1, FlatPtr arg2)
|
||||
{
|
||||
if (!create_perf_events_buffer_if_needed())
|
||||
return ENOMEM;
|
||||
return perf_events()->append(type, arg1, arg2, nullptr);
|
||||
auto events_buffer = current_perf_events_buffer();
|
||||
if (!events_buffer) {
|
||||
if (!create_perf_events_buffer_if_needed())
|
||||
return ENOMEM;
|
||||
events_buffer = perf_events();
|
||||
}
|
||||
return events_buffer->append(type, arg1, arg2, nullptr);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue