[PATCH v6 bpf-next 3/3] bpf: add tests for bpf_descendant_of

2019-07-10 Thread Javier Honduvilla Coto
Adding the following test cases: - bpf_descendant_of(current->pid) == 1 - bpf_descendant_of(current->real_parent->pid) == 1 - bpf_descendant_of(1) == 1 - bpf_descendant_of(0) == 1 - bpf_descendant_of(-1) == 0 - bpf_descendant_of(current->children[0]->pid) == 0 Signed-off-by: Ja

[PATCH v6 bpf-next 2/3] bpf: sync kernel uapi headers

2019-07-10 Thread Javier Honduvilla Coto
Sync kernel uapi headers. Signed-off-by: Javier Honduvilla Coto --- tools/include/uapi/linux/bpf.h | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 402208581b2d..505ee91898c2 100644

[PATCH v6 bpf-next 0/3] bpf: add bpf_descendant_of helper

2019-07-10 Thread Javier Honduvilla Coto
Hi all, This patch adds the bpf_descendant_of helper which accepts a PID and returns 1 if the PID of the process currently being executed is a descendant of it or if it's itself. Returns 0 otherwise. The passed PID should be the one as seen from the "global" pid namespace as the processes' PIDs in

[PATCH v6 bpf-next 1/3] bpf: add bpf_descendant_of helper

2019-07-10 Thread Javier Honduvilla Coto
rect in really large process chains. Signed-off-by: Javier Honduvilla Coto --- include/linux/bpf.h | 1 + include/uapi/linux/bpf.h | 20 +++- kernel/bpf/core.c| 1 + kernel/bpf/helpers.c | 27 +++ kernel/trace/bpf_trace.c | 2 ++

Re: [PATCH v5 bpf-next 1/3] bpf: add bpf_descendant_of helper

2019-04-11 Thread Javier Honduvilla Coto
On Thu, Apr 11, 2019 at 11:55:58PM +0200, Daniel Borkmann wrote: > On 04/10/2019 10:36 PM, Javier Honduvilla Coto wrote: > > This patch adds the bpf_descendant_of helper which accepts a PID and > > returns 1 if the PID of the process currently being executed is a > > descen

[PATCH v5 bpf-next 2/3] bpf: sync kernel uapi headers

2019-04-10 Thread Javier Honduvilla Coto
Sync kernel uapi headers. Signed-off-by: Javier Honduvilla Coto --- tools/include/uapi/linux/bpf.h | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index af1cbd951f26..f707b286c21d 100644 --- a/tools

[PATCH v5 bpf-next 0/3] bpf: add bpf_descendant_of helper

2019-04-10 Thread Javier Honduvilla Coto
ux/bpf.h Javier Honduvilla Coto (3): bpf: add bpf_descendant_of helper bpf: sync kernel uapi headers bpf: add tests for bpf_descendant_of include/linux/bpf.h | 1 + include/uapi/linux/bpf.h | 10 +- kernel/bpf/core.c

[PATCH v5 bpf-next 3/3] bpf: add tests for bpf_descendant_of

2019-04-10 Thread Javier Honduvilla Coto
Adding the following test cases: - bpf_descendant_of(current->pid) == 1 - bpf_descendant_of(current->real_parent->pid) == 1 - bpf_descendant_of(1) == 1 - bpf_descendant_of(0) == 1 - bpf_descendant_of(-1) == 0 - bpf_descendant_of(current->children[0]->pid) == 0 Signed-off-by: Ja

[PATCH v5 bpf-next 1/3] bpf: add bpf_descendant_of helper

2019-04-10 Thread Javier Honduvilla Coto
doing consumes lots of instructions. That and the impossibility to jump backwards makes it really hard to be correct in really large process chains. Signed-off-by: Javier Honduvilla Coto --- include/linux/bpf.h | 1 + include/uapi/linux/bpf.h | 10 +- kernel/bpf/core.c

Re: [PATCH v4 bpf-next 1/3] bpf: add bpf_progenyof helper

2019-03-27 Thread Javier Honduvilla Coto
On Mon, Mar 25, 2019 at 03:17:03PM +0100, Daniel Borkmann wrote: > On 03/22/2019 11:38 PM, Javier Honduvilla Coto wrote: > > This patch adds the bpf_progenyof helper which receives a PID and returns > > 1 if the process currently being executed is in the process hierarchy > >

Re: [PATCH v4 bpf-next 1/3] bpf: add bpf_progenyof helper

2019-03-27 Thread Javier Honduvilla Coto
On Mon, Mar 25, 2019 at 03:17:03PM +0100, Daniel Borkmann wrote: > On 03/22/2019 11:38 PM, Javier Honduvilla Coto wrote: > > This patch adds the bpf_progenyof helper which receives a PID and returns > > 1 if the process currently being executed is in the process hierarchy > >

Re: [PATCH v3 bpf-next 0/3] bpf: add bpf_progenyof helper

2019-03-22 Thread Javier Honduvilla Coto
On Thu, Mar 07, 2019 at 10:26:22AM +0100, Daniel Borkmann wrote: > On 03/05/2019 11:47 PM, Javier Honduvilla Coto wrote: > > Hi all, > > > > This patch add the bpf_progenyof helper which receives a PID and returns > > 1 if the process currently being executed

[PATCH v4 bpf-next 3/3] bpf: add tests for bpf_progenyof

2019-03-22 Thread Javier Honduvilla Coto
Adding the following test cases: - progenyof(current->pid) == 1 - progenyof(current->real_parent->pid) == 1 - progenyof(1) == 1 - progenyof(0) == 1 - progenyof(-1) == 0 - progenyof(current->children[0]->pid) == 0 Signed-off-by: Javier Honduvilla Coto --- tools/testing/selftests

[PATCH v4 bpf-next 1/3] bpf: add bpf_progenyof helper

2019-03-22 Thread Javier Honduvilla Coto
of instructions. That and the impossibility to jump backwards makes it really hard to be correct in really large process chains. Signed-off-by: Javier Honduvilla Coto --- include/linux/bpf.h | 1 + include/uapi/linux/bpf.h | 10 +- kernel/bpf/core.c| 1 + kernel/bpf

[PATCH v4 bpf-next 2/3] bpf: sync kernel uapi headers

2019-03-22 Thread Javier Honduvilla Coto
Sync kernel uapi headers. Signed-off-by: Javier Honduvilla Coto --- tools/include/uapi/linux/bpf.h | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 3c04410137d9..cf54cc739bf4 100644 --- a/tools

[PATCH v4 bpf-next 0/3] bpf: add bpf_progenyof helper

2019-03-22 Thread Javier Honduvilla Coto
as somehow I accidentally used my personal one in v2 Changes in V2: - Adding missing docs in include/uapi/linux/bpf.h Javier Honduvilla Coto (3): bpf: add bpf_progenyof helper bpf: sync kernel uapi headers bpf: add tests for bpf_progenyof include/linux/bpf.h

[PATCH v3 bpf-next 1/3] bpf: add bpf_progenyof helper

2019-03-05 Thread Javier Honduvilla Coto
of instructions. That and the impossibility to jump backwards makes it really hard to be correct in really large process chains. Signed-off-by: Javier Honduvilla Coto --- include/linux/bpf.h | 1 + include/uapi/linux/bpf.h | 10 +- kernel/bpf/core.c| 1 + kernel/bpf

[PATCH v3 bpf-next 2/3] bpf: sync kernel uapi headers

2019-03-05 Thread Javier Honduvilla Coto
Sync kernel uapi headers. Signed-off-by: Javier Honduvilla Coto --- tools/include/uapi/linux/bpf.h | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 3c38ac9a92a7..f72741766ba8 100644 --- a/tools

[PATCH v3 bpf-next 3/3] bpf: add tests for bpf_progenyof

2019-03-05 Thread Javier Honduvilla Coto
Adding the following test cases: - progenyof(current->pid) == 1 - progenyof(current->real_parent->pid) == 1 - progenyof(1) == 1 - progenyof(0) == 1 - progenyof(-1) == 0 - progenyof(current->children[0]->pid) == 0 Signed-off-by: Javier Honduvilla Coto --- tools/testing/selftests

[PATCH v3 bpf-next 0/3] bpf: add bpf_progenyof helper

2019-03-05 Thread Javier Honduvilla Coto
: - Adding missing docs in include/uapi/linux/bpf.h Javier Honduvilla Coto (3): bpf: add bpf_progenyof helper bpf: sync kernel uapi headers bpf: add tests for bpf_progenyof include/linux/bpf.h | 1 + include/uapi/linux/bpf.h | 10

Re: [PATCH v2 bpf-next 1/3] bpf: add bpf_progenyof helper

2019-03-01 Thread Javier Honduvilla Coto
On Sat, Mar 02, 2019 at 12:12:57AM +, Martin Lau wrote: > On Fri, Mar 01, 2019 at 10:06:12AM -0800, Javier Honduvilla Coto wrote: > > From: Javier Honduvilla Coto > > > > This patch adds the bpf_progenyof helper which receives a PID and returns > > 1 if the process

Re: [PATCH bpf-next 1/3] bpf: add bpf_progenyof helper

2019-03-01 Thread Javier Honduvilla Coto
On Sat, Mar 02, 2019 at 12:01:14AM +, Martin Lau wrote: > On Fri, Mar 01, 2019 at 09:28:39AM -0800, Javier Honduvilla Coto wrote: > > On Wed, Feb 27, 2019 at 06:26:41AM +, Martin Lau wrote: > > > On Tue, Feb 26, 2019 at 02:36:49PM -0800, Javier Honduvilla Coto wrote:

[PATCH v2 bpf-next 0/3] bpf: add bpf_progenyof helper

2019-03-01 Thread Javier Honduvilla Coto
lots of instructions. That and the impossibility to jump backwards makes it really hard to be correct in really large process chains. Let me know what do you think! Thanks, --- Changed in V2: - Adding missing docs in include/uapi/linux/bpf.h Javier Honduvilla Coto (3): bpf: add

[PATCH v2 bpf-next 2/3] bpf: sync kernel uapi headers

2019-03-01 Thread Javier Honduvilla Coto
From: Javier Honduvilla Coto Sync kernel uapi headers. Signed-off-by: Javier Honduvilla Coto --- tools/include/uapi/linux/bpf.h | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index bcdd2474eee7

[PATCH v2 bpf-next 1/3] bpf: add bpf_progenyof helper

2019-03-01 Thread Javier Honduvilla Coto
From: Javier Honduvilla Coto This patch adds the bpf_progenyof helper which receives a PID and returns 1 if the process currently being executed is in the process hierarchy including itself or 0 if not. This is very useful in tracing programs when we want to filter by a given PID and all the

[PATCH v2 bpf-next 3/3] bpf: add tests for bpf_progenyof

2019-03-01 Thread Javier Honduvilla Coto
From: Javier Honduvilla Coto Adding the following test cases: - progenyof(current->pid) == 1 - progenyof(current->real_parent->pid) == 1 - progenyof(1) == 1 - progenyof(0) == 0 - progenyof(current->children[0]->pid) == 0 Signed-off-by: Javier Honduvilla Coto --- tools/testin

Re: [PATCH bpf-next 1/3] bpf: add bpf_progenyof helper

2019-03-01 Thread Javier Honduvilla Coto
On Wed, Feb 27, 2019 at 06:26:41AM +, Martin Lau wrote: Sorry, accidentally did not reply to all your comments: > On Tue, Feb 26, 2019 at 02:36:49PM -0800, Javier Honduvilla Coto wrote: > > This patch adds the bpf_progenyof helper which receives a PID and returns > What

Re: [PATCH bpf-next 1/3] bpf: add bpf_progenyof helper

2019-03-01 Thread Javier Honduvilla Coto
On Wed, Feb 27, 2019 at 06:26:41AM +, Martin Lau wrote: > On Tue, Feb 26, 2019 at 02:36:49PM -0800, Javier Honduvilla Coto wrote: > > This patch adds the bpf_progenyof helper which receives a PID and returns > What is progenof? > > > 1 if the process currently being execu

[PATCH bpf-next 3/3] bpf: add tests for bpf_progenyof

2019-02-26 Thread Javier Honduvilla Coto
Adding the following test cases: - progenyof(current->pid) == 1 - progenyof(current->real_parent->pid) == 1 - progenyof(1) == 1 - progenyof(0) == 0 - progenyof(current->children[0]->pid) == 0 Signed-off-by: Javier Honduvilla Coto --- tools/testing/selftests/bpf/.gitignore

[PATCH bpf-next 1/3] bpf: add bpf_progenyof helper

2019-02-26 Thread Javier Honduvilla Coto
of instructions. That and the impossibility to jump backwards makes it really hard to be correct in really large process chains. Signed-off-by: Javier Honduvilla Coto --- include/linux/bpf.h | 1 + include/uapi/linux/bpf.h | 3 ++- kernel/bpf/core.c| 1 + kernel/bpf/helpers.c

[PATCH bpf-next 0/3] bpf: add progenyof helper

2019-02-26 Thread Javier Honduvilla Coto
lots of instructions. That and the impossibility to jump backwards makes it really hard to be correct in really large process chains. Let me know what do you think! Thanks, Javier Honduvilla Coto (3): bpf: add bpf_progenyof helper bpf: sync kernel uapi headers bpf: add tests for

[PATCH bpf-next 2/3] bpf: sync kernel uapi headers

2019-02-26 Thread Javier Honduvilla Coto
Sync kernel uapi headers. Signed-off-by: Javier Honduvilla Coto --- tools/include/uapi/linux/bpf.h | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index bcdd2474eee7..354ec295864c 100644 --- a/tools