diff options
author | Andreas Kling <kling@serenityos.org> | 2021-08-11 20:41:29 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-12 00:03:39 +0200 |
commit | 1e90a3a542cecf6510e2d615012f96e2fc10bd27 (patch) | |
tree | 6b9f4c82348e2fcf4b29ffc894e12a3f810b1cdb /Kernel/Syscalls | |
parent | 56e84a63cad9f4531ac110e6553f71ea4553d1b3 (diff) | |
download | serenity-1e90a3a542cecf6510e2d615012f96e2fc10bd27.zip |
Kernel: Make sys$perf_register_string() generate the string ID's
Making userspace provide a global string ID was silly, and made the API
extremely difficult to use correctly in a global profiling context.
Instead, simply make the kernel do the string ID allocation for us.
This also allows us to convert the string storage to a Vector in the
kernel (and an array in the JSON profile data.)
Diffstat (limited to 'Kernel/Syscalls')
-rw-r--r-- | Kernel/Syscalls/perf_event.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Syscalls/perf_event.cpp b/Kernel/Syscalls/perf_event.cpp index 99cffb27b1..09b9db6ee0 100644 --- a/Kernel/Syscalls/perf_event.cpp +++ b/Kernel/Syscalls/perf_event.cpp @@ -21,7 +21,7 @@ KResultOr<FlatPtr> Process::sys$perf_event(int type, FlatPtr arg1, FlatPtr arg2) return events_buffer->append(type, arg1, arg2, nullptr); } -KResultOr<FlatPtr> Process::sys$perf_register_string(FlatPtr string_id, Userspace<char const*> user_string, size_t user_string_length) +KResultOr<FlatPtr> Process::sys$perf_register_string(Userspace<char const*> user_string, size_t user_string_length) { VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this) auto* events_buffer = current_perf_events_buffer(); @@ -32,7 +32,7 @@ KResultOr<FlatPtr> Process::sys$perf_register_string(FlatPtr string_id, Userspac if (string_or_error.is_error()) return string_or_error.error(); - return events_buffer->register_string(string_id, string_or_error.release_value()); + return events_buffer->register_string(string_or_error.release_value()); } } |