All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@eu.citrix.com>
To: Ian Campbell <ian.campbell@citrix.com>, Olaf Hering <olaf@aepfle.de>
Cc: xen-devel@lists.xen.org
Subject: Re: [PATCH v4 0/9] add xenalyze to staging
Date: Wed, 3 Jun 2015 11:33:51 +0100	[thread overview]
Message-ID: <556ED80F.5030905@eu.citrix.com> (raw)
In-Reply-To: <1433326259.7108.53.camel@citrix.com>

On 06/03/2015 11:10 AM, Ian Campbell wrote:
> On Sat, 2015-05-23 at 08:24 +0000, Olaf Hering wrote:
>> Having xenalyze in the source tree makes it much easier to keep private
>> debug code in hypervisor and xenalyze in sync. It helped alot while
>> debugging the root cause for commit 607e8494c42397fb249191904066cace6ac9a880.
> 
> I'm afraid it doesn't build on arm64.
> 
> Some of these actually look like non-arch specific failures (e.g.
> conflicts with register_t from system headers) or issues which should
> probably be addressed with xenalyze in tree (e.g. NR_CPUS ought to be
> available directly now?) or with some trivial #ifdef modifications.
> 
> That said, I don't know that xentrace actually works on ARM nor that
> xenalyze could analyse such traces even with the build issues addressed,
> so I'd be equally happy if this was just made x86 only.
> 
> In file included from /usr/aarch64-linux-gnu/include/linux/types.h:4:0,
>                  from /usr/aarch64-linux-gnu/include/asm/ptrace.h:22,
>                  from /usr/aarch64-linux-gnu/include/sys/user.h:25,
>                  from /usr/aarch64-linux-gnu/include/sys/procfs.h:34,
>                  from /usr/aarch64-linux-gnu/include/sys/ucontext.h:26,
>                  from /usr/aarch64-linux-gnu/include/signal.h:360,
>                  from /usr/aarch64-linux-gnu/include/sys/wait.h:30,
>                  from xenalyze.c:28:
> /local/scratch/ianc/devel/committer-arm64.git/tools/xentrace/../../xen/include/asm/types.h:54:13: error: conflicting types for 'register_t'
>  typedef u64 register_t;
>              ^
> In file included from /usr/aarch64-linux-gnu/include/stdlib.h:314:0,
>                  from xenalyze.c:24:
> /usr/aarch64-linux-gnu/include/sys/types.h:205:13: note: previous declaration of 'register_t' was here
>  typedef int register_t __attribute__ ((__mode__ (__word__)));
>              ^

The weird thing about this one is that register_t isn't defined or used
by xenalyze at all.

The include pedigree is a bit confusing, but it looks like
aarch64-linux-gnu/include/linux/types.h is including Xen files, and that
there's a type mismatch between Xen's xen/include/asm/types.h and the
system's include/sys/types.h.

It looks like it will happen to any program which includes both #include
both stdlib.h and sys/wait.h.  If so, this is a general problem with Xen
on ARM64, not a bug in xenalyze.

(But as I said, the #include chain is a bit confusing, so I feel free to
correct me if I got something wrong...)

> In file included from xenalyze.c:33:0:
> analyze.h:19:0: error: "NR_CPUS" redefined [-Werror]
>  #define NR_CPUS 256
>  ^
> In file included from /local/scratch/ianc/devel/committer-arm64.git/tools/xentrace/../../xen/include/xen/config.h:13:0,
>                  from /local/scratch/ianc/devel/committer-arm64.git/tools/xentrace/../../xen/include/asm/types.h:6,
>                  from /usr/aarch64-linux-gnu/include/linux/types.h:4,
>                  from /usr/aarch64-linux-gnu/include/asm/ptrace.h:22,
>                  from /usr/aarch64-linux-gnu/include/sys/user.h:25,
>                  from /usr/aarch64-linux-gnu/include/sys/procfs.h:34,
>                  from /usr/aarch64-linux-gnu/include/sys/ucontext.h:26,
>                  from /usr/aarch64-linux-gnu/include/signal.h:360,
>                  from /usr/aarch64-linux-gnu/include/sys/wait.h:30,
>                  from xenalyze.c:28:
> /local/scratch/ianc/devel/committer-arm64.git/tools/xentrace/../../xen/include/asm/config.h:47:0: note: this is the location of the previous definition
>  #define NR_CPUS 128
>  ^
> In file included from xenalyze.c:33:0:
> analyze.h:23:0: error: "BITS_PER_LONG" redefined [-Werror]
>  # define BITS_PER_LONG 32
>  ^
> In file included from /local/scratch/ianc/devel/committer-arm64.git/tools/xentrace/../../xen/include/xen/config.h:13:0,
>                  from /local/scratch/ianc/devel/committer-arm64.git/tools/xentrace/../../xen/include/asm/types.h:6,
>                  from /usr/aarch64-linux-gnu/include/linux/types.h:4,
>                  from /usr/aarch64-linux-gnu/include/asm/ptrace.h:22,
>                  from /usr/aarch64-linux-gnu/include/sys/user.h:25,
>                  from /usr/aarch64-linux-gnu/include/sys/procfs.h:34,
>                  from /usr/aarch64-linux-gnu/include/sys/ucontext.h:26,
>                  from /usr/aarch64-linux-gnu/include/signal.h:360,
>                  from /usr/aarch64-linux-gnu/include/sys/wait.h:30,
>                  from xenalyze.c:28:
> /local/scratch/ianc/devel/committer-arm64.git/tools/xentrace/../../xen/include/asm/config.h:23:0: note: this is the location of the previous definition
>  #define BITS_PER_LONG (BYTES_PER_LONG << 3)
>  ^
> aarch64-linux-gnu-gcc    -o xentrace_setsize setsize.o /local/scratch/ianc/devel/committer-arm64.git/tools/xentrace/../../tools/libxc/libxenctrl.so

If including <sys/wait.h> will reliably include the Xen headers, then we
can just remove NR_CPUS and BITS_PER_LONG from analyze.h.  In the case
of NR_CPUS it would be preferable actually, since then we wouldn't need
to worry about keeping those two in sync.

But I suspect that this is a quirk of aarm64 (or perhaps of IanC's build
environment) that won't be duplicated on x86.

 -George

  parent reply	other threads:[~2015-06-03 10:33 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-23  8:24 [PATCH v4 0/9] add xenalyze to staging Olaf Hering
2015-05-23  8:24 ` [PATCH v4 1/9] xentrace: install into sbin Olaf Hering
2015-05-25  8:33   ` Wei Liu
2015-06-02 17:03   ` George Dunlap
2015-05-23  8:24 ` [PATCH v4 2/9] xenalyze: add to tools/xentrace/ Olaf Hering
2015-05-25  8:34   ` Wei Liu
2015-06-02 17:06     ` George Dunlap
2015-05-23  8:24 ` [PATCH v4 3/9] xenalyze: increase NR_CPUS to 256 Olaf Hering
2015-05-23  8:24 ` [PATCH v4 4/9] xenalyze: print newline after unknown hvm events Olaf Hering
2015-05-23  8:24 ` [PATCH v4 5/9] xenalyze: include odd mmio states in default output Olaf Hering
2015-05-23  8:24 ` [PATCH v4 6/9] xenalyze: handle TRC_TRACE_WRAP_BUFFER Olaf Hering
2015-05-23  8:24 ` [PATCH v4 7/9] xenalyze: handle more events in sched_process Olaf Hering
2015-06-02 17:12   ` George Dunlap
2015-06-09 10:44     ` Olaf Hering
2015-05-23  8:24 ` [PATCH v4 8/9] xenalyze: remove traling whitespaces Olaf Hering
2015-05-23  8:24 ` [PATCH v4 9/9] xenalyze: remove argp_program_version Olaf Hering
2015-06-02 17:16 ` [PATCH v4 0/9] add xenalyze to staging George Dunlap
2015-06-03 10:33   ` Ian Campbell
2015-06-03 10:10 ` Ian Campbell
2015-06-03 10:15   ` Ian Campbell
2015-06-03 10:33   ` George Dunlap [this message]
2015-06-03 10:59     ` Ian Campbell
2015-06-03 11:16       ` George Dunlap
2015-06-03 11:21         ` George Dunlap
2015-06-03 11:34           ` Ian Campbell
2015-06-03 10:35   ` Julien Grall
2015-06-03 10:38     ` Andrew Cooper
2015-06-03 10:38       ` George Dunlap
2015-06-03 10:41         ` Andrew Cooper
2015-06-03 10:42           ` George Dunlap
2015-06-03 10:49     ` George Dunlap
2015-06-09 10:18     ` Olaf Hering
2015-06-09 11:31       ` Julien Grall
2015-06-09 11:38         ` George Dunlap
2015-06-09 23:21           ` Julien Grall
2015-06-15  9:23             ` George Dunlap
2015-06-15 12:44               ` Julien Grall
2015-06-15 13:46                 ` George Dunlap
2015-06-16  7:21                   ` Roger Pau Monné
2015-06-09  6:54   ` Olaf Hering
2015-06-09 11:07     ` Olaf Hering
2015-06-10 21:23       ` Julien Grall

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=556ED80F.5030905@eu.citrix.com \
    --to=george.dunlap@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=olaf@aepfle.de \
    --cc=xen-devel@lists.xen.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.