1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 02:13:56 +09:00

Kernel: Add support for profiling kmalloc()/kfree()

This commit is contained in:
Gunnar Beutner 2021-05-13 13:09:00 +02:00 committed by Andreas Kling
parent 572bbf28cc
commit 277f333b2b
Notes: sideshowbarker 2024-07-18 17:45:39 +09:00
10 changed files with 84 additions and 2 deletions

View file

@ -92,6 +92,20 @@ public:
}
}
inline static void add_kmalloc_perf_event(Process& current_process, size_t size, FlatPtr ptr)
{
if (auto* event_buffer = current_process.current_perf_events_buffer()) {
[[maybe_unused]] auto res = event_buffer->append(PERF_EVENT_KMALLOC, size, ptr, nullptr);
}
}
inline static void add_kfree_perf_event(Process& current_process, size_t size, FlatPtr ptr)
{
if (auto* event_buffer = current_process.current_perf_events_buffer()) {
[[maybe_unused]] auto res = event_buffer->append(PERF_EVENT_KFREE, size, ptr, nullptr);
}
}
inline static void timer_tick(RegisterState const& regs)
{
static Time last_wakeup;