1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* Copyright (c) 2026 Meta Platforms, Inc. and affiliates. */ 3 4 #ifndef __BPF_DIAGNOSTICS_H 5 #define __BPF_DIAGNOSTICS_H 6 7 #include <linux/compiler_attributes.h> 8 #include <linux/stdarg.h> 9 #include <linux/types.h> 10 11 struct bpf_verifier_env; 12 13 bool bpf_diag_enabled(const struct bpf_verifier_env *env); 14 int bpf_diag_init(struct bpf_verifier_env *env); 15 char *bpf_diag_fmt_buf(struct bpf_verifier_env *env, size_t size); 16 const char *bpf_diag_vfmt(struct bpf_verifier_env *env, const char *fmt, va_list args) 17 __printf(2, 0); 18 const char *bpf_diag_fmt(struct bpf_verifier_env *env, const char *fmt, ...) __printf(2, 3); 19 void bpf_diag_free(struct bpf_verifier_env *env); 20 21 #endif /* __BPF_DIAGNOSTICS_H */ 22