File tree Expand file tree Collapse file tree 3 files changed +26
-20
lines changed Expand file tree Collapse file tree 3 files changed +26
-20
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 3
3
#include "vmlinux.h"
4
4
#include <bpf/bpf_helpers.h>
5
5
#include <bpf/bpf_tracing.h>
6
- #include "bperf.h"
7
6
#include "bperf_u.h"
8
7
9
- reading_map diff_readings SEC (".maps" );
10
- reading_map accum_readings SEC (".maps" );
8
+ struct {
9
+ __uint (type , BPF_MAP_TYPE_PERCPU_ARRAY );
10
+ __uint (key_size , sizeof (__u32 ));
11
+ __uint (value_size , sizeof (struct bpf_perf_event_value ));
12
+ __uint (max_entries , 1 );
13
+ } diff_readings SEC (".maps" );
14
+
15
+ struct {
16
+ __uint (type , BPF_MAP_TYPE_PERCPU_ARRAY );
17
+ __uint (key_size , sizeof (__u32 ));
18
+ __uint (value_size , sizeof (struct bpf_perf_event_value ));
19
+ __uint (max_entries , 1 );
20
+ } accum_readings SEC (".maps" );
11
21
12
22
struct {
13
23
__uint (type , BPF_MAP_TYPE_HASH );
Original file line number Diff line number Diff line change 3
3
#include "vmlinux.h"
4
4
#include <bpf/bpf_helpers.h>
5
5
#include <bpf/bpf_tracing.h>
6
- #include "bperf.h"
7
6
8
7
struct {
9
8
__uint (type , BPF_MAP_TYPE_PERF_EVENT_ARRAY );
@@ -12,8 +11,19 @@ struct {
12
11
__uint (map_flags , BPF_F_PRESERVE_ELEMS );
13
12
} events SEC (".maps" );
14
13
15
- reading_map prev_readings SEC (".maps" );
16
- reading_map diff_readings SEC (".maps" );
14
+ struct {
15
+ __uint (type , BPF_MAP_TYPE_PERCPU_ARRAY );
16
+ __uint (key_size , sizeof (__u32 ));
17
+ __uint (value_size , sizeof (struct bpf_perf_event_value ));
18
+ __uint (max_entries , 1 );
19
+ } prev_readings SEC (".maps" );
20
+
21
+ struct {
22
+ __uint (type , BPF_MAP_TYPE_PERCPU_ARRAY );
23
+ __uint (key_size , sizeof (__u32 ));
24
+ __uint (value_size , sizeof (struct bpf_perf_event_value ));
25
+ __uint (max_entries , 1 );
26
+ } diff_readings SEC (".maps" );
17
27
18
28
SEC ("raw_tp/sched_switch" )
19
29
int BPF_PROG (on_switch )
You can’t perform that action at this time.
0 commit comments