diff options
author | He Kuang <hekuang@huawei.com> | 2015-11-24 13:36:08 +0000 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-11-26 17:21:24 -0300 |
commit | 43798bf37215fe242e592fd4605d804e2da0781b (patch) | |
tree | 78938a19ac78dbc74c9d507ea3044b29ecb79e1c /tools/lib/bpf/bpf.h | |
parent | dcdd184b60c3943fb678dcbaf899a26f845901ad (diff) | |
download | linux-43798bf37215fe242e592fd4605d804e2da0781b.tar.gz linux-43798bf37215fe242e592fd4605d804e2da0781b.tar.bz2 linux-43798bf37215fe242e592fd4605d804e2da0781b.zip |
bpf tools: Add helper function for updating bpf maps elements
Add bpf_map_update_elem() helper function which calls the sys_bpf
syscall to update elements in bpf maps. Upcoming patches will use it to
adjust data in map through the perf command line.
Signed-off-by: He Kuang <hekuang@huawei.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1448372181-151723-4-git-send-email-wangnan0@huawei.com
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib/bpf/bpf.h')
-rw-r--r-- | tools/lib/bpf/bpf.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/lib/bpf/bpf.h b/tools/lib/bpf/bpf.h index 854b7361b784..a76465541292 100644 --- a/tools/lib/bpf/bpf.h +++ b/tools/lib/bpf/bpf.h @@ -20,4 +20,6 @@ int bpf_load_program(enum bpf_prog_type type, struct bpf_insn *insns, u32 kern_version, char *log_buf, size_t log_buf_sz); +int bpf_map_update_elem(int fd, void *key, void *value, + u64 flags); #endif |