mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 18:57:34 +00:00
Kernel: Start perf event stack capture at RBP, not EBP on x86_64
This commit is contained in:
parent
3214e35535
commit
5c344f4aee
1 changed files with 8 additions and 3 deletions
|
@ -23,10 +23,15 @@ PerformanceEventBuffer::PerformanceEventBuffer(NonnullOwnPtr<KBuffer> buffer)
|
||||||
|
|
||||||
NEVER_INLINE ErrorOr<void> PerformanceEventBuffer::append(int type, FlatPtr arg1, FlatPtr arg2, StringView arg3, Thread* current_thread)
|
NEVER_INLINE ErrorOr<void> PerformanceEventBuffer::append(int type, FlatPtr arg1, FlatPtr arg2, StringView arg3, Thread* current_thread)
|
||||||
{
|
{
|
||||||
FlatPtr ebp;
|
FlatPtr base_pointer;
|
||||||
|
#if ARCH(I386)
|
||||||
asm volatile("movl %%ebp, %%eax"
|
asm volatile("movl %%ebp, %%eax"
|
||||||
: "=a"(ebp));
|
: "=a"(base_pointer));
|
||||||
return append_with_ip_and_bp(current_thread->pid(), current_thread->tid(), 0, ebp, type, 0, arg1, arg2, arg3);
|
#else
|
||||||
|
asm volatile("movq %%rbp, %%rax"
|
||||||
|
: "=a"(base_pointer));
|
||||||
|
#endif
|
||||||
|
return append_with_ip_and_bp(current_thread->pid(), current_thread->tid(), 0, base_pointer, type, 0, arg1, arg2, arg3);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Vector<FlatPtr, PerformanceEvent::max_stack_frame_count> raw_backtrace(FlatPtr bp, FlatPtr ip)
|
static Vector<FlatPtr, PerformanceEvent::max_stack_frame_count> raw_backtrace(FlatPtr bp, FlatPtr ip)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue