Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1577032 > unrolled thread

[PATCH v4 0/3] Miscellaneous fixes for BPF (perf tree)

Started byMickaël Salaün <mic@digikod.net>
First post2017-02-08 21:40 +0100
Last post2017-02-13 21:30 +0100
Articles 7 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v4 0/3] Miscellaneous fixes for BPF (perf tree) Mickaël Salaün <mic@digikod.net> - 2017-02-08 21:40 +0100
    [PATCH v4 2/3] samples/bpf: Reset global variables Mickaël Salaün <mic@digikod.net> - 2017-02-08 21:40 +0100
    [PATCH v4 3/3] samples/bpf: Add missing header Mickaël Salaün <mic@digikod.net> - 2017-02-08 21:40 +0100
    Re: [PATCH v4 0/3] Miscellaneous fixes for BPF (perf tree) Arnaldo Carvalho de Melo <acme@redhat.com> - 2017-02-10 20:40 +0100
      Re: [PATCH v4 0/3] Miscellaneous fixes for BPF (perf tree) Joe Stringer <joe@ovn.org> - 2017-02-10 22:30 +0100
    Re: [PATCH v4 0/3] Miscellaneous fixes for BPF (perf tree) "Wangnan (F)" <wangnan0@huawei.com> - 2017-02-13 02:50 +0100
      Re: [PATCH v4 0/3] Miscellaneous fixes for BPF (perf tree) Arnaldo Carvalho de Melo <acme@redhat.com> - 2017-02-13 21:30 +0100

#1577032 — [PATCH v4 0/3] Miscellaneous fixes for BPF (perf tree)

FromMickaël Salaün <mic@digikod.net>
Date2017-02-08 21:40 +0100
Subject[PATCH v4 0/3] Miscellaneous fixes for BPF (perf tree)
Message-ID<t8HbY-4Z7-19@gated-at.bofh.it>
This series brings some fixes and small improvements to the BPF samples.

This is intended for the perf tree and apply on 7a5980f9c006 ("tools lib bpf:
Add missing header to the library").

Changes since v3:
* remove applied patch 1/5
* remove patch 2/5 on bpf_load_program() as requested by Wang Nan

Changes since v2:
* add this cover letter

Changes since v1:
* exclude patches not intended for the perf tree

Regards,

Mickaël Salaün (3):
  samples/bpf: Ignore already processed ELF sections
  samples/bpf: Reset global variables
  samples/bpf: Add missing header

 samples/bpf/bpf_load.c     | 7 +++++++
 samples/bpf/tracex5_kern.c | 1 +
 2 files changed, 8 insertions(+)

-- 
2.11.0

[toc] | [next] | [standalone]


#1577035 — [PATCH v4 2/3] samples/bpf: Reset global variables

FromMickaël Salaün <mic@digikod.net>
Date2017-02-08 21:40 +0100
Subject[PATCH v4 2/3] samples/bpf: Reset global variables
Message-ID<t8HbY-4Z7-35@gated-at.bofh.it>
In reply to#1577032
Before loading a new ELF, clean previous kernel version, license and
processed sections.

Signed-off-by: Mickaël Salaün <mic@digikod.net>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: David S. Miller <davem@davemloft.net>
---
 samples/bpf/bpf_load.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/samples/bpf/bpf_load.c b/samples/bpf/bpf_load.c
index e04fe09d7c2e..b86ee54da2d1 100644
--- a/samples/bpf/bpf_load.c
+++ b/samples/bpf/bpf_load.c
@@ -277,6 +277,11 @@ int load_bpf_file(char *path)
 	Elf_Data *data, *data_prog, *symbols = NULL;
 	char *shname, *shname_prog;
 
+	/* reset global variables */
+	kern_version = 0;
+	memset(license, 0, sizeof(license));
+	memset(processed_sec, 0, sizeof(processed_sec));
+
 	if (elf_version(EV_CURRENT) == EV_NONE)
 		return 1;
 
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1577036 — [PATCH v4 3/3] samples/bpf: Add missing header

FromMickaël Salaün <mic@digikod.net>
Date2017-02-08 21:40 +0100
Subject[PATCH v4 3/3] samples/bpf: Add missing header
Message-ID<t8HbY-4Z7-37@gated-at.bofh.it>
In reply to#1577032
Include unistd.h to define __NR_getuid and __NR_getsid.

Signed-off-by: Mickaël Salaün <mic@digikod.net>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: David S. Miller <davem@davemloft.net>
---
 samples/bpf/tracex5_kern.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/samples/bpf/tracex5_kern.c b/samples/bpf/tracex5_kern.c
index fd12d7154d42..7e4cf74553ff 100644
--- a/samples/bpf/tracex5_kern.c
+++ b/samples/bpf/tracex5_kern.c
@@ -8,6 +8,7 @@
 #include <linux/version.h>
 #include <uapi/linux/bpf.h>
 #include <uapi/linux/seccomp.h>
+#include <uapi/linux/unistd.h>
 #include "bpf_helpers.h"
 
 #define PROG(F) SEC("kprobe/"__stringify(F)) int bpf_func_##F
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1578754

FromArnaldo Carvalho de Melo <acme@redhat.com>
Date2017-02-10 20:40 +0100
Message-ID<t9pcZ-7Ix-17@gated-at.bofh.it>
In reply to#1577032
Em Wed, Feb 08, 2017 at 09:27:41PM +0100, Mickaël Salaün escreveu:
> This series brings some fixes and small improvements to the BPF samples.
> 
> This is intended for the perf tree and apply on 7a5980f9c006 ("tools lib bpf:
> Add missing header to the library").

Wang, are you ok with this series? Joe?

- Arnaldo
 
> Changes since v3:
> * remove applied patch 1/5
> * remove patch 2/5 on bpf_load_program() as requested by Wang Nan
> 
> Changes since v2:
> * add this cover letter
> 
> Changes since v1:
> * exclude patches not intended for the perf tree
> 
> Regards,
> 
> Mickaël Salaün (3):
>   samples/bpf: Ignore already processed ELF sections
>   samples/bpf: Reset global variables
>   samples/bpf: Add missing header
> 
>  samples/bpf/bpf_load.c     | 7 +++++++
>  samples/bpf/tracex5_kern.c | 1 +
>  2 files changed, 8 insertions(+)
> 
> -- 
> 2.11.0

[toc] | [prev] | [next] | [standalone]


#1578814

FromJoe Stringer <joe@ovn.org>
Date2017-02-10 22:30 +0100
Message-ID<t9qVs-nT-13@gated-at.bofh.it>
In reply to#1578754
On 10 February 2017 at 09:42, Arnaldo Carvalho de Melo <acme@redhat.com> wrote:
> Em Wed, Feb 08, 2017 at 09:27:41PM +0100, Mickaël Salaün escreveu:
>> This series brings some fixes and small improvements to the BPF samples.
>>
>> This is intended for the perf tree and apply on 7a5980f9c006 ("tools lib bpf:
>> Add missing header to the library").
>
> Wang, are you ok with this series? Joe?

The changes look good to me. I also tried tracex5 and it seems to work fine.

[toc] | [prev] | [next] | [standalone]


#1579349

From"Wangnan (F)" <wangnan0@huawei.com>
Date2017-02-13 02:50 +0100
Message-ID<tadW9-5k8-3@gated-at.bofh.it>
In reply to#1577032

On 2017/2/9 4:27, Mickaël Salaün wrote:
> This series brings some fixes and small improvements to the BPF samples.
>
> This is intended for the perf tree and apply on 7a5980f9c006 ("tools lib bpf:
> Add missing header to the library").
>
> Changes since v3:
> * remove applied patch 1/5
> * remove patch 2/5 on bpf_load_program() as requested by Wang Nan
>
> Changes since v2:
> * add this cover letter
>
> Changes since v1:
> * exclude patches not intended for the perf tree
>
> Regards,
>
> Mickaël Salaün (3):
>    samples/bpf: Ignore already processed ELF sections
>    samples/bpf: Reset global variables
>    samples/bpf: Add missing header
>
>   samples/bpf/bpf_load.c     | 7 +++++++
>   samples/bpf/tracex5_kern.c | 1 +
>   2 files changed, 8 insertions(+)
>
Looks good to me.

Thank you.

[toc] | [prev] | [next] | [standalone]


#1580060

FromArnaldo Carvalho de Melo <acme@redhat.com>
Date2017-02-13 21:30 +0100
Message-ID<tavq2-6i-11@gated-at.bofh.it>
In reply to#1579349
Em Mon, Feb 13, 2017 at 09:42:31AM +0800, Wangnan (F) escreveu:
> On 2017/2/9 4:27, Mickaël Salaün wrote:
> >Mickaël Salaün (3):
> >   samples/bpf: Ignore already processed ELF sections
> >   samples/bpf: Reset global variables
> >   samples/bpf: Add missing header
> >
> >  samples/bpf/bpf_load.c     | 7 +++++++
> >  samples/bpf/tracex5_kern.c | 1 +
> >  2 files changed, 8 insertions(+)
> >
> Looks good to me.
> 
> Thank you.

Thanks, applied, added Acked-by tags for you and Joe.

- Arnaldo

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web