mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
26 lines
838 B
C
26 lines
838 B
C
![]() |
#ifndef __BPF_EXPERIMENTAL__
|
||
|
#define __BPF_EXPERIMENTAL__
|
||
|
|
||
|
#include <vmlinux.h>
|
||
|
#include <bpf/bpf_tracing.h>
|
||
|
#include <bpf/bpf_helpers.h>
|
||
|
#include <bpf/bpf_core_read.h>
|
||
|
|
||
|
/* Description
|
||
|
* Allocates an object of the type represented by 'local_type_id' in
|
||
|
* program BTF. User may use the bpf_core_type_id_local macro to pass the
|
||
|
* type ID of a struct in program BTF.
|
||
|
*
|
||
|
* The 'local_type_id' parameter must be a known constant.
|
||
|
* The 'meta' parameter is a hidden argument that is ignored.
|
||
|
* Returns
|
||
|
* A pointer to an object of the type corresponding to the passed in
|
||
|
* 'local_type_id', or NULL on failure.
|
||
|
*/
|
||
|
extern void *bpf_obj_new_impl(__u64 local_type_id, void *meta) __ksym;
|
||
|
|
||
|
/* Convenience macro to wrap over bpf_obj_new_impl */
|
||
|
#define bpf_obj_new(type) ((type *)bpf_obj_new_impl(bpf_core_type_id_local(type), NULL))
|
||
|
|
||
|
#endif
|