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


Groups > linux.kernel > #1368206 > unrolled thread

[PATCH 1/4] samples/bpf: Fix build breakage with map_perf_test_user.c

Started by"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
First post2016-03-31 13:30 +0200
Last post2016-03-31 21:30 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/4] samples/bpf: Fix build breakage with map_perf_test_user.c "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2016-03-31 13:30 +0200
    Re: [PATCH 1/4] samples/bpf: Fix build breakage with  map_perf_test_user.c Alexei Starovoitov <ast@fb.com> - 2016-03-31 19:50 +0200
      Re: [PATCH 1/4] samples/bpf: Fix build breakage with  map_perf_test_user.c "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2016-03-31 20:50 +0200
        Re: [PATCH 1/4] samples/bpf: Fix build breakage with  map_perf_test_user.c Alexei Starovoitov <ast@fb.com> - 2016-03-31 21:30 +0200

#1368206 — [PATCH 1/4] samples/bpf: Fix build breakage with map_perf_test_user.c

From"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Date2016-03-31 13:30 +0200
Subject[PATCH 1/4] samples/bpf: Fix build breakage with map_perf_test_user.c
Message-ID<riIXw-4as-11@gated-at.bofh.it>
Building BPF samples is failing with the below error:

samples/bpf/map_perf_test_user.c: In function ‘main’:
samples/bpf/map_perf_test_user.c:134:9: error: variable ‘r’ has
initializer but incomplete type
  struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
         ^
samples/bpf/map_perf_test_user.c:134:21: error: ‘RLIM_INFINITY’
undeclared (first use in this function)
  struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
                     ^
samples/bpf/map_perf_test_user.c:134:21: note: each undeclared
identifier is reported only once for each function it appears in
samples/bpf/map_perf_test_user.c:134:9: warning: excess elements in
struct initializer [enabled by default]
  struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
         ^
samples/bpf/map_perf_test_user.c:134:9: warning: (near initialization
for ‘r’) [enabled by default]
samples/bpf/map_perf_test_user.c:134:9: warning: excess elements in
struct initializer [enabled by default]
samples/bpf/map_perf_test_user.c:134:9: warning: (near initialization
for ‘r’) [enabled by default]
samples/bpf/map_perf_test_user.c:134:16: error: storage size of ‘r’
isn’t known
  struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
                ^
samples/bpf/map_perf_test_user.c:139:2: warning: implicit declaration of
function ‘setrlimit’ [-Wimplicit-function-declaration]
  setrlimit(RLIMIT_MEMLOCK, &r);
  ^
samples/bpf/map_perf_test_user.c:139:12: error: ‘RLIMIT_MEMLOCK’
undeclared (first use in this function)
  setrlimit(RLIMIT_MEMLOCK, &r);
            ^
samples/bpf/map_perf_test_user.c:134:16: warning: unused variable ‘r’
[-Wunused-variable]
  struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
                ^
make[2]: *** [samples/bpf/map_perf_test_user.o] Error 1

Fix this by including the necessary header file.

Cc: Alexei Starovoitov <ast@fb.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
 samples/bpf/map_perf_test_user.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/samples/bpf/map_perf_test_user.c b/samples/bpf/map_perf_test_user.c
index 95af56e..3147377 100644
--- a/samples/bpf/map_perf_test_user.c
+++ b/samples/bpf/map_perf_test_user.c
@@ -17,6 +17,7 @@
 #include <linux/bpf.h>
 #include <string.h>
 #include <time.h>
+#include <sys/resource.h>
 #include "libbpf.h"
 #include "bpf_load.h"
 
-- 
2.7.4

[toc] | [next] | [standalone]


#1368498 — Re: [PATCH 1/4] samples/bpf: Fix build breakage with map_perf_test_user.c

FromAlexei Starovoitov <ast@fb.com>
Date2016-03-31 19:50 +0200
SubjectRe: [PATCH 1/4] samples/bpf: Fix build breakage with map_perf_test_user.c
Message-ID<riOTg-6L-1@gated-at.bofh.it>
In reply to#1368206
On 3/31/16 4:25 AM, Naveen N. Rao wrote:
> Building BPF samples is failing with the below error:
>
> samples/bpf/map_perf_test_user.c: In function ‘main’:
> samples/bpf/map_perf_test_user.c:134:9: error: variable ‘r’ has
> initializer but incomplete type
>    struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
>           ^
> Fix this by including the necessary header file.
>
> Cc: Alexei Starovoitov <ast@fb.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> ---
>   samples/bpf/map_perf_test_user.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/samples/bpf/map_perf_test_user.c b/samples/bpf/map_perf_test_user.c
> index 95af56e..3147377 100644
> --- a/samples/bpf/map_perf_test_user.c
> +++ b/samples/bpf/map_perf_test_user.c
> @@ -17,6 +17,7 @@
>   #include <linux/bpf.h>
>   #include <string.h>
>   #include <time.h>
> +#include <sys/resource.h>
>   #include "libbpf.h"
>   #include "bpf_load.h"

It's failing this way on powerpc? Odd.
Such hidden header dependency was always puzzling to me. Anyway:
Acked-by: Alexei Starovoitov <ast@kernel.org>

I'm assuming you want this set to go via 'net' tree, so please resubmit
with [PATCH net 1/4] subjects and cc netdev.

Reviewing your other patches...

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


#1368542 — Re: [PATCH 1/4] samples/bpf: Fix build breakage with map_perf_test_user.c

From"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Date2016-03-31 20:50 +0200
SubjectRe: [PATCH 1/4] samples/bpf: Fix build breakage with map_perf_test_user.c
Message-ID<riPPk-IR-11@gated-at.bofh.it>
In reply to#1368498
On 2016/03/31 10:43AM, Alexei Starovoitov wrote:
> On 3/31/16 4:25 AM, Naveen N. Rao wrote:
> >Building BPF samples is failing with the below error:
> >
> >samples/bpf/map_perf_test_user.c: In function ‘main’:
> >samples/bpf/map_perf_test_user.c:134:9: error: variable ‘r’ has
> >initializer but incomplete type
> >   struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
> >          ^
> >Fix this by including the necessary header file.
> >
> >Cc: Alexei Starovoitov <ast@fb.com>
> >Cc: David S. Miller <davem@davemloft.net>
> >Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
> >Cc: Michael Ellerman <mpe@ellerman.id.au>
> >Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> >---
> >  samples/bpf/map_perf_test_user.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> >diff --git a/samples/bpf/map_perf_test_user.c b/samples/bpf/map_perf_test_user.c
> >index 95af56e..3147377 100644
> >--- a/samples/bpf/map_perf_test_user.c
> >+++ b/samples/bpf/map_perf_test_user.c
> >@@ -17,6 +17,7 @@
> >  #include <linux/bpf.h>
> >  #include <string.h>
> >  #include <time.h>
> >+#include <sys/resource.h>
> >  #include "libbpf.h"
> >  #include "bpf_load.h"
> 
> It's failing this way on powerpc? Odd.

This fails for me on x86_64 too -- RHEL 7.1.

> Such hidden header dependency was always puzzling to me. Anyway:
> Acked-by: Alexei Starovoitov <ast@kernel.org>
> 
> I'm assuming you want this set to go via 'net' tree, so please resubmit
> with [PATCH net 1/4] subjects and cc netdev.

Sure.

> 
> Reviewing your other patches...

Thanks for your review!

- Naveen

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


#1368567 — Re: [PATCH 1/4] samples/bpf: Fix build breakage with map_perf_test_user.c

FromAlexei Starovoitov <ast@fb.com>
Date2016-03-31 21:30 +0200
SubjectRe: [PATCH 1/4] samples/bpf: Fix build breakage with map_perf_test_user.c
Message-ID<riQs1-1gf-3@gated-at.bofh.it>
In reply to#1368542
On 3/31/16 11:46 AM, Naveen N. Rao wrote:
>> It's failing this way on powerpc? Odd.
> This fails for me on x86_64 too -- RHEL 7.1.

indeed. fails on centos 7.1, whereas centos 6.7 is fine.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web