linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sample/bpf: Make perf_event_read() static
@ 2016-12-15 15:29 Arnaldo Carvalho de Melo
  2016-12-15 15:49 ` Daniel Borkmann
  2016-12-20 19:28 ` [tip:perf/urgent] samples/bpf: " tip-bot for Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-15 15:29 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: Daniel Borkmann, Wang Nan, Joe Stringer, Linux Kernel Mailing List


While testing Joe's conversion of samples/bpf/ to use tools/lib/bpf/ I
noticed some warnings, do you guys mind if I put patches like the one
below in my tree, pushing to Ingo soon?

Or is there anything subtle against doing so?


----

While building samples/bpf/ on a Fedora Rawhide container, with
clang/llvm 3.9 I noticed this:

root@1e797fdfbf4f linux]# make -j4 O=/tmp/build/linux/ samples/bpf/
make[1]: Entering directory '/tmp/build/linux'
  CHK     include/config/kernel.release
  GEN     ./Makefile
  CHK     include/generated/uapi/linux/version.h
  Using /git/linux as source for kernel
<SNIP>
  HOSTCC  samples/bpf/trace_output_user.o
/git/linux/samples/bpf/trace_output_user.c:64:6: warning: no previous
prototype for 'perf_event_read' [-Wmissing-prototypes]
 void perf_event_read(print_fn fn)
      ^~~~~~~~~~~~~~~
  HOSTLD  samples/bpf/trace_output
make[1]: Leaving directory '/tmp/build/linux'

Shutup the compiler by setting that function as static.

Cc: Alexei Starovoitov <ast@fb.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Wang Nan <wangnan0@huawei.com>,
Cc: Joe Stringer <joe@ovn.org>
Link: http://lkml.kernel.org/n/tip-2wkr4ymwhdie0stbkbiyplt5@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

--

diff --git a/samples/bpf/trace_output_user.c b/samples/bpf/trace_output_user.c
index 3bedd945def1..1a1da7bddb93 100644
--- a/samples/bpf/trace_output_user.c
+++ b/samples/bpf/trace_output_user.c
@@ -61,7 +61,7 @@ struct perf_event_sample {
 	char data[];
 };
 
-void perf_event_read(print_fn fn)
+static void perf_event_read(print_fn fn)
 {
 	__u64 data_tail = header->data_tail;
 	__u64 data_head = header->data_head;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] sample/bpf: Make perf_event_read() static
  2016-12-15 15:29 [PATCH] sample/bpf: Make perf_event_read() static Arnaldo Carvalho de Melo
@ 2016-12-15 15:49 ` Daniel Borkmann
  2016-12-15 15:54   ` Arnaldo Carvalho de Melo
  2016-12-20 19:28 ` [tip:perf/urgent] samples/bpf: " tip-bot for Arnaldo Carvalho de Melo
  1 sibling, 1 reply; 4+ messages in thread
From: Daniel Borkmann @ 2016-12-15 15:49 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Alexei Starovoitov
  Cc: Wang Nan, Joe Stringer, Linux Kernel Mailing List

On 12/15/2016 04:29 PM, Arnaldo Carvalho de Melo wrote:
>
> While testing Joe's conversion of samples/bpf/ to use tools/lib/bpf/ I
> noticed some warnings, do you guys mind if I put patches like the one
> below in my tree, pushing to Ingo soon?
>
> Or is there anything subtle against doing so?

Fwiw, no objections from my side, there is currently nothing in
net/net-next tree that could cause conflicts regarding the below
change, so should be good to take this route instead.

> ----
>
> While building samples/bpf/ on a Fedora Rawhide container, with
> clang/llvm 3.9 I noticed this:
>
> root@1e797fdfbf4f linux]# make -j4 O=/tmp/build/linux/ samples/bpf/
> make[1]: Entering directory '/tmp/build/linux'
>    CHK     include/config/kernel.release
>    GEN     ./Makefile
>    CHK     include/generated/uapi/linux/version.h
>    Using /git/linux as source for kernel
> <SNIP>
>    HOSTCC  samples/bpf/trace_output_user.o
> /git/linux/samples/bpf/trace_output_user.c:64:6: warning: no previous
> prototype for 'perf_event_read' [-Wmissing-prototypes]
>   void perf_event_read(print_fn fn)
>        ^~~~~~~~~~~~~~~
>    HOSTLD  samples/bpf/trace_output
> make[1]: Leaving directory '/tmp/build/linux'
>
> Shutup the compiler by setting that function as static.
>
> Cc: Alexei Starovoitov <ast@fb.com>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> Cc: Wang Nan <wangnan0@huawei.com>,
> Cc: Joe Stringer <joe@ovn.org>
> Link: http://lkml.kernel.org/n/tip-2wkr4ymwhdie0stbkbiyplt5@git.kernel.org
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Acked-by: Daniel Borkmann <daniel@iogearbox.net>

Thanks,
Daniel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] sample/bpf: Make perf_event_read() static
  2016-12-15 15:49 ` Daniel Borkmann
@ 2016-12-15 15:54   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-12-15 15:54 UTC (permalink / raw)
  To: Daniel Borkmann
  Cc: Alexei Starovoitov, Wang Nan, Joe Stringer, Linux Kernel Mailing List

Em Thu, Dec 15, 2016 at 04:49:07PM +0100, Daniel Borkmann escreveu:
> On 12/15/2016 04:29 PM, Arnaldo Carvalho de Melo wrote:
> > 
> > While testing Joe's conversion of samples/bpf/ to use tools/lib/bpf/ I
> > noticed some warnings, do you guys mind if I put patches like the one
> > below in my tree, pushing to Ingo soon?
> > 
> > Or is there anything subtle against doing so?
> 
> Fwiw, no objections from my side, there is currently nothing in
> net/net-next tree that could cause conflicts regarding the below
> change, so should be good to take this route instead.

Thanks a lot! 

Ah, since it seems the overhead of having clang/llvm/bc/findutils in
addition to what I have in the containers for distros with suitable
packages is small, I'll probably end up building samples/bpf/ in those
containers, in addition to building perf with/without libelf and
objtool.

This way I'll catch build problems everytime I prepare my pull reqs to
Ingo and hopefully fix them then.

- Arnaldo
 
> > ----
> > 
> > While building samples/bpf/ on a Fedora Rawhide container, with
> > clang/llvm 3.9 I noticed this:
> > 
> > root@1e797fdfbf4f linux]# make -j4 O=/tmp/build/linux/ samples/bpf/
> > make[1]: Entering directory '/tmp/build/linux'
> >    CHK     include/config/kernel.release
> >    GEN     ./Makefile
> >    CHK     include/generated/uapi/linux/version.h
> >    Using /git/linux as source for kernel
> > <SNIP>
> >    HOSTCC  samples/bpf/trace_output_user.o
> > /git/linux/samples/bpf/trace_output_user.c:64:6: warning: no previous
> > prototype for 'perf_event_read' [-Wmissing-prototypes]
> >   void perf_event_read(print_fn fn)
> >        ^~~~~~~~~~~~~~~
> >    HOSTLD  samples/bpf/trace_output
> > make[1]: Leaving directory '/tmp/build/linux'
> > 
> > Shutup the compiler by setting that function as static.
> > 
> > Cc: Alexei Starovoitov <ast@fb.com>
> > Cc: Daniel Borkmann <daniel@iogearbox.net>
> > Cc: Wang Nan <wangnan0@huawei.com>,
> > Cc: Joe Stringer <joe@ovn.org>
> > Link: http://lkml.kernel.org/n/tip-2wkr4ymwhdie0stbkbiyplt5@git.kernel.org
> > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> Acked-by: Daniel Borkmann <daniel@iogearbox.net>
> 
> Thanks,
> Daniel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [tip:perf/urgent] samples/bpf: Make perf_event_read() static
  2016-12-15 15:29 [PATCH] sample/bpf: Make perf_event_read() static Arnaldo Carvalho de Melo
  2016-12-15 15:49 ` Daniel Borkmann
@ 2016-12-20 19:28 ` tip-bot for Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Arnaldo Carvalho de Melo @ 2016-12-20 19:28 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: arnaldo.melo, hpa, acme, daniel, tglx, ast, mingo, wangnan0, joe,
	linux-kernel

Commit-ID:  96c2fb69b92fcf6006dfb3017d6d887f8321407b
Gitweb:     http://git.kernel.org/tip/96c2fb69b92fcf6006dfb3017d6d887f8321407b
Author:     Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
AuthorDate: Thu, 15 Dec 2016 12:29:27 -0300
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 20 Dec 2016 09:37:33 -0300

samples/bpf: Make perf_event_read() static

While testing Joe's conversion of samples/bpf/ to use tools/lib/bpf/ I noticed
some warnings building samples/bpf/ on a Fedora Rawhide container, with
clang/llvm 3.9 I noticed this:

  [root@1e797fdfbf4f linux]# make -j4 O=/tmp/build/linux/ samples/bpf/
  make[1]: Entering directory '/tmp/build/linux'
    CHK     include/config/kernel.release
    GEN     ./Makefile
    CHK     include/generated/uapi/linux/version.h
    Using /git/linux as source for kernel
  <SNIP>
    HOSTCC  samples/bpf/trace_output_user.o
  /git/linux/samples/bpf/trace_output_user.c:64:6: warning: no previous
  prototype for 'perf_event_read' [-Wmissing-prototypes]
   void perf_event_read(print_fn fn)
        ^~~~~~~~~~~~~~~
    HOSTLD  samples/bpf/trace_output
  make[1]: Leaving directory '/tmp/build/linux'

Shut up the compiler by making that function static.

Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Joe Stringer <joe@ovn.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20161215152927.GC6866@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 samples/bpf/trace_output_user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/samples/bpf/trace_output_user.c b/samples/bpf/trace_output_user.c
index 3bedd94..1a1da7b 100644
--- a/samples/bpf/trace_output_user.c
+++ b/samples/bpf/trace_output_user.c
@@ -61,7 +61,7 @@ struct perf_event_sample {
 	char data[];
 };
 
-void perf_event_read(print_fn fn)
+static void perf_event_read(print_fn fn)
 {
 	__u64 data_tail = header->data_tail;
 	__u64 data_head = header->data_head;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-12-20 19:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-15 15:29 [PATCH] sample/bpf: Make perf_event_read() static Arnaldo Carvalho de Melo
2016-12-15 15:49 ` Daniel Borkmann
2016-12-15 15:54   ` Arnaldo Carvalho de Melo
2016-12-20 19:28 ` [tip:perf/urgent] samples/bpf: " tip-bot for Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).