On Fri, Feb 14, 2020 at 05:26:39PM -0500, Peter Xu wrote: > On Fri, Feb 14, 2020 at 03:59:07PM +0100, Andrew Jones wrote: > > This series has several parts: > > > > * First, a hack to get x86 to compile. The missing __NR_userfaultfd > > define should be fixed a better way. > > Yeh otherwise I think it will only compile on x86_64. The opposite for me. I could compile on AArch64 without this hack, but on x86 (my Fedora 30 laptop) I could not. > > My gut feeling is we've got an artificial unistd_{32|64}.h under tools > that is included rather than the real one that we should include > (which should locate under $LINUX_ROOT/usr/include/asm/). Below patch > worked for me, but I'm not 100% sure whether I fixed all the current > users of that artifact header just in case I'll break some (what I saw > is only this evsel.c and another setns.c, while that setns.c has > syscall.h included correct so it seems fine): Yeah, there's something strange about it because I saw the definition in the tools includes. Thanks, drew > > diff --git a/tools/arch/x86/include/asm/unistd_32.h b/tools/arch/x86/include/asm/unistd_32.h > deleted file mode 100644 > index 60a89dba01b6..000000000000 > --- a/tools/arch/x86/include/asm/unistd_32.h > +++ /dev/null > @@ -1,16 +0,0 @@ > -/* SPDX-License-Identifier: GPL-2.0 */ > -#ifndef __NR_perf_event_open > -# define __NR_perf_event_open 336 > -#endif > -#ifndef __NR_futex > -# define __NR_futex 240 > -#endif > -#ifndef __NR_gettid > -# define __NR_gettid 224 > -#endif > -#ifndef __NR_getcpu > -# define __NR_getcpu 318 > -#endif > -#ifndef __NR_setns > -# define __NR_setns 346 > -#endif > diff --git a/tools/arch/x86/include/asm/unistd_64.h b/tools/arch/x86/include/asm/unistd_64.h > deleted file mode 100644 > index cb52a3a8b8fc..000000000000 > --- a/tools/arch/x86/include/asm/unistd_64.h > +++ /dev/null > @@ -1,16 +0,0 @@ > -/* SPDX-License-Identifier: GPL-2.0 */ > -#ifndef __NR_perf_event_open > -# define __NR_perf_event_open 298 > -#endif > -#ifndef __NR_futex > -# define __NR_futex 202 > -#endif > -#ifndef __NR_gettid > -# define __NR_gettid 186 > -#endif > -#ifndef __NR_getcpu > -# define __NR_getcpu 309 > -#endif > -#ifndef __NR_setns > -#define __NR_setns 308 > -#endif > diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c > index a69e64236120..f4075392dcb6 100644 > --- a/tools/perf/util/evsel.c > +++ b/tools/perf/util/evsel.c > @@ -21,6 +21,7 @@ > #include <sys/ioctl.h> > #include <sys/resource.h> > #include <sys/types.h> > +#include <sys/syscall.h> > #include <dirent.h> > #include <stdlib.h> > #include <perf/evsel.h> > > -- > Peter Xu >