[PATCH] coresight: remove the unused macro CORESIGHT_DEBUGFS_ENTRY

2014-12-30 Thread Kaixu Xia
From: Xia Kaixu xiaka...@huawei.com Debugfs isn't used for coresight configuration, so the macro CORESIGHT_DEBUGFS_ENTRY is unnecessary, just remove it. Signed-off-by: Xia Kaixu xiaka...@huawei.com --- include/linux/coresight.h | 9 - 1 file changed, 9 deletions(-) diff --git

[PATCH] coresight: fix typo in comment in of_coresight.c

2014-12-30 Thread Kaixu Xia
Debugfs isn't used for coresight configuration, so the corresponding comments should be changed. Signed-off-by: Kaixu Xia xiaka...@huawei.com --- drivers/coresight/of_coresight.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/coresight/of_coresight.c b/drivers

[PATCH] coresight: remove the extra spaces

2015-01-15 Thread Kaixu Xia
There are some extra spaces, so just remove them from these lines. Signed-off-by: Kaixu Xia xiaka...@huawei.com --- drivers/coresight/coresight-etb10.c | 2 +- drivers/coresight/coresight.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/coresight/coresight

[PATCH] coresight: fix the debug AMBA bus name

2015-01-15 Thread Kaixu Xia
The right debug AMBA bus name should be APB(Advanced Peripheral Bus), so just fix it. Signed-off-by: Kaixu Xia xiaka...@huawei.com --- Documentation/trace/coresight.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/trace/coresight.txt b/Documentation

[PATCH] coresight: remove the unnecessary function coresight_is_bit_set()

2015-01-15 Thread Kaixu Xia
This function coresight_is_bit_set() isn't called, so we should remove it. Signed-off-by: Kaixu Xia xiaka...@huawei.com --- include/linux/coresight.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/linux/coresight.h b/include/linux/coresight.h index 5d3c543..a860933 100644

[PATCH] perf: remove the extra validity check on nr_pages

2015-01-27 Thread Kaixu Xia
. Signed-off-by: Kaixu Xia xiaka...@huawei.com --- kernel/events/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index 882f835..abb57c2 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -4268,7 +4268,7 @@ static int

[PATCH] Documentation: of: fix typo in graph bindings

2015-01-05 Thread Kaixu Xia
Just fix a minor typo about the example path. Signed-off-by: Kaixu Xia xiaka...@huawei.com --- Documentation/devicetree/bindings/graph.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/graph.txt b/Documentation/devicetree/bindings

[PATCH] coresight: fix comment in of_coresight.c

2015-01-05 Thread Kaixu Xia
Outports is a member of the struct pdata and should be a better choice. Signed-off-by: Kaixu Xia xiaka...@huawei.com --- drivers/coresight/of_coresight.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/coresight/of_coresight.c b/drivers/coresight/of_coresight.c index

[PATCH] coresight: remove the unnecessary replicator property

2015-01-12 Thread Kaixu Xia
Now we use the device name to identify replicator instead of a unique number, so just remove it. Signed-off-by: Kaixu Xia xiaka...@huawei.com --- Documentation/devicetree/bindings/arm/coresight.txt | 4 1 file changed, 4 deletions(-) diff --git a/Documentation/devicetree/bindings/arm

[PATCH] coresight: fix the replicator subtype value

2015-01-12 Thread Kaixu Xia
According to the classification, the type of replicator is link, so the subtype should also be link_subtype. Signed-off-by: Kaixu Xia xiaka...@huawei.com --- drivers/coresight/coresight-replicator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/coresight/coresight

[PATCH] coresight: fix return value judgement in of_coresight.c

2015-01-07 Thread Kaixu Xia
The right return value is rdev, so we should judge it. Signed-off-by: Kaixu Xia xiaka...@huawei.com --- drivers/coresight/of_coresight.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/coresight/of_coresight.c b/drivers/coresight/of_coresight.c index 5030c07..5b5f188

[PATCH] coresight: fix the link between orphan connection and newly added device

2015-01-13 Thread Kaixu Xia
-by: Kaixu Xia xiaka...@huawei.com --- drivers/coresight/coresight.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/coresight/coresight.c b/drivers/coresight/coresight.c index 6e0181f..11968b7 100644 --- a/drivers/coresight/coresight.c +++ b/drivers/coresight

[PATCH] coresight: fix the parameter name of etm_writel_cp14()

2015-01-14 Thread Kaixu Xia
This minor change is necessary to make more sense. Signed-off-by: Kaixu Xia xiaka...@huawei.com --- drivers/coresight/coresight-priv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/coresight/coresight-priv.h b/drivers/coresight/coresight-priv.h index 7b3372f

[PATCH] coresight: remove the unnecessary configuration coresight-default-sink

2015-03-08 Thread Kaixu Xia
The judgement of configuration coresight-default-sink has been removed from the framework. So just remove it from DT and bindings. Signed-off-by: Kaixu Xia xiaka...@huawei.com --- Documentation/devicetree/bindings/arm/coresight.txt | 1 - arch/arm/boot/dts/hip04.dtsi| 1

[PATCH v6 2/4] bpf: Add new bpf map type to store the pointer to struct perf_event

2015-08-04 Thread Kaixu Xia
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

[PATCH v6 3/4] bpf: Implement function bpf_perf_event_read() that get the selected hardware PMU conuter

2015-08-04 Thread Kaixu Xia
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

[PATCH v6 4/4] samples/bpf: example of get selected PMU counter value

2015-08-04 Thread Kaixu Xia
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

[PATCH v6 1/4] bpf: Make the bpf_prog_array_map more generic

2015-08-04 Thread Kaixu Xia
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

[PATCH v6 0/4] bpf: Introduce the new ability of eBPF programs to access hardware PMU counter

2015-08-04 Thread Kaixu Xia
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

[PATCH v5 2/4] bpf: Add new bpf map type to store the pointer to struct perf_event

2015-07-31 Thread Kaixu Xia
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

[PATCH v5 0/4] bpf: Introduce the new ability of eBPF programs to access hardware PMU counter

2015-07-31 Thread Kaixu Xia
() 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

[PATCH v5 3/4] bpf: Implement function bpf_perf_event_read() that get the selected hardware PMU conuter

2015-07-31 Thread Kaixu Xia
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

[PATCH v5 4/4] samples/bpf: example of get selected PMU counter value

2015-07-31 Thread Kaixu Xia
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

[PATCH v5 1/4] bpf: Make the bpf_prog_array_map more generic

2015-07-31 Thread Kaixu Xia
, 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

[PATCH v4 3/4] bpf: Implement function bpf_perf_event_read() that get the selected hardware PMU conuter

2015-07-28 Thread Kaixu Xia
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

[PATCH v4 2/4] bpf: Add new bpf map type to store the pointer to struct perf_event

2015-07-28 Thread Kaixu Xia
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

[PATCH v4 0/4] bpf: Introduce the new ability of eBPF programs to access hardware PMU counter

2015-07-28 Thread Kaixu Xia
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 selected PMU counter

[PATCH v4 4/4] samples/bpf: example of get selected PMU counter value

2015-07-28 Thread Kaixu Xia
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

[PATCH v4 1/4] bpf: Make the bpf_prog_array_map more generic

2015-07-28 Thread Kaixu Xia
, 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 --- include/linux/bpf.h | 6 ++- kernel/bpf/arraymap.c | 104

[PATCH v2 net-next] bpf: s390: Fix build error caused by the struct bpf_array member name changed

2015-08-11 Thread Kaixu Xia
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

[PATCH v3 net-next] bpf: s390: Fix build error caused by the struct bpf_array member name changed

2015-08-11 Thread Kaixu Xia
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

[PATCH net-next] bpf: fix the bug 'struct bpf_array' has no member named 'prog' in s390 architecture

2015-08-10 Thread Kaixu Xia
'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

[PATCH v7 0/5] bpf: Introduce the new ability of eBPF programs to access hardware PMU counter

2015-08-06 Thread Kaixu Xia
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

[PATCH v7 3/5] bpf: Add new bpf map type to store the pointer to struct perf_event

2015-08-06 Thread Kaixu Xia
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

[PATCH v7 1/5] perf: add the necessary core perf APIs when accessing events counters in eBPF programs

2015-08-06 Thread Kaixu Xia
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

[PATCH v7 4/5] bpf: Implement function bpf_perf_event_read() that get the selected hardware PMU conuter

2015-08-06 Thread Kaixu Xia
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

[PATCH v7 2/5] bpf: Make the bpf_prog_array_map more generic

2015-08-06 Thread Kaixu Xia
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

[PATCH v7 5/5] samples/bpf: example of get selected PMU counter value

2015-08-06 Thread Kaixu Xia
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

[PATCH net-next] bpf: fix build warnings and add function read_trace_pipe()

2015-08-12 Thread Kaixu Xia
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

[PATCH v2 4/5] bpf: Implement function bpf_perf_event_read() that get the selected hardware PMU conuter

2015-07-22 Thread Kaixu Xia
is lacked. Signed-off-by: Kaixu Xia xiaka...@huawei.com --- include/linux/bpf.h| 1 + include/linux/perf_event.h | 3 ++- include/uapi/linux/bpf.h | 2 ++ kernel/bpf/helpers.c | 42 ++ kernel/events/core.c | 4 ++-- kernel/trace

[PATCH v2 0/5] bpf: Introduce the new ability of eBPF programs to access hardware PMU counter

2015-07-22 Thread Kaixu Xia
structure when add new element to the map; Patch 4/5 implement function bpf_perf_event_read() that get the selected hardware PMU conuter; Patch 5/5 give a simple example. Kaixu Xia (5): bpf: Add new bpf map type to store the pointer to struct perf_event bpf: Add function map-ops

[PATCH v2 3/5] bpf: Save the pointer to struct perf_event to map

2015-07-22 Thread Kaixu Xia
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 --- include/linux/perf_event.h | 2 ++ kernel/bpf/arraymap.c | 53 ++ kernel

[PATCH v2 5/5] samples/bpf: example of get selected PMU counter value

2015-07-22 Thread Kaixu Xia
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 | 27 +++ samples/bpf

[PATCH v2 1/5] bpf: Add new bpf map type to store the pointer to struct perf_event

2015-07-22 Thread Kaixu Xia
Introduce a new bpf map type 'BPF_MAP_TYPE_PERF_EVENT_ARRAY'. This map will only store the pointer to struct perf_event. Signed-off-by: Kaixu Xia xiaka...@huawei.com --- include/linux/bpf.h | 2 ++ include/uapi/linux/bpf.h | 1 + kernel/bpf/arraymap.c| 40

[PATCH v2 2/5] bpf: Add function map-ops-map_traverse_elem() to traverse map elems

2015-07-22 Thread Kaixu Xia
We want to traverse the map elements and make use of the map value one by one. So add new function map-ops-map_traverse_elem() to traverse map elements. Signed-off-by: Kaixu Xia xiaka...@huawei.com --- include/linux/bpf.h | 3 +++ kernel/bpf/arraymap.c | 17 + 2 files changed

[PATCH v3 2/3] bpf: Implement function bpf_perf_event_read() that get the selected hardware PMU conuter

2015-07-23 Thread Kaixu Xia
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

[PATCH v3 1/3] bpf: Add new bpf map type to store the pointer to struct perf_event

2015-07-23 Thread Kaixu Xia
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

[PATCH v3 3/3] samples/bpf: example of get selected PMU counter value

2015-07-23 Thread Kaixu Xia
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

[PATCH v3 0/3] bpf: Introduce the new ability of eBPF programs to access hardware PMU counter

2015-07-23 Thread Kaixu Xia
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 selected PMU counter value include/linux/bpf.h| 3 ++ include

[RFC PATCH 2/6] bpf: Add function map-ops-map_traverse_elem() to traverse map elems

2015-07-17 Thread kaixu xia
Sometimes we want to traverse the map elements and make use of the map value one by one. So add new function map-ops-map_traverse_elem() to traverse map elements. Signed-off-by: kaixu xia xiaka...@huawei.com --- include/linux/bpf.h |3 +++ kernel/bpf/arraymap.c | 17

[RFC PATCH 4/6] bpf: Add a bpf program function argument constraint for PMU map

2015-07-17 Thread kaixu xia
For the pmu that contains the pointer to struct perf_event, add the corresponding bpf program function argument constraint 'ARG_PTR_TO_MAP_PERF_EVENT_VALUE'. Signed-off-by: kaixu xia xiaka...@huawei.com --- include/linux/bpf.h |1 + kernel/bpf/verifier.c |9 + 2 files changed

[RFC PATCH 6/6] samples/bpf: example of get selected PMU counter value

2015-07-17 Thread kaixu xia
... Signed-off-by: kaixu xia xiaka...@huawei.com --- samples/bpf/bpf_helpers.h |2 + samples/bpf/bpf_pmu_test.c | 143 2 files changed, 145 insertions(+) create mode 100644 samples/bpf/bpf_pmu_test.c diff --git a/samples/bpf/bpf_helpers.h b

[RFC PATCH 0/6] bpf: Introduce the new ability of eBPF programs to access hardware PMU counter

2015-07-17 Thread kaixu xia
give a simple example. kaixu xia (6): bpf: Add new flags that specify the value type stored in map bpf: Add function map-ops-map_traverse_elem() to traverse map elems bpf: Save the pointer to struct perf_event to map bpf: Add a bpf program function argument constraint for PMU map bpf

[RFC PATCH 1/6] bpf: Add new flags that specify the value type stored in map

2015-07-17 Thread kaixu xia
The pointer to struct perf_event will be stored in map. So add new flag BPF_MAP_FLAG_PERF_EVENT that specify the value type stored in map. The high 8-bit of attr-map_type is used to contain the new flags. Signed-off-by: kaixu xia xiaka...@huawei.com --- include/linux/bpf.h |1 + include

[RFC PATCH 3/6] bpf: Save the pointer to struct perf_event to map

2015-07-17 Thread kaixu xia
The user space event FD from perf_event_open() syscall is converted to the pointer to struct perf event and stored in map. Signed-off-by: kaixu xia xiaka...@huawei.com --- include/linux/perf_event.h |2 ++ kernel/bpf/syscall.c | 68 kernel

[RFC PATCH 5/6] bpf: Implement function bpf_read_pmu() that get the selected hardware PMU conuter

2015-07-17 Thread kaixu xia
The function bpf_read_pmu() can get the specific map key, 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 |2 ++ include/uapi/linux/bpf.h |2

[PATCH V4 1/1] bpf: control events stored in PERF_EVENT_ARRAY maps trace data output when perf sampling

2015-10-19 Thread Kaixu Xia
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.

[PATCH V4 0/1] bpf: control events stored in PERF_EVENT_ARRAY maps trace data output when perf sampling

2015-10-19 Thread Kaixu Xia
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 +

[PATCH V3 0/2] bpf: control events stored in PERF_EVENT_ARRAY maps trace data output when perf sampling

2015-10-16 Thread Kaixu Xia
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

[PATCH V3 2/2] bpf: control all the perf events stored in PERF_EVENT_ARRAY maps

2015-10-16 Thread Kaixu Xia
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

[PATCH V3 1/2] bpf: control the trace data output on current cpu when perf sampling

2015-10-16 Thread Kaixu Xia
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

[PATCH V5 0/1] bpf: control events stored in PERF_EVENT_ARRAY maps trace data output when perf sampling

2015-10-20 Thread Kaixu Xia
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

[PATCH V5 1/1] bpf: control events stored in PERF_EVENT_ARRAY maps trace data output when perf sampling

2015-10-20 Thread Kaixu Xia
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

[PATCH V2 1/2] bpf: control the trace data output on current cpu when perf sampling

2015-10-14 Thread Kaixu Xia
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

[PATCH V2 0/2] bpf: enable/disable events stored in PERF_EVENT_ARRAY maps trace data output when perf sampling

2015-10-14 Thread Kaixu Xia
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

[PATCH V2 2/2] bpf: control a set of perf events by creating a new ioctl PERF_EVENT_IOC_SET_ENABLER

2015-10-14 Thread Kaixu Xia
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

[RFC PATCH 0/2] bpf: enable/disable events stored in PERF_EVENT_ARRAY maps trace data output when perf sampling

2015-10-12 Thread Kaixu Xia
; 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

[RFC PATCH 1/2] perf: Add the flag sample_disable not to output data on samples

2015-10-12 Thread Kaixu Xia
-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

[RFC PATCH 2/2] bpf: Implement bpf_perf_event_sample_enable/disable() helpers

2015-10-12 Thread Kaixu Xia
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 +++-

[RFC PATCH 2/4] bpf tools: Collect BPF_MAP_TYPE_PERF_EVENT_ARRAY map definitions from 'maps' section

2015-08-27 Thread Kaixu Xia
the pointers to struct perf_event in BPF_MAP_TYPE_PERF_EVENT_ARRAY maps. Signed-off-by: Kaixu Xia xiaka...@huawei.com --- tools/lib/bpf/libbpf.c | 76 -- tools/lib/bpf/libbpf.h | 13 + 2 files changed, 74 insertions(+), 15 deletions(-) diff

[RFC PATCH 0/4] perf tools: Use the new ability of eBPF programs to access hardware PMU counter

2015-08-27 Thread Kaixu Xia
); return 0; } Kaixu Xia (4): bpf tools: Add bpf_update_elem() and perf_event_open() for common bpf operations bpf tools: Collect BPF_MAP_TYPE_PERF_EVENT_ARRAY map definitions from 'maps' section bpf tools: Save the perf event fds from maps sections to 'struct bpf_object' bpf

[RFC PATCH 3/4] bpf tools: Save the perf event fds from maps sections to 'struct bpf_object'

2015-08-27 Thread Kaixu Xia
This patch saves the perf_event fds from maps sections to struct bpf_object. So we can enable/disable these perf events at the appropriate time. Signed-off-by: Kaixu Xia xiaka...@huawei.com --- tools/lib/bpf/libbpf.c | 28 ++-- 1 file changed, 26 insertions(+), 2

[RFC PATCH 1/4] bpf tools: Add bpf_update_elem() and perf_event_open() for common bpf operations

2015-08-27 Thread Kaixu Xia
This patch introduces bpf_update_elem() and perf_event_open() in bpf.c/h for common bpf operations. Signed-off-by: Kaixu Xia xiaka...@huawei.com --- tools/lib/bpf/bpf.c | 34 ++ tools/lib/bpf/bpf.h | 4 2 files changed, 38 insertions(+) diff --git a/tools

[RFC PATCH 4/4] bpf tools: Enable/disable the perf events stored in 'struct bpf_object'

2015-08-27 Thread Kaixu Xia
This patch enable/disable the perf events stored in 'struct bpf_object' at the appropriate time. These events we're interested in come from 'maps' sections. Signed-off-by: Kaixu Xia xiaka...@huawei.com --- tools/lib/bpf/libbpf.c | 30 ++ 1 file changed, 30 insertions

[PATCH] perf test: Fix the cmd string comparison in perf test 6

2015-12-15 Thread Kaixu Xia
26):(31726:31726) test child finished with 0 end Validate PERF_RECORD_* events & perf_sample fields: Ok Signed-off-by: Kaixu Xia <xiaka...@huawei.com> --- tools/perf/tests/perf-record.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/t

[PATCH] writeback: fix the wrong congested state variable definition

2016-03-31 Thread Kaixu Xia
The right variable definition should be wb_congested_state that include WB_async_congested and WB_sync_congested. So fix it. Signed-off-by: Kaixu Xia <xiaka...@huawei.com> --- mm/backing-dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/backing-dev.c b/mm/b

[PATCH] f2fs: show the fault injection mount option

2017-01-26 Thread Kaixu Xia
This patch shows the fault injection mount option in f2fs_show_options(). Signed-off-by: Kaixu Xia <xiaka...@huawei.com> --- fs/f2fs/super.c |5 + 1 file changed, 5 insertions(+) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 46fd30d..47880b4 100644 --- a/fs/f2fs/super.c ++

[PATCH] f2fs: remove the redundant variable definition

2017-03-31 Thread Kaixu Xia
The variable 'i' has been defined before, so here we can use it directly. Signed-off-by: Kaixu Xia <xiaka...@huawei.com> --- fs/f2fs/checkpoint.c |1 - 1 file changed, 1 deletion(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 0339daf..2e42684 100644 --- a/f

[PATCH] coresight: fix return value judgement in of_coresight.c

2015-01-07 Thread Kaixu Xia
The right return value is rdev, so we should judge it. Signed-off-by: Kaixu Xia --- drivers/coresight/of_coresight.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/coresight/of_coresight.c b/drivers/coresight/of_coresight.c index 5030c07..5b5f188 100644

[PATCH v4 1/4] bpf: Make the bpf_prog_array_map more generic

2015-07-28 Thread Kaixu Xia
, size=512) dd-1051 [000] d...26.712704: : write(fd=1, buf=0078c010, size=512) ... Signed-off-by: Wang Nan Signed-off-by: Kaixu Xia --- include/linux/bpf.h | 6 ++- kernel/bpf/arraymap.c | 104 +++--- kernel/bpf

[PATCH v4 3/4] bpf: Implement function bpf_perf_event_read() that get the selected hardware PMU conuter

2015-07-28 Thread Kaixu Xia
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 --- include/linux/bpf.h| 1 + include/linux/perf_event.h | 3

[PATCH v4 2/4] bpf: Add new bpf map type to store the pointer to struct perf_event

2015-07-28 Thread Kaixu Xia
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 --- include/linux/bpf.h

[PATCH v4 0/4] bpf: Introduce the new ability of eBPF programs to access hardware PMU counter

2015-07-28 Thread Kaixu Xia
/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 the selected hardware PMU conu

[PATCH v4 4/4] samples/bpf: example of get selected PMU counter value

2015-07-28 Thread Kaixu Xia
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 --- samples/bpf/Makefile | 4 +++ samples/bpf/bpf_helpers.h | 2 ++ samples/bpf/tracex6_kern.c | 26 ++ samples/bpf/tracex6_user.c | 67

[PATCH v7 1/5] perf: add the necessary core perf APIs when accessing events counters in eBPF programs

2015-08-06 Thread Kaixu Xia
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 Signed-off-by: Peter Zijlstra --- include/linux/perf_event.h | 10 ++ kernel/events/core.c | 78

[PATCH v7 3/5] bpf: Add new bpf map type to store the pointer to struct perf_event

2015-08-06 Thread Kaixu Xia
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 --- include/linux/bpf.h

[PATCH v7 4/5] bpf: Implement function bpf_perf_event_read() that get the selected hardware PMU conuter

2015-08-06 Thread Kaixu Xia
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 --- include/linux/bpf.h | 1 + include/uapi/linux/bpf.h | 1

[PATCH v7 2/5] bpf: Make the bpf_prog_array_map more generic

2015-08-06 Thread Kaixu Xia
of special code. Signed-off-by: Wang Nan Signed-off-by: Kaixu Xia --- arch/x86/net/bpf_jit_comp.c | 6 ++-- include/linux/bpf.h | 8 +++-- kernel/bpf/arraymap.c | 80 +++-- kernel/bpf/core.c | 2 +- kernel/bpf/syscall.c

[PATCH v7 5/5] samples/bpf: example of get selected PMU counter value

2015-08-06 Thread Kaixu Xia
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 --- samples/bpf/Makefile | 4 +++ samples/bpf/bpf_helpers.h | 2 ++ samples/bpf/tracex6_kern.c | 26 ++ samples/bpf/tracex6_user.c | 68

[PATCH v7 0/5] bpf: Introduce the new ability of eBPF programs to access hardware PMU counter

2015-08-06 Thread Kaixu Xia
ch 4/5 implements function bpf_perf_event_read() that get 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

[PATCH v5 2/4] bpf: Add new bpf map type to store the pointer to struct perf_event

2015-07-31 Thread Kaixu Xia
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 --- include/linux/bpf.h

[PATCH v5 0/4] bpf: Introduce the new ability of eBPF programs to access hardware PMU counter

2015-07-31 Thread Kaixu Xia
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 the selected h

[PATCH v5 3/4] bpf: Implement function bpf_perf_event_read() that get the selected hardware PMU conuter

2015-07-31 Thread Kaixu Xia
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 --- include/linux/bpf.h| 1 + include/linux/perf_event.h | 12

[PATCH v5 4/4] samples/bpf: example of get selected PMU counter value

2015-07-31 Thread Kaixu Xia
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 --- samples/bpf/Makefile | 4 +++ samples/bpf/bpf_helpers.h | 2 ++ samples/bpf/tracex6_kern.c | 26 ++ samples/bpf/tracex6_user.c | 68

[PATCH v5 1/4] bpf: Make the bpf_prog_array_map more generic

2015-07-31 Thread Kaixu Xia
, size=512) dd-1051 [000] d...26.712704: : write(fd=1, buf=0078c010, size=512) ... Signed-off-by: Wang Nan Signed-off-by: Kaixu Xia --- arch/x86/net/bpf_jit_comp.c | 6 ++-- include/linux/bpf.h | 8 +++-- kernel/bpf/arraymap.c | 80

[PATCH v3 2/3] bpf: Implement function bpf_perf_event_read() that get the selected hardware PMU conuter

2015-07-23 Thread Kaixu Xia
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 --- include/linux/bpf.h| 1 + include/linux/perf_event.h | 3

[PATCH v3 3/3] samples/bpf: example of get selected PMU counter value

2015-07-23 Thread Kaixu Xia
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 --- samples/bpf/Makefile | 4 +++ samples/bpf/bpf_helpers.h | 2 ++ samples/bpf/tracex6_kern.c | 26 ++ samples/bpf/tracex6_user.c | 67

[PATCH v3 0/3] bpf: Introduce the new ability of eBPF programs to access hardware PMU counter

2015-07-23 Thread Kaixu Xia
f_event_read() that get the selected hardware PMU conuter; Patch 3/3 give 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: exampl

[PATCH v3 1/3] bpf: Add new bpf map type to store the pointer to struct perf_event

2015-07-23 Thread Kaixu Xia
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 --- include/linux/bpf.h

[PATCH v2 2/5] bpf: Add function map->ops->map_traverse_elem() to traverse map elems

2015-07-22 Thread Kaixu Xia
We want to traverse the map elements and make use of the map value one by one. So add new function map->ops->map_traverse_elem() to traverse map elements. Signed-off-by: Kaixu Xia --- include/linux/bpf.h | 3 +++ kernel/bpf/arraymap.c | 17 + 2 files changed, 20 inse

  1   2   >