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:
parent
572bbf28cc
commit
277f333b2b
Notes:
sideshowbarker
2024-07-18 17:45:39 +09:00
Author: https://github.com/gunnarbeutner
Commit: 277f333b2b
Pull-request: https://github.com/SerenityOS/serenity/pull/7246
Reviewed-by: https://github.com/tomuta
10 changed files with 84 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue