Commit a135d895 authored by yonghong-song's avatar yonghong-song Committed by GitHub

Merge pull request #1363 from navytux/y/probe-read-const

bpf_probe_read*: src argument should be const void *.
parents fca66074 2dc7daad
......@@ -235,7 +235,7 @@ Examples in situ:
### 1. bpf_probe_read()
Syntax: ```int bpf_probe_read(void *dst, int size, void *src)```
Syntax: ```int bpf_probe_read(void *dst, int size, const void *src)```
Return: 0 on success
......@@ -247,7 +247,7 @@ Examples in situ:
### 2. bpf_probe_read_str()
Syntax: ```int bpf_probe_read_str(void *dst, int size, void *src)```
Syntax: ```int bpf_probe_read_str(void *dst, int size, const void *src)```
Return:
- \> 0 length of the string including the trailing NUL on success
......
......@@ -244,7 +244,7 @@ union bpf_attr {
* int bpf_map_delete_elem(&map, &key)
* Return: 0 on success or negative error
*
* int bpf_probe_read(void *dst, int size, void *src)
* int bpf_probe_read(void *dst, int size, const void *src)
* Return: 0 on success or negative error
*
* u64 bpf_ktime_get_ns(void)
......
......@@ -245,7 +245,7 @@ union bpf_attr {
* int bpf_map_delete_elem(&map, &key)
* Return: 0 on success or negative error
*
* int bpf_probe_read(void *dst, int size, void *src)
* int bpf_probe_read(void *dst, int size, const void *src)
* Return: 0 on success or negative error
*
* u64 bpf_ktime_get_ns(void)
......
......@@ -200,7 +200,7 @@ static int (*bpf_map_update_elem)(void *map, void *key, void *value, u64 flags)
(void *) BPF_FUNC_map_update_elem;
static int (*bpf_map_delete_elem)(void *map, void *key) =
(void *) BPF_FUNC_map_delete_elem;
static int (*bpf_probe_read)(void *dst, u64 size, void *unsafe_ptr) =
static int (*bpf_probe_read)(void *dst, u64 size, const void *unsafe_ptr) =
(void *) BPF_FUNC_probe_read;
static u64 (*bpf_ktime_get_ns)(void) =
(void *) BPF_FUNC_ktime_get_ns;
......@@ -208,7 +208,7 @@ static u32 (*bpf_get_prandom_u32)(void) =
(void *) BPF_FUNC_get_prandom_u32;
static int (*bpf_trace_printk_)(const char *fmt, u64 fmt_size, ...) =
(void *) BPF_FUNC_trace_printk;
static int (*bpf_probe_read_str)(void *dst, u64 size, void *unsafe_ptr) =
static int (*bpf_probe_read_str)(void *dst, u64 size, const void *unsafe_ptr) =
(void *) BPF_FUNC_probe_read_str;
int bpf_trace_printk(const char *fmt, ...) asm("llvm.bpf.extra");
static inline __attribute__((always_inline))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment