Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2399773yba; Thu, 25 Apr 2019 16:04:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzwOJ3l25NLEez004PgCVB1E3OXhGAujURRYDhPm9hxNFOv7qZNDN7WPAORUv7WI0focCXg X-Received: by 2002:a62:12c9:: with SMTP id 70mr42429432pfs.156.1556233473169; Thu, 25 Apr 2019 16:04:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556233473; cv=none; d=google.com; s=arc-20160816; b=dR6ZmCFpeT93IJmVVihIy0FmcqZ/SiDOvn3mVbE4vHZ4e9SdpEcChXdbDHmkeJDZUp 2fwi61CRAHRkAh/CLphUe32w9V4TqnoqfAP8VgGk57BnkgRPgpuprfr6GHqMs1yLAb9l nh0cMNHgOC7YMDKU791QoD94zJyy1zZP4QVM9m5VtZA4Agwd9F7M1G3OsgL6iuY/uLLL tw1A+WENYG8viowuwt/Pj6mmfk0WRdyVV35SBE2wvf+jjvE6PCKM9qcOiDu1SwKO53Ct phCVySy8fyGEEVBE8EXIebCu9adKnw4pthXW/gbqqPu6vpdjTytdvN95/sOVKdb4rWHv Hqrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:date:from:dkim-signature; bh=q1UpAOGNswqr3kYSiN13ewFvLBQm8M5rhSdV/SDeygY=; b=U+W29iM/+DvtMrKY0ksPER3nU1syBjDX6+AZM9pNWEyEg2VdnhSae2Y5+Amsy6JtPw lsh8NQbfvrPRPrt319M4cngMHXKWLuKR0B8api1VOFhT1yXlGqxX4vNajceJdKhiGgY3 ax0S21t7GDd0zTWpk7jEtCzcqmw9+YTnc44eCwjYB9wSP5RgGfW/BZI4mov46dtse66U gZYqm3Phf45kgRJpG0Ph7yikHFw5mwJC+EPTUgBETvrpFNLYOZitHtU6PheFilZyUwV3 FcAEDN1iqUETfdggb9bXX10ai/KHATJnZYh/cpDb1b4KmFpxqJZDsCztDWhuvg3C6OON ZUow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dg3BQ9Lr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h26si22433886pgl.21.2019.04.25.16.04.15; Thu, 25 Apr 2019 16:04:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dg3BQ9Lr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730876AbfDYVsF (ORCPT + 99 others); Thu, 25 Apr 2019 17:48:05 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:46144 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726150AbfDYVsF (ORCPT ); Thu, 25 Apr 2019 17:48:05 -0400 Received: by mail-qk1-f195.google.com with SMTP id w73so692480qkb.13; Thu, 25 Apr 2019 14:48:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=q1UpAOGNswqr3kYSiN13ewFvLBQm8M5rhSdV/SDeygY=; b=dg3BQ9Lr3YoqH156Ic4NQaKXEOj3/enSHApawne7TKih6Z3aa0++m2vJ0sv3gwpQIv rW1WF77W737/Vb2UhebotaIjQCnx7mUk/NlHrnyjbUQjod/qAizZlqneqCp9VxsbqytN 0epgn/arYDIHD2kIWkO/EqZpFpYeUCMAUSFAZjI7bKRndZAKyqhIBtOPw5L8r1dg1klD o95+AFvDa4Bd/qtX2JsXxP9ELyVGnXn5BaEGiI3Q/rUtGHgaaleXXwDrWfsw4jCQfjZq iCQ5FDfNKcz/ukoIABIBZDPo1bcR7CZ5ssYXohRjzUyY1kDUdyMabKgNjep6NHqBChPW sEsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=q1UpAOGNswqr3kYSiN13ewFvLBQm8M5rhSdV/SDeygY=; b=Uo6t16M4hH4NqGiLXp59tEdiTro+DVhuJ2KFHZ0zaNHNds9sfhYgkTWiWEBSGfqy1e FkXYm49NIArpywzfZ3FqZbvTB64xHRisNdK6C3k2Tl1wWs2Is27B+RPpd3lT+PXfBj/l 4Qj9b0jfLRDG1sEFf/L43B0VXnoOZzi7n07v83bKjXe4o6GGqc83MzcbLP779ucYFWXt d0NUk1sh8Q2udESCOCozMYfHvhLtguQ6U10PVVa6EEY6QZl/CackI9H293i2ZbTD3c7+ 7oScjsdIumqGCNB470mQtVDrxDW5MENBZw88XKFlSobmDT48/3CXFEamYMUvrTRnalSo E6pw== X-Gm-Message-State: APjAAAU+r3v/ghfNArPIzJVZyJUp8QANKFEHadKVRwdB59uTIh6U7MVX cdcY729R6ZHkXJst2u1amhk= X-Received: by 2002:a37:8544:: with SMTP id h65mr18615045qkd.84.1556228883914; Thu, 25 Apr 2019 14:48:03 -0700 (PDT) Received: from quaco.ghostprotocols.net ([179.97.35.11]) by smtp.gmail.com with ESMTPSA id b7sm236685qtt.43.2019.04.25.14.48.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2019 14:48:02 -0700 (PDT) From: Arnaldo Carvalho de Melo X-Google-Original-From: Arnaldo Carvalho de Melo Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 8E9114111F; Thu, 25 Apr 2019 18:48:00 -0300 (-03) Date: Thu, 25 Apr 2019 18:48:00 -0300 To: Vineet Gupta Cc: "linux-perf-users@vger.kernel.org" , Arnaldo Carvalho de Melo , lkml , arcml , Arnd Bergmann , Jiri Olsa , Namhyung Kim Subject: Re: perf tools build broken after v5.1-rc1 Message-ID: <20190425214800.GC21829@kernel.org> References: <20190422152027.GB11750@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190422152027.GB11750@kernel.org> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Mon, Apr 22, 2019 at 12:20:27PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Fri, Apr 19, 2019 at 04:32:58PM -0700, Vineet Gupta escreveu: > > When building perf for ARC (v5.1-rc2) I get the following > > > | In file included from bench/futex-hash.c:26: > > | bench/futex.h: In function 'futex_wait': > > | bench/futex.h:37:10: error: 'SYS_futex' undeclared (first use in this function); > > > git bisect led to 1a787fc5ba18ac767e635c58d06a0b46876184e3 ("tools headers uapi: > > Sync copy of asm-generic/unistd.h with the kernel sources") > > Humm, I have to check why this: > > [perfbuilder@quaco ~]$ podman images | grep ARC > docker.io/acmel/linux-perf-tools-build-fedora 24-x-ARC-uClibc 4c259582a8e6 5 weeks ago 846 MB > [perfbuilder@quaco ~]$ > > isn't catching this... :-\ > > FROM docker.io/fedora:24 > MAINTAINER Arnaldo Carvalho de Melo > ENV TOOLCHAIN=arc_gnu_2017.09-rc2_prebuilt_uclibc_le_arc700_linux_install > ENV CROSS=arc-linux- > ENV SOURCEFILE=${TOOLCHAIN}.tar.gz > RUN dnf -y install make flex bison binutils gcc wget tar bzip2 bc findutils xz > RUN wget https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases/download/arc-2017.09-rc2/${SOURCEFILE} > > COPY rx_and_build.sh / > ENV EXTRA_MAKE_ARGS=NO_LIBBPF=1 > ENV ARCH=arc > ENV CROSS_COMPILE=/${TOOLCHAIN}/bin/${CROSS} > ENV EXTRA_CFLAGS=-matomic So, now I have a libnuma crossbuilt in this container that allows me to build a ARC perf binary linked with zlib and numactl-devel, but only after I applied the fix below. Can you please provide the feature detection header in the build? I.e. what I have with my ARC cross build container right now, after applying the patch below is: [perfbuilder@60d5802468f6 perf]$ make $EXTRA_MAKE_ARGS ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE EXTRA_CFLAGS="$EXTRA_CFLAGS" -C /git/perf/tools/perf O=/tmp/build/perf make: Entering directory '/git/perf/tools/perf' BUILD: Doing 'make -j8' parallel build sh: line 0: command: -c: invalid option command: usage: command [-pVv] command [arg ...] Auto-detecting system features: ... dwarf: [ OFF ] ... dwarf_getlocations: [ OFF ] ... glibc: [ on ] ... gtk2: [ OFF ] ... libaudit: [ OFF ] ... libbfd: [ OFF ] ... libelf: [ OFF ] ... libnuma: [ on ] ... numa_num_possible_cpus: [ on ] ... libperl: [ OFF ] ... libpython: [ OFF ] ... libslang: [ OFF ] ... libcrypto: [ OFF ] ... libunwind: [ OFF ] ... libdw-dwarf-unwind: [ OFF ] ... zlib: [ OFF ] ... lzma: [ OFF ] ... get_cpuid: [ OFF ] ... bpf: [ on ] ... libaio: [ OFF ] ... disassembler-four-args: [ OFF ] Makefile.config:339: No libelf found. Disables 'probe' tool, jvmti and BPF support in 'perf record'. Please install libelf-dev, libelf-devel or elfutils-libelf-devel Makefile.config:473: No sys/sdt.h found, no SDT events are defined, please install systemtap-sdt-devel or systemtap-sdt-dev Makefile.config:548: Disabling post unwind, no support found. Makefile.config:601: No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev Makefile.config:613: No libcrypto.h found, disables jitted code injection, please install openssl-devel or libssl-dev Makefile.config:628: slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev Makefile.config:642: GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev Makefile.config:669: Missing perl devel files. Disabling perl scripting support, please install perl-ExtUtils-Embed/libperl-dev Makefile.config:696: No python interpreter was found: disables Python support - please install python-devel/python-dev Makefile.config:785: No liblzma found, disables xz kernel module decompression, please install xz-devel/liblzma-dev Makefile.config:853: No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev make: Leaving directory '/git/perf/tools/perf' [perfbuilder@60d5802468f6 perf]$ export declare -x ARCH="arc" declare -x CROSS="arc-linux-" declare -x CROSS_COMPILE="/arc_gnu_2019.03-rc1_prebuilt_uclibc_le_archs_linux_install/bin/arc-linux-" declare -x DISTTAG="f30container" declare -x EXTRA_CFLAGS="-matomic" declare -x EXTRA_MAKE_ARGS="NO_LIBBPF=1" declare -x FBR="f30" declare -x FGC="f30" declare -x NUMACTL_SOURCEFILE="github.com-numactl-numactl-archive-master-2019-04-25.zip" declare -x PATH="/home/perfbuilder/.local/bin:/home/perfbuilder/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" declare -x SOURCEFILE="arc_gnu_2019.03-rc1_prebuilt_uclibc_le_archs_linux_install.tar.gz" declare -x TOOLCHAIN="arc_gnu_2019.03-rc1_prebuilt_uclibc_le_archs_linux_install" declare -x container="podman" [perfbuilder@60d5802468f6 perf]$ commit dd617baf28925cf72fce309232ad9178452e75ab Author: Arnaldo Carvalho de Melo Date: Thu Apr 25 18:36:51 2019 -0300 perf bench numa: Add define for RUSAGE_THREAD if not present While cross building perf to the ARC architecture on a fedora 30 host, we were failing with: CC /tmp/build/perf/bench/numa.o bench/numa.c: In function ‘worker_thread’: bench/numa.c:1261:12: error: ‘RUSAGE_THREAD’ undeclared (first use in this function); did you mean ‘SIGEV_THREAD’? getrusage(RUSAGE_THREAD, &rusage); ^~~~~~~~~~~~~ SIGEV_THREAD bench/numa.c:1261:12: note: each undeclared identifier is reported only once for each function it appears in [perfbuilder@60d5802468f6 perf]$ /arc_gnu_2019.03-rc1_prebuilt_uclibc_le_archs_linux_install/bin/arc-linux-gcc --version | head -1 arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225 [perfbuilder@60d5802468f6 perf]$ Trying to reproduce a report by Vineet, I noticed that, with just cross-built zlib and numactl libraries, I ended up with the above failure. So, since RUSAGE_THREAD is available as a define, check for that and numactl libraries, I ended up with the above failure. So, since RUSAGE_THREAD is available as a define in the system headers, check if it is defined in the 'perf bench numa' sources and define it if not. Now it builds and I have to figure out if the problem reported by Vineet only takes place if we have libelf or some other library available. Cc: Arnd Bergmann Cc: Jiri Olsa Cc: linux-snps-arc@lists.infradead.org Cc: Namhyung Kim Cc: Vineet Gupta Link: https://lkml.kernel.org/n/tip-2wb4r1gir9xrevbpq7qp0amk@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c index 98ad783efc69..a7784554a80d 100644 --- a/tools/perf/bench/numa.c +++ b/tools/perf/bench/numa.c @@ -39,6 +39,10 @@ #include #include +#ifndef RUSAGE_THREAD +# define RUSAGE_THREAD 1 +#endif + /* * Regular printout to the terminal, supressed if -q is specified: */