From a8e5130183fb622854a87bd9cb0f741860d25b98 Mon Sep 17 00:00:00 2001 From: James Mintram Date: Mon, 11 Oct 2021 23:52:44 +0100 Subject: [PATCH] Kernel: Pass RegisterState by ref to event buffer --- Kernel/PerformanceEventBuffer.cpp | 2 +- Kernel/PerformanceManager.h | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Kernel/PerformanceEventBuffer.cpp b/Kernel/PerformanceEventBuffer.cpp index ee62c2de62c..89c6fd34b7d 100644 --- a/Kernel/PerformanceEventBuffer.cpp +++ b/Kernel/PerformanceEventBuffer.cpp @@ -7,8 +7,8 @@ #include #include #include -#include #include +#include #include #include #include diff --git a/Kernel/PerformanceManager.h b/Kernel/PerformanceManager.h index 0e00753694a..9c6745756b9 100644 --- a/Kernel/PerformanceManager.h +++ b/Kernel/PerformanceManager.h @@ -62,8 +62,7 @@ public: return; if (auto* event_buffer = current_thread.process().current_perf_events_buffer()) { [[maybe_unused]] auto rc = event_buffer->append_with_ip_and_bp( - current_thread.pid(), current_thread.tid(), - regs.ip(), regs.bp(), PERF_EVENT_SAMPLE, lost_time, 0, 0, nullptr); + current_thread.pid(), current_thread.tid(), regs, PERF_EVENT_SAMPLE, lost_time, 0, 0, nullptr); } } @@ -114,8 +113,7 @@ public: return; if (auto* event_buffer = thread.process().current_perf_events_buffer()) { [[maybe_unused]] auto rc = event_buffer->append_with_ip_and_bp( - thread.pid(), thread.tid(), - regs.ip(), regs.bp(), PERF_EVENT_PAGE_FAULT, 0, 0, 0, nullptr); + thread.pid(), thread.tid(), regs, PERF_EVENT_PAGE_FAULT, 0, 0, 0, nullptr); } } @@ -125,8 +123,7 @@ public: return; if (auto* event_buffer = thread.process().current_perf_events_buffer()) { [[maybe_unused]] auto rc = event_buffer->append_with_ip_and_bp( - thread.pid(), thread.tid(), - regs.ip(), regs.bp(), PERF_EVENT_SYSCALL, 0, 0, 0, nullptr); + thread.pid(), thread.tid(), regs, PERF_EVENT_SYSCALL, 0, 0, 0, nullptr); } }