ladybird/Kernel/Profiling.h
Andreas Kling 0f393148da Kernel: Separate out the symbol offsets in profile output
Instead of saying "main +39" and "main +57" etc, we now have a separate
field in /proc/profile for the offset-into-the-symbol.
2019-12-12 21:59:47 +01:00

28 lines
482 B
C++

#pragma once
#include <AK/Function.h>
#include <AK/String.h>
#include <AK/Types.h>
class Process;
namespace Profiling {
constexpr size_t max_stack_frame_count = 30;
struct Sample {
i32 pid;
i32 tid;
u64 timestamp;
u32 frames[max_stack_frame_count];
u32 offsets[max_stack_frame_count];
String symbolicated_frames[max_stack_frame_count];
};
Sample& next_sample_slot();
void start(Process&);
void stop();
void for_each_sample(Function<void(Sample&)>);
}