Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2190774ybm; Thu, 23 May 2019 12:52:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqx2eTPQhcOXkG6CwKyz/bggsVD/o0IYhVlvELzb4+AP8b76l+tq/MGEx+G/NOeIV3eEvdZ7 X-Received: by 2002:a65:48ca:: with SMTP id o10mr100285295pgs.136.1558641132198; Thu, 23 May 2019 12:52:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558641132; cv=none; d=google.com; s=arc-20160816; b=nD0E4WAovAgVqZ+u7tfqFj7TP+zGC23f8za85ddrTqwbD/SrF1a+PCEtw4yuv3frPE 90kSxl+zAM8jPRP5+nTS4wAjTMYZPt8Qp5xbpG9TpIVyu0EHV/zIbfn5AS9/gfeiRBwm ic7GFREGGtJVT0HVDLicLKaLNuINd4skePYexoYWC5Bmi7DP4RnQyCHKvwWj9H22lZiZ 6ziEA2GcxCYtVzWCA68Uxa00PcJagfbgMHBPWMauvGXK2K+KOPD2OBLLvDtm2sEk8siq u8QwFniJsi53+KL/lGihnsaI9FENDOJcvxV3PvNRC38in9vKOrPQceAfdxNQ1ORqmnz0 /Rdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vBOva60gIDj1ukjjbN1CqHp3VXYErM/MoP3+SAQT6dU=; b=AlA0XP2yArEZGHdrwgENEuPRHZzAgBBalw9PQlHSkyu9RjQtGKR7CClUjn81KvKZxQ RbDSkROeTFLt6hbe6ALFNkP3D50WSzYTUAOAneD5iuhSWqpKQ/p/jZAOy90wONr+gFzk qiENuv9ricE6TW/M0o+vJoM0uUx/mE9AYPzn6hbt+QtgF4RKBkLnwv2UCJ6vcHrHT7iB lTp92QD5KxmOLQyJY/kM0dDkET4x4IQnrXwrBwfiyJquo1rNdD5u5tyzpeleeqvvDsL2 EwMAcUk6vQw8c5hhpx6BsR5pCCAzECW5o0AOQ7AoiwjA8XKnqumqY0KtNBKrlsmOGYF7 ejTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YFsconhv; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n6si508948pgg.213.2019.05.23.12.51.56; Thu, 23 May 2019 12:52:12 -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=@kernel.org header.s=default header.b=YFsconhv; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387853AbfEWTKc (ORCPT + 99 others); Thu, 23 May 2019 15:10:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:43820 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387840AbfEWTKa (ORCPT ); Thu, 23 May 2019 15:10:30 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3000E2133D; Thu, 23 May 2019 19:10:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558638629; bh=WfIGQv7eWebBiWA7Zns+qpoP3MKJ53BCw8ZlmGWu6GM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YFsconhvtpHMyFC+xHpTX3kzQTABFU+U/8WE4jL4sJs0OIZekdUfMEKd7zx5Lr4lW r01KMbjylUcGfBBYeqdA/4Q1QW0PljFvkwDCuBLUw+q2KMdEe20gsFFWyM578dU1FO d6euRz7g0/1mWKmgcLkVRrM+JOM8Iwg4XQ/6cJhI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Jiri Olsa , linux-snps-arc@lists.infradead.org, Namhyung Kim , Vineet Gupta , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 4.9 50/53] perf bench numa: Add define for RUSAGE_THREAD if not present Date: Thu, 23 May 2019 21:06:14 +0200 Message-Id: <20190523181718.902300881@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190523181710.981455400@linuxfoundation.org> References: <20190523181710.981455400@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit bf561d3c13423fc54daa19b5d49dc15fafdb7acc ] 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 Signed-off-by: Sasha Levin --- tools/perf/bench/numa.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c index ee9565a033f47..e58be7eeced83 100644 --- a/tools/perf/bench/numa.c +++ b/tools/perf/bench/numa.c @@ -35,6 +35,10 @@ #include #include +#ifndef RUSAGE_THREAD +# define RUSAGE_THREAD 1 +#endif + /* * Regular printout to the terminal, supressed if -q is specified: */ -- 2.20.1