the perf
event on current cpu or all the perf events stored in the maps by
checking the third parameter 'flags'.
Signed-off-by: Kaixu Xia <xiaka...@huawei.com>
---
include/linux/perf_event.h | 1 +
include/uapi/linux/bpf.h| 11
include/uapi/linux/perf_event.h | 3 +-
kern
int bpf_prog_2(struct pt_regs *ctx)
{
bpf_perf_event_control(_cycles_map, 0, 2);
return 0;
}
Consider control sampling in function level, we have to set
a high sample frequency to dump trace data when enable/disable
the perf event on current cpu.
Kaixu Xia (1):
bpf: control events s
the perf
event on current cpu or all the perf events stored in the maps by
checking the third parameter 'flag'.
Signed-off-by: Kaixu Xia <xiaka...@huawei.com>
---
include/linux/perf_event.h | 1 +
include/uapi/linux/bpf.h| 19 +++
include/uapi/linux/perf_event.
ng in function level, we have to set
a high sample frequency to dump trace data when enable/disable
the perf event on current cpu.
Kaixu Xia (1):
bpf: control events stored in PERF_EVENT_ARRAY maps trace data output
when perf sampling
include/linux/perf_event.h | 1 +
This patch implements the function that controlling all the perf
events stored in PERF_EVENT_ARRAY maps by setting the parameter
'index' to maps max_entries.
Signed-off-by: Kaixu Xia <xiaka...@huawei.com>
---
kernel/trace/bpf_trace.c | 20 ++--
1 file changed, 18 insertions
bpf_prog_2(struct pt_regs *ctx)
{
bpf_perf_event_dump_control(_cycles_map, 32, 1);
return 0;
}
Consider control sampling in function level, we have to set
a high sample frequency to dump trace data when enable/disable
the perf event on current cpu.
Kaixu Xia (2):
bpf: control the trace data output on curren
the
perf_event on current cpu.
Signed-off-by: Kaixu Xia <xiaka...@huawei.com>
---
include/linux/perf_event.h | 1 +
include/uapi/linux/bpf.h| 5 +
include/uapi/linux/perf_event.h | 3 ++-
kernel/bpf/verifier.c | 3 ++-
kernel/events/core.c
This patch creates a new ioctl PERF_EVENT_IOC_SET_ENABLER to let
perf to select an event as 'enabler'. So we can set this 'enabler'
event to enable/disable a set of events. The event on CPU 0 is
treated as the 'enabler' event by default.
Signed-off-by: Kaixu Xia <xiaka...@huawei.com>
---
i
the
perf_event on current cpu.
Signed-off-by: Kaixu Xia <xiaka...@huawei.com>
---
include/linux/perf_event.h | 1 +
include/uapi/linux/bpf.h| 5 +
include/uapi/linux/perf_event.h | 3 ++-
kernel/bpf/verifier.c | 3 ++-
kernel/events/core.c
quot;)
int bpf_prog_2(struct pt_regs *ctx)
{
bpf_perf_event_sample_control(_cycles_map, 32, 1);
return 0;
}
Consider control sampling in function level, if we don't use the
PERF_EVENT_IOC_SET_ENABLER ioctl in perf user side, we must set
a high sample frequency to dump tra
;
return 0;
}
SEC("exit=sys_write%return")
int bpf_prog_2(struct pt_regs *ctx)
{
bpf_perf_event_sample_disable(_cycles_map);
return 0;
}
Kaixu Xia (2):
perf: Add the flag sample_disable not to output data on samples
bpf: Implement bpf_pe
-off-by: Kaixu Xia <xiaka...@huawei.com>
---
include/linux/bpf.h| 1 +
include/linux/perf_event.h | 2 ++
kernel/bpf/arraymap.c | 5 +
kernel/events/core.c | 3 +++
4 files changed, 11 insertions(+)
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index f57d7fe..2
The functions bpf_perf_event_sample_enable/disable() can set the
flag sample_disable to enable/disable output trace data on samples.
Signed-off-by: Kaixu Xia <xiaka...@huawei.com>
---
include/linux/bpf.h | 2 ++
include/uapi/linux/bpf.h | 2 ++
kernel/bpf/verifier.c| 4 +++-
sshd-683 [000] d..1 131.429378: : CPU-0 222561024
...
Signed-off-by: Kaixu Xia xiaka...@huawei.com
---
samples/bpf/tracex6_kern.c | 1 +
samples/bpf/tracex6_user.c | 22 +-
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/samples/bpf
There is a build error that 'struct bpf_array' has no member
named 'prog' on s390. In commit 2a36f0b, the member 'prog' of
struct bpf_array is replaced by 'ptrs'. So this patch fixes it.
Signed-off-by: Kaixu Xia xiaka...@huawei.com
---
arch/s390/net/bpf_jit_comp.c | 4 ++--
1 file changed, 2
more generic)
Reported-by: Wu Fengguang fengguang...@intel.com
Signed-off-by: Kaixu Xia xiaka...@huawei.com
---
arch/s390/net/bpf_jit_comp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
index 9f4bbc0..eeda051 100644
'Kbuild test robot' sent me an email about a build error
'struct bpf_array' has no member named 'prog' in s390
architecture. This error is caused by commit: 2a36f0b92eb
638dd023870574eb471b1c56be9ad [656/692] bpf: Make the bpf
_prog_array_map more generic. In this patch, the member 'prog'
of
and add fewer lines of special code.
Signed-off-by: Wang Nan wangn...@huawei.com
Signed-off-by: Kaixu Xia xiaka...@huawei.com
---
arch/x86/net/bpf_jit_comp.c | 6 ++--
include/linux/bpf.h | 8 +++--
kernel/bpf/arraymap.c | 80 +++--
kernel/bpf
This is a simple example and shows how to use the new ability
to get the selected Hardware PMU counter value.
Signed-off-by: Kaixu Xia xiaka...@huawei.com
---
samples/bpf/Makefile | 4 +++
samples/bpf/bpf_helpers.h | 2 ++
samples/bpf/tracex6_kern.c | 26 ++
samples/bpf
accessing events counters in eBPF programs.
The API perf_event_read_local() comes from Peter and I add the
corresponding SOB.
Signed-off-by: Kaixu Xia xiaka...@huawei.com
Signed-off-by: Peter Zijlstra a.p.zijls...@chello.nl
---
include/linux/perf_event.h | 10 ++
kernel/events/core.c
According to the perf_event_map_fd and index, the function
bpf_perf_event_read() can convert the corresponding map
value to the pointer to struct perf_event and return the
Hardware PMU counter value.
Signed-off-by: Kaixu Xia xiaka...@huawei.com
---
include/linux/bpf.h | 1 +
include/uapi
the
selected hardware PMU conuter;
Patch 5/5 gives a simple example.
Kaixu Xia (4):
perf: add the necessary core perf APIs when accessing events counters
in eBPF programs
bpf: Add new bpf map type to store the pointer to struct perf_event
bpf: Implement function bpf_perf_event_read() that get
Introduce a new bpf map type 'BPF_MAP_TYPE_PERF_EVENT_ARRAY'.
This map only stores the pointer to struct perf_event. The
user space event FDs from perf_event_open() syscall are converted
to the pointer to struct perf_event and stored in map.
Signed-off-by: Kaixu Xia xiaka...@huawei.com
Introduce a new bpf map type 'BPF_MAP_TYPE_PERF_EVENT_ARRAY'.
This map only stores the pointer to struct perf_event. The
user space event FDs from perf_event_open() syscall are converted
to the pointer to struct perf_event and stored in map.
Signed-off-by: Kaixu Xia xiaka...@huawei.com
According to the perf_event_map_fd and index, the function
bpf_perf_event_read() can convert the corresponding map
value to the pointer to struct perf_event and return the
Hardware PMU counter value.
Signed-off-by: Kaixu Xia xiaka...@huawei.com
---
include/linux/bpf.h| 1 +
include
to struct perf_event;
Patch 3/4 implements function bpf_perf_event_read() that get the
selected hardware PMU conuter;
Patch 4/4 gives a simple example.
Kaixu Xia (3):
bpf: Add new bpf map type to store the pointer to struct perf_event
bpf: Implement function bpf_perf_event_read() that get
This is a simple example and shows how to use the new ability
to get the selected Hardware PMU counter value.
Signed-off-by: Kaixu Xia xiaka...@huawei.com
---
samples/bpf/Makefile | 4 +++
samples/bpf/bpf_helpers.h | 2 ++
samples/bpf/tracex6_kern.c | 26 ++
samples/bpf
and add fewer lines of special code.
Signed-off-by: Wang Nan wangn...@huawei.com
Signed-off-by: Kaixu Xia xiaka...@huawei.com
---
arch/x86/net/bpf_jit_comp.c | 6 ++--
include/linux/bpf.h | 8 +++--
kernel/bpf/arraymap.c | 80 +++--
kernel/bpf
() that get the
selected hardware PMU conuter;
Patch 4/4 gives a simple example.
Kaixu Xia (3):
bpf: Add new bpf map type to store the pointer to struct perf_event
bpf: Implement function bpf_perf_event_read() that get the selected
hardware PMU conuter
samples/bpf: example of get
Introduce a new bpf map type 'BPF_MAP_TYPE_PERF_EVENT_ARRAY'.
This map only stores the pointer to struct perf_event. The
user space event FDs from perf_event_open() syscall are converted
to the pointer to struct perf_event and stored in map.
Signed-off-by: Kaixu Xia xiaka...@huawei.com
This is a simple example and shows how to use the new ability
to get the selected Hardware PMU counter value.
Signed-off-by: Kaixu Xia xiaka...@huawei.com
---
samples/bpf/Makefile | 4 +++
samples/bpf/bpf_helpers.h | 2 ++
samples/bpf/tracex6_kern.c | 26 ++
samples/bpf
According to the perf_event_map_fd and index, the function
bpf_perf_event_read() can convert the corresponding map
value to the pointer to struct perf_event and return the
Hardware PMU counter value.
Signed-off-by: Kaixu Xia xiaka...@huawei.com
---
include/linux/bpf.h| 1 +
include
, buf=0078c010,
size=512)
dd-1051 [000] d...26.712704: : write(fd=1, buf=0078c010,
size=512)
...
Signed-off-by: Wang Nan wangn...@huawei.com
Signed-off-by: Kaixu Xia xiaka...@huawei.com
---
arch/x86/net/bpf_jit_comp.c | 6 ++--
include/linux/bpf.h | 8
33 matches
Mail list logo