mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 12:49:08 +00:00
Kernel: Add PerformanceManager static class, move perf event APIs there
The current method of emitting performance events requires a bit of boiler plate at every invocation, as well as having to ignore the return code which isn't used outside of the perf event syscall. This change attempts to clean that up by exposing high level API's that can be used around the code base.
This commit is contained in:
committed by
Andreas Kling
parent
43b3fd748a
commit
ccdcb6a635
@@ -20,12 +20,11 @@ PerformanceEventBuffer::PerformanceEventBuffer(NonnullOwnPtr<KBuffer> buffer)
|
||||
{
|
||||
}
|
||||
|
||||
NEVER_INLINE KResult PerformanceEventBuffer::append(int type, FlatPtr arg1, FlatPtr arg2, const StringView& arg3)
|
||||
NEVER_INLINE KResult PerformanceEventBuffer::append(int type, FlatPtr arg1, FlatPtr arg2, const StringView& arg3, Thread* current_thread)
|
||||
{
|
||||
FlatPtr ebp;
|
||||
asm volatile("movl %%ebp, %%eax"
|
||||
: "=a"(ebp));
|
||||
auto current_thread = Thread::current();
|
||||
return append_with_eip_and_ebp(current_thread->pid(), current_thread->tid(), 0, ebp, type, arg1, arg2, arg3);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user