[PATCH bpf-next v2] bpf, doc: Update bpf_jit_enable limitation for CONFIG_BPF_JIT_ALWAYS_ON

2018-04-27 Thread Leo Yan
When CONFIG_BPF_JIT_ALWAYS_ON is enabled, kernel has limitation for bpf_jit_enable, so it has fixed value 1 and we cannot set it to 2 for JIT opcode dumping; this patch is to update the doc for it. Suggested-by: Daniel Borkmann <dan...@iogearbox.net> Signed-off-by: Leo Yan <leo@l

Re: [PATCH bpf-next] bpf, doc: Update bpf_jit_enable limitation for CONFIG_BPF_JIT_ALWAYS_ON

2018-04-27 Thread Leo Yan
On Fri, Apr 27, 2018 at 11:44:44AM +0200, Daniel Borkmann wrote: > On 04/26/2018 04:26 AM, Leo Yan wrote: > > When CONFIG_BPF_JIT_ALWAYS_ON is enabled, kernel has limitation for > > bpf_jit_enable, so it has fixed value 1 and we cannot set it to 2 > > for JIT opcod

Re: [PATCH bpf-next] bpf: Allow bpf_jit_enable = 2 with BPF_JIT_ALWAYS_ON config

2018-04-25 Thread Leo Yan
On Wed, Apr 25, 2018 at 05:37:39PM +0200, Daniel Borkmann wrote: > On 04/25/2018 04:14 PM, Alexei Starovoitov wrote: > > On Wed, Apr 25, 2018 at 05:25:47PM +0800, Leo Yan wrote: > >> > >> If we have concern for security issue, should we remove support for > >

[PATCH bpf-next] bpf, doc: Update bpf_jit_enable limitation for CONFIG_BPF_JIT_ALWAYS_ON

2018-04-25 Thread Leo Yan
When CONFIG_BPF_JIT_ALWAYS_ON is enabled, kernel has limitation for bpf_jit_enable, so it has fixed value 1 and we cannot set it to 2 for JIT opcode dumping; this patch is to update the doc for it. Signed-off-by: Leo Yan <leo@linaro.org> --- Documentation/networking/filter.txt | 6 +++

Re: [PATCH bpf-next 1/5] samples/bpf: Fix typo in comment

2018-04-25 Thread Leo Yan
On Fri, Apr 20, 2018 at 03:52:13PM +0200, Jesper Dangaard Brouer wrote: > On Fri, 20 Apr 2018 14:21:16 +0100 > Daniel Thompson <daniel.thomp...@linaro.org> wrote: > > > On Fri, Apr 20, 2018 at 02:10:04PM +0200, Jesper Dangaard Brouer wrote: > > > > > > On

Re: [PATCH bpf-next] bpf: Allow bpf_jit_enable = 2 with BPF_JIT_ALWAYS_ON config

2018-04-25 Thread Leo Yan
Hi Daniel, On Wed, Apr 25, 2018 at 11:12:21AM +0200, Daniel Borkmann wrote: > On 04/25/2018 10:18 AM, Leo Yan wrote: > > After enabled BPF_JIT_ALWAYS_ON config, bpf_jit_enable always equals to > > 1; it is impossible to set 'bpf_jit_enable = 2' and the kernel has no >

[PATCH bpf-next] bpf: Allow bpf_jit_enable = 2 with BPF_JIT_ALWAYS_ON config

2018-04-25 Thread Leo Yan
. Signed-off-by: Leo Yan <leo@linaro.org> --- net/core/sysctl_net_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c index b1a2c5e..6a39b22 100644 --- a/net/core/sysctl_net_core.c +++ b/net/core/sysctl_net_

Re: [PATCH bpf-next 4/5] samples/bpf: Refine printing symbol for sampleip

2018-04-18 Thread Leo Yan
On Wed, Apr 18, 2018 at 10:21:25PM -0700, Alexei Starovoitov wrote: > On Thu, Apr 19, 2018 at 01:12:49PM +0800, Leo Yan wrote: > > On Wed, Apr 18, 2018 at 09:47:45PM -0700, Alexei Starovoitov wrote: > > > On Thu, Apr 19, 2018 at 09:34:05AM +0800, Leo Yan wrote: > > &g

Re: [PATCH bpf-next 4/5] samples/bpf: Refine printing symbol for sampleip

2018-04-18 Thread Leo Yan
On Wed, Apr 18, 2018 at 09:47:45PM -0700, Alexei Starovoitov wrote: > On Thu, Apr 19, 2018 at 09:34:05AM +0800, Leo Yan wrote: > > The code defines macro 'PAGE_OFFSET' and uses it to decide if the > > address is in kernel space or not. But different architecture has > > diffe

[PATCH bpf-next 0/5] samples/bpf: Minor fixes and cleanup

2018-04-18 Thread Leo Yan
benefit of this refactor is program sampleip can be used without architecture dependency. The patch series has been tested on ARM64 Hikey960 boards. Leo Yan (5): samples/bpf: Fix typo in comment samples/bpf: Dynamically allocate structure 'syms' samples/bpf: Use NULL for failed to find symbol

[PATCH bpf-next 1/5] samples/bpf: Fix typo in comment

2018-04-18 Thread Leo Yan
Fix typo by replacing 'iif' with 'if'. Signed-off-by: Leo Yan <leo@linaro.org> --- samples/bpf/bpf_load.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/bpf/bpf_load.c b/samples/bpf/bpf_load.c index bebe418..28e4678 100644 --- a/samples/bpf/bpf_load.c

[PATCH bpf-next 3/5] samples/bpf: Use NULL for failed to find symbol

2018-04-18 Thread Leo Yan
. This commit changes to use NULL pointer for failed to find symbol, user functions need to check the pointer is NULL and get to know the address has no corresponding kernel symbol for it. Signed-off-by: Leo Yan <leo@linaro.org> --- samples/bpf/bpf_load.c | 4 ++-- 1 file changed, 2 insertions

[PATCH bpf-next 2/5] samples/bpf: Dynamically allocate structure 'syms'

2018-04-18 Thread Leo Yan
bss dec hex filename 188411172 5199776 5219789 4fa5cd samples/bpf/sampleip After: textdata bss dec hex filename 191011188 399792 420081 668f1 samples/bpf/sampleip Signed-off-by: Leo Yan <leo@linaro.org> --- samples/bpf/bpf_load.

[PATCH bpf-next 4/5] samples/bpf: Refine printing symbol for sampleip

2018-04-18 Thread Leo Yan
falls into kernel space or not, and removes macro 'PAGE_OFFSET' as it isn't used anymore. As result, this program has no architecture dependency. Signed-off-by: Leo Yan <leo@linaro.org> --- samples/bpf/sampleip_user.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff

[PATCH bpf-next 5/5] samples/bpf: Handle NULL pointer returned by ksym_search()

2018-04-18 Thread Leo Yan
This commit handles NULL pointer returned by ksym_search() to directly print address hexadecimal value, the change is applied in 'trace_event', 'spintest' and 'offwaketime' programs. Signed-off-by: Leo Yan <leo@linaro.org> --- samples/bpf/offwaketime_user.c | 5 + sampl

Re: [PATCH bpf-next v2] samples/bpf: Add program for CPU state statistics

2018-02-26 Thread Leo Yan
On Mon, Feb 26, 2018 at 11:26:52AM +0100, Daniel Borkmann wrote: > On 02/26/2018 02:19 AM, Leo Yan wrote: [...] > > CPU states statistics: > > state(ms) cstate-0cstate-1cstate-2pstate-0pstate-1 > > pstate-2pstate-3pstate-4 > >

[PATCH bpf-next v2] samples/bpf: Add program for CPU state statistics

2018-02-25 Thread Leo Yan
684 1284 CPU-7 125 15238 102704 398 20 665 786 1197 Cc: Daniel Lezcano <daniel.lezc...@linaro.org> Cc: Vincent Guittot <vincent.guit...@linaro.org> Signed-off-by: Leo Yan <leo@linaro.org> --- samples/bpf/Makefil

Re: [PATCH] samples/bpf: Add program for CPU state statistics

2018-01-31 Thread Leo Yan
Hi Jesper, On Wed, Jan 31, 2018 at 10:14:27AM +0100, Jesper Dangaard Brouer wrote: > On Wed, 31 Jan 2018 02:29:59 +0800 > Leo Yan <leo@linaro.org> wrote: > > > CPU 0 > > State: Duration(ms) Distribution > > cstate 0 : 47555|*

[PATCH] samples/bpf: Add program for CPU state statistics

2018-01-30 Thread Leo Yan
3 : 952 || pstate 4 : 0|| Cc: Daniel Lezcano <daniel.lezc...@linaro.org> Cc: Vincent Guittot <vincent.guit...@linaro.org> Signed-off-by: Leo Yan <leo@linaro.org> --- sa