| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* Copyright (c) 2017 Facebook |
|---|
| 2 | | - * |
|---|
| 3 | | - * This program is free software; you can redistribute it and/or |
|---|
| 4 | | - * modify it under the terms of version 2 of the GNU General Public |
|---|
| 5 | | - * License as published by the Free Software Foundation. |
|---|
| 6 | 3 | */ |
|---|
| 7 | 4 | #include <uapi/linux/bpf.h> |
|---|
| 8 | | -#include "bpf_helpers.h" |
|---|
| 5 | +#include <bpf/bpf_helpers.h> |
|---|
| 9 | 6 | |
|---|
| 10 | 7 | struct syscalls_enter_open_args { |
|---|
| 11 | 8 | unsigned long long unused; |
|---|
| .. | .. |
|---|
| 21 | 18 | long ret; |
|---|
| 22 | 19 | }; |
|---|
| 23 | 20 | |
|---|
| 24 | | -struct bpf_map_def SEC("maps") enter_open_map = { |
|---|
| 25 | | - .type = BPF_MAP_TYPE_ARRAY, |
|---|
| 26 | | - .key_size = sizeof(u32), |
|---|
| 27 | | - .value_size = sizeof(u32), |
|---|
| 28 | | - .max_entries = 1, |
|---|
| 29 | | -}; |
|---|
| 21 | +struct { |
|---|
| 22 | + __uint(type, BPF_MAP_TYPE_ARRAY); |
|---|
| 23 | + __type(key, u32); |
|---|
| 24 | + __type(value, u32); |
|---|
| 25 | + __uint(max_entries, 1); |
|---|
| 26 | +} enter_open_map SEC(".maps"); |
|---|
| 30 | 27 | |
|---|
| 31 | | -struct bpf_map_def SEC("maps") exit_open_map = { |
|---|
| 32 | | - .type = BPF_MAP_TYPE_ARRAY, |
|---|
| 33 | | - .key_size = sizeof(u32), |
|---|
| 34 | | - .value_size = sizeof(u32), |
|---|
| 35 | | - .max_entries = 1, |
|---|
| 36 | | -}; |
|---|
| 28 | +struct { |
|---|
| 29 | + __uint(type, BPF_MAP_TYPE_ARRAY); |
|---|
| 30 | + __type(key, u32); |
|---|
| 31 | + __type(value, u32); |
|---|
| 32 | + __uint(max_entries, 1); |
|---|
| 33 | +} exit_open_map SEC(".maps"); |
|---|
| 37 | 34 | |
|---|
| 38 | 35 | static __always_inline void count(void *map) |
|---|
| 39 | 36 | { |
|---|