Skip to content

Commit

Permalink
Allowlist some types related to perf event buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
alexforster committed Apr 19, 2022
1 parent f055b6f commit 11f9379
Show file tree
Hide file tree
Showing 3 changed files with 1,063 additions and 51 deletions.
2 changes: 2 additions & 0 deletions bindings.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#ifdef __LIBBPF_SYS_NOVENDOR
#include <linux/if_link.h>
#include <linux/perf_event.h>
#include <bpf/bpf.h>
#include <bpf/btf.h>
#include <bpf/libbpf.h>
#include <bpf/xsk.h>
#else
#include "libbpf/include/uapi/linux/if_link.h"
#include "libbpf/include/uapi/linux/perf_event.h"
#include "libbpf/src/bpf.h"
#include "libbpf/src/btf.h"
#include "libbpf/src/libbpf.h"
Expand Down
12 changes: 8 additions & 4 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,20 @@ fn generate_bindings(src_dir: path::PathBuf) {
.allowlist_function("xsk_.+")
.allowlist_function("_xsk_.+")
.allowlist_function("perf_buffer_.+")
.allowlist_function("perf_event_.+")
.allowlist_function("ring_buffer_.+")
.allowlist_function("vdprintf")
.allowlist_type("bpf_.*")
.allowlist_type("btf_.*")
.allowlist_type("xdp_.*")
.allowlist_type("xsk_.*")
.allowlist_type("bpf_.+")
.allowlist_type("btf_.+")
.allowlist_type("xdp_.+")
.allowlist_type("xsk_.+")
.allowlist_type("perf_event_.+")
.allowlist_type("perf_sample_.+")
.allowlist_var("BPF_.+")
.allowlist_var("BTF_.+")
.allowlist_var("XSK_.+")
.allowlist_var("XDP_.+")
.allowlist_var("PERF_RECORD_.+")
.parse_callbacks(Box::new(ignored_macros))
.header("bindings.h")
.clang_arg(format!("-I{}", src_dir.join("libbpf/include").display()))
Expand Down
Loading

0 comments on commit 11f9379

Please sign in to comment.