linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Wang Nan <wangnan0@huawei.com>
Cc: paulus@samba.org, a.p.zijlstra@chello.nl, mingo@redhat.com,
	namhyung@kernel.org, jolsa@kernel.org, dsahern@gmail.com,
	daniel@iogearbox.net, brendan.d.gregg@gmail.com,
	masami.hiramatsu.pt@hitachi.com, lizefan@huawei.com,
	linux-kernel@vger.kernel.org, pi3orama@163.com
Subject: Re: [RFC PATCH v4 03/29] perf tools: Move linux/{list.h,poison.h} to tools/include
Date: Wed, 27 May 2015 10:15:12 -0300	[thread overview]
Message-ID: <20150527131512.GU17970@kernel.org> (raw)
In-Reply-To: <1432704004-171454-4-git-send-email-wangnan0@huawei.com>

Em Wed, May 27, 2015 at 05:19:38AM +0000, Wang Nan escreveu:
> This patch moves list.h from tools/perf/util/include/linux/list.h
> to tools/include/linux/list.h to enable other libraries use macros in
> it, like libbpf which will be introduced by further patches. Since
> list.h depend on poison.h, poison.h is also moved.
 
> Both file use relative path, so one '..' is removed for each header
> to make them suit for new directory.

I'll apply this, but when doing these moves, one has to worry that these
build targets continue working:

[acme@ssdandy linux]$ make help | grep perf
  perf-tar-src-pkg    - Build perf-4.1.0-rc2.tar source tarball
  perf-targz-src-pkg  - Build perf-4.1.0-rc2.tar.gz source tarball
  perf-tarbz2-src-pkg - Build perf-4.1.0-rc2.tar.bz2 source tarball
  perf-tarxz-src-pkg  - Build perf-4.1.0-rc2.tar.xz source tarball
[acme@ssdandy linux]$ 

To explain what they are for, here is how they are used:

[acme@ssdandy linux]$ ls -la *.gz
ls: cannot access *.gz: No such file or directory
[acme@ssdandy linux]$ make perf-targz-src-pkg
  TAR
[acme@ssdandy linux]$ ls -la *.gz
-rw-rw-r--. 1 acme acme 1014070 May 27 10:07 perf-4.1.0-rc2.tar.gz
[acme@ssdandy linux]$ mkdir -p /tmp/on-some-other-machine-we-do/
[acme@ssdandy linux]$ mv perf-4.1.0-rc2.tar.gz /tmp/on-some-other-machine-we-do/
[acme@ssdandy linux]$ cd /tmp/on-some-other-machine-we-do/
[acme@ssdandy on-some-other-machine-we-do]$ tar xf perf-4.1.0-rc2.tar.gz 
[acme@ssdandy on-some-other-machine-we-do]$ ls
perf-4.1.0-rc2  perf-4.1.0-rc2.tar.gz
[acme@ssdandy on-some-other-machine-we-do]$ cd perf-4.1.0-rc2/
[acme@ssdandy perf-4.1.0-rc2]$ ls
arch  HEAD  include  lib  PERF-VERSION-FILE  tools
[acme@ssdandy perf-4.1.0-rc2]$ make -C tools/perf
make: Entering directory `/tmp/on-some-other-machine-we-do/perf-4.1.0-rc2/tools/perf'
  BUILD:   Doing 'make -j8' parallel build

Auto-detecting system features:
...                         dwarf: [ on  ]
...                         glibc: [ on  ]
...                          gtk2: [ on  ]
...                      libaudit: [ on  ]
...                        libbfd: [ on  ]
...                        libelf: [ on  ]
...                       libnuma: [ on  ]
...                       libperl: [ on  ]
...                     libpython: [ on  ]
...                      libslang: [ on  ]
...                     libunwind: [ on  ]
...            libdw-dwarf-unwind: [ on  ]
...                          zlib: [ on  ]
...                          lzma: [ on  ]

  CC       util/abspath.o
  CC       arch/common.o
  CC       ui/setup.o
  CC       fs/fs.o
  CC       event-parse.o
  PERF_VERSION = 4.1.rc2.g6bbda4
  GEN      common-cmds.h
  CC       fd/array.o
  CC       ui/gtk/browser.o
In file included from /usr/include/linux/kernel.h:4:0,
                 from util/util.h:73,
                 from util/cache.h:5,
                 from util/abspath.c:1:
/usr/include/linux/sysinfo.h:8:2: error: unknown type name ‘__kernel_long_t’
  __kernel_long_t uptime;  /* Seconds since boot */
  ^
/usr/include/linux/sysinfo.h:9:2: error: unknown type name ‘__kernel_ulong_t’
  __kernel_ulong_t loads[3]; /* 1, 5, and 15 minute load averages */
  ^
/usr/include/linux/sysinfo.h:10:2: error: unknown type name ‘__kernel_ulong_t’
  __kernel_ulong_t totalram; /* Total usable main memory size */

<BIG, BIG SNIP>
                                                                                                                                                    ^
cc1: all warnings being treated as errors
make[3]: *** [ui/gtk/hists.o] Error 1
make[2]: *** [ui/gtk] Error 2
make[1]: *** [gtk-in.o] Error 2
  LD       libtraceevent-in.o
  LD       plugin_scsi-in.o
  LINK     libtraceevent.a
  LINK     plugin_scsi.so
  LD       plugin_xen-in.o
  LINK     plugin_xen.so
make: *** [all] Error 2
make: Leaving directory `/tmp/on-some-other-machine-we-do/perf-4.1.0-rc2/tools/perf'
[acme@ssdandy perf-4.1.0-rc2]$ 

========================================================================

This is because:

[acme@ssdandy perf-4.1.0-rc2]$ ls -la tools/include/linux/kernel.h
ls: cannot access tools/include/linux/kernel.h: No such file or directory

You forgot to add this file to tools/perf/MANIFEST, that which effect would
be equivalent to:

[acme@ssdandy perf-4.1.0-rc2]$ cp ~acme/git/linux/tools/include/linux/kernel.h tools/include/linux/kernel.h
[acme@ssdandy perf-4.1.0-rc2]$ make -C tools/perf
make: Entering directory `/tmp/on-some-other-machine-we-do/perf-4.1.0-rc2/tools/perf'
  BUILD:   Doing 'make -j8' parallel build
  CC       arch/common.o
  CC       util/abspath.o
  CC       ui/gtk/browser.o
  CC       util/alias.o

<SNIP>

  LD       util/scripting-engines/libperf-in.o
  LD       util/libperf-in.o
  LD       libperf-in.o
  AR       libperf.a
  LINK     perf
  LINK     libperf-gtk.so
make: Leaving directory `/tmp/on-some-other-machine-we-do/perf-4.1.0-rc2/tools/perf'
[acme@ssdandy perf-4.1.0-rc2]$
[acme@ssdandy perf-4.1.0-rc2]$ tools/perf/perf --version
perf version 4.1.rc2.g6bbda4
[acme@ssdandy perf-4.1.0-rc2]$ ls -la tools/perf/perf
-rwxrwxr-x. 1 acme acme 11495170 May 27 10:12 tools/perf/perf
[acme@ssdandy perf-4.1.0-rc2]$ strip tools/perf/perf
[acme@ssdandy perf-4.1.0-rc2]$ ls -la tools/perf/perf
-rwxrwxr-x. 1 acme acme 2441888 May 27 10:13 tools/perf/perf
[acme@ssdandy perf-4.1.0-rc2]$

========================================================================

This, BTW, would have been caught if you had run:

  make -C tools/perf build-test

One of the last tests will do this packaging and building, alerting you that
something is missing.

I am doing this for the two patches in this series that moves things to tools,

Regards,

- Arnaldo
 
> Signed-off-by: Wang Nan <wangnan0@huawei.com>
> ---
>  tools/{perf/util => }/include/linux/list.h | 6 +++---
>  tools/include/linux/poison.h               | 1 +
>  tools/perf/util/include/linux/poison.h     | 1 -
>  3 files changed, 4 insertions(+), 4 deletions(-)
>  rename tools/{perf/util => }/include/linux/list.h (90%)
>  create mode 100644 tools/include/linux/poison.h
>  delete mode 100644 tools/perf/util/include/linux/poison.h
> 
> diff --git a/tools/perf/util/include/linux/list.h b/tools/include/linux/list.h
> similarity index 90%
> rename from tools/perf/util/include/linux/list.h
> rename to tools/include/linux/list.h
> index 76ddbc7..76b014c 100644
> --- a/tools/perf/util/include/linux/list.h
> +++ b/tools/include/linux/list.h
> @@ -1,10 +1,10 @@
>  #include <linux/kernel.h>
>  #include <linux/types.h>
>  
> -#include "../../../../include/linux/list.h"
> +#include "../../../include/linux/list.h"
>  
> -#ifndef PERF_LIST_H
> -#define PERF_LIST_H
> +#ifndef TOOLS_LIST_H
> +#define TOOLS_LIST_H
>  /**
>   * list_del_range - deletes range of entries from list.
>   * @begin: first element in the range to delete from the list.
> diff --git a/tools/include/linux/poison.h b/tools/include/linux/poison.h
> new file mode 100644
> index 0000000..0c27bdf
> --- /dev/null
> +++ b/tools/include/linux/poison.h
> @@ -0,0 +1 @@
> +#include "../../../include/linux/poison.h"
> diff --git a/tools/perf/util/include/linux/poison.h b/tools/perf/util/include/linux/poison.h
> deleted file mode 100644
> index fef6dbc..0000000
> --- a/tools/perf/util/include/linux/poison.h
> +++ /dev/null
> @@ -1 +0,0 @@
> -#include "../../../../include/linux/poison.h"
> -- 
> 1.8.3.4

  reply	other threads:[~2015-05-27 13:15 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-27  5:19 [RFC PATCH v4 00/29] perf tools: filtering events using eBPF programs Wang Nan
2015-05-27  5:19 ` [RFC PATCH v4 01/29] tools: Add __aligned_u64 to types.h Wang Nan
2015-05-27 13:00   ` Arnaldo Carvalho de Melo
2015-05-28  0:28     ` Wangnan (F)
2015-05-28  0:31       ` Arnaldo Carvalho de Melo
2015-05-27  5:19 ` [RFC PATCH v4 02/29] perf tools: Move linux/kernel.h to tools/include Wang Nan
2015-05-27 13:03   ` Arnaldo Carvalho de Melo
2015-05-27  5:19 ` [RFC PATCH v4 03/29] perf tools: Move linux/{list.h,poison.h} " Wang Nan
2015-05-27 13:15   ` Arnaldo Carvalho de Melo [this message]
2015-05-27 13:21     ` Arnaldo Carvalho de Melo
2015-05-27 15:30       ` Arnaldo Carvalho de Melo
2015-05-27  5:19 ` [RFC PATCH v4 04/29] bpf tools: Introduce 'bpf' library to tools Wang Nan
2015-05-27  5:19 ` [RFC PATCH v4 05/29] bpf tools: Allow caller to set printing function Wang Nan
2015-05-29 13:35   ` Namhyung Kim
2015-05-27  5:19 ` [RFC PATCH v4 06/29] bpf tools: Open eBPF object file and do basic validation Wang Nan
2015-05-28  1:44   ` Alexei Starovoitov
2015-05-27  5:19 ` [RFC PATCH v4 07/29] bpf tools: Check endianess and make libbpf fail early Wang Nan
2015-05-28  1:45   ` Alexei Starovoitov
2015-05-27  5:19 ` [RFC PATCH v4 08/29] bpf tools: Iterate over ELF sections to collect information Wang Nan
2015-05-28  1:46   ` Alexei Starovoitov
2015-05-27  5:19 ` [RFC PATCH v4 09/29] bpf tools: Collect version and license from ELF sections Wang Nan
2015-05-28  1:48   ` Alexei Starovoitov
2015-05-28  3:34     ` Wangnan (F)
2015-05-28  5:51       ` Alexei Starovoitov
2015-05-27  5:19 ` [RFC PATCH v4 10/29] bpf tools: Collect map definitions from 'maps' section Wang Nan
2015-05-28  1:53   ` Alexei Starovoitov
2015-05-28  2:03     ` Wangnan (F)
2015-05-28  2:28       ` Alexei Starovoitov
2015-05-28  3:09         ` Wangnan (F)
2015-05-28  6:09           ` Alexei Starovoitov
2015-05-28  7:14             ` Wangnan (F)
2015-05-29  3:35               ` Alexei Starovoitov
2015-05-29  3:59                 ` Wangnan (F)
2015-06-01  2:12                 ` Namhyung Kim
2015-06-01  5:19                   ` Wangnan (F)
2015-06-01  6:03                     ` Namhyung Kim
2015-06-01 13:01                       ` Arnaldo Carvalho de Melo
2015-05-27  5:19 ` [RFC PATCH v4 11/29] bpf tools: Collect symbol table from SHT_SYMTAB section Wang Nan
2015-05-27  5:19 ` [RFC PATCH v4 12/29] bpf tools: Collect eBPF programs from their own sections Wang Nan
2015-05-27  5:19 ` [RFC PATCH v4 13/29] bpf tools: Collect relocation sections from SHT_REL sections Wang Nan
2015-05-27  5:19 ` [RFC PATCH v4 14/29] bpf tools: Record map accessing instructions for each program Wang Nan
2015-05-27  5:19 ` [RFC PATCH v4 15/29] bpf tools: Add bpf.c/h for common bpf operations Wang Nan
2015-05-28  1:55   ` Alexei Starovoitov
2015-05-29 14:44   ` Namhyung Kim
2015-05-27  5:19 ` [RFC PATCH v4 16/29] bpf tools: Create eBPF maps defined in an object file Wang Nan
2015-05-28  1:57   ` Alexei Starovoitov
2015-05-27  5:19 ` [RFC PATCH v4 17/29] bpf tools: Relocate eBPF programs Wang Nan
2015-06-01  5:32   ` Namhyung Kim
2015-06-01  6:36     ` Wangnan (F)
2015-05-27  5:19 ` [RFC PATCH v4 18/29] bpf tools: Introduce bpf_load_program() to bpf.c Wang Nan
2015-05-28  2:14   ` Alexei Starovoitov
2015-05-27  5:19 ` [RFC PATCH v4 19/29] bpf tools: Load eBPF programs in object files into kernel Wang Nan
2015-05-27  5:19 ` [RFC PATCH v4 20/29] bpf tools: Introduce accessors for struct bpf_program Wang Nan
2015-05-27  5:19 ` [RFC PATCH v4 21/29] bpf tools: Introduce accessors for struct bpf_object Wang Nan
2015-05-27  5:19 ` [RFC PATCH v4 22/29] bpf tools: Link all bpf objects onto a list Wang Nan
2015-05-27  5:19 ` [RFC PATCH v4 23/29] perf tools: Make perf depend on libbpf Wang Nan
2015-05-27  5:19 ` [RFC PATCH v4 24/29] perf record: Enable passing bpf object file to --event Wang Nan
2015-05-27  5:20 ` [RFC PATCH v4 25/29] perf tools: Parse probe points of eBPF programs during preparation Wang Nan
2015-05-27  5:20 ` [RFC PATCH v4 26/29] perf record: Probe at kprobe points Wang Nan
2015-05-27  5:20 ` [RFC PATCH v4 27/29] perf record: Load all eBPF object into kernel Wang Nan
2015-05-27  5:20 ` [RFC PATCH v4 28/29] perf tools: Add bpf_fd field to evsel and config it Wang Nan
2015-05-27  5:20 ` [RFC PATCH v4 29/29] perf tools: Attach eBPF program to perf event Wang Nan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150527131512.GU17970@kernel.org \
    --to=acme@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=brendan.d.gregg@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=dsahern@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    --cc=pi3orama@163.com \
    --cc=wangnan0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).