summaryrefslogtreecommitdiff
path: root/Kernel/Profiling.h
blob: ba0b6847621285b2161190a7bc4057bb0bddcc9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#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&)>);

}