mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
bpf tools: Add new API bpf_object__get_kversion()
bpf_object__get_kversion() can be used to fetch value of object's 'version' section. Following patch will use it for error reporting. Signed-off-by: Wang Nan <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Zefan Li <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
parent
6371ca3b54
commit
45825d8ab8
2 changed files with 9 additions and 0 deletions
|
|
@ -1055,6 +1055,14 @@ bpf_object__get_name(struct bpf_object *obj)
|
|||
return obj->path;
|
||||
}
|
||||
|
||||
unsigned int
|
||||
bpf_object__get_kversion(struct bpf_object *obj)
|
||||
{
|
||||
if (!obj)
|
||||
return 0;
|
||||
return obj->kern_version;
|
||||
}
|
||||
|
||||
struct bpf_program *
|
||||
bpf_program__next(struct bpf_program *prev, struct bpf_object *obj)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ void bpf_object__close(struct bpf_object *object);
|
|||
int bpf_object__load(struct bpf_object *obj);
|
||||
int bpf_object__unload(struct bpf_object *obj);
|
||||
const char *bpf_object__get_name(struct bpf_object *obj);
|
||||
unsigned int bpf_object__get_kversion(struct bpf_object *obj);
|
||||
|
||||
struct bpf_object *bpf_object__next(struct bpf_object *prev);
|
||||
#define bpf_object__for_each_safe(pos, tmp) \
|
||||
|
|
|
|||
Loading…
Reference in a new issue