Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5462791ybp; Mon, 14 Oct 2019 23:14:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqyFXR0o4CC4oDTpr2xWO5Ku+1jVRDrglnK1EcDivfvE3Cp1aqNNSdziJzbtFIK3qQmjT4FR X-Received: by 2002:a17:906:704:: with SMTP id y4mr32305428ejb.259.1571120062003; Mon, 14 Oct 2019 23:14:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571120061; cv=none; d=google.com; s=arc-20160816; b=G4oQFvyMv4yKk8j/E5prUXAr/D4pf9uUiB/qnvM1YqaP37ikbiXFDdrsYwQGYH/M8/ 9RwqvUdfBpYCrlnQwoykZqXh4DWFNkX5Ht6ybSSl5b4YCJSForuno5/KgRU3OJwqMY+s LVqvQpXjAwBaZJviWVc29isSyKjexm/LQboYzRZnAS/ykXfljS1b4B4ntvOVsjj7q5bZ HnSonGO7TGGMaTxR7cgPCg3MUby4R6ix2FpAyeCgL7jmsLOc25fQkUdeGu1Agxzspluz 2IJQtGBN+EsbFe4IuS+GAy70pUbY/NEQwcZOYHorfvzTR0ziESBSeC6ZlAm0TBbOZu+p qb5w== 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 :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=+XFblZnYGh7tP+5z4/eg0Vv0WjCWu58UlEAc3qgJWBA=; b=xazj4T03znIKwXyscj0lSxLnlHGi+VdLfAUFzRvtKzZEsfEyYoWHZm2b9eMYWe2Fwl 1j0B1wpFtR5AIwYrSoX6oItx0Ut4bt9e17pnDDYQME1f/VaL8fuk9DJkEo5LL8IBLJxJ q0b0Me9+Fiplln/Aq8O3vPRkVatpO+sSq7wWR0lxp7+V0+JDWDsICQWRX2/A9MeRrTUX w+ZPjUuOmywLr9MyM55WdDmVWyYsNeoLKkIQXORBXrJD+wBBOSAPQLAfzQejUrgwfawU QGKmTTKznEv4zAgLb/pjO0aS602mBIg/6hpHuRnmhpoITfb3HzQw1TzyLID83aZZJxeY F1Mg== ARC-Authentication-Results: i=1; mx.google.com; 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 d58si13047355eda.62.2019.10.14.23.13.58; Mon, 14 Oct 2019 23:14:21 -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; 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 S1726884AbfJOFee (ORCPT + 99 others); Tue, 15 Oct 2019 01:34:34 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:42120 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728540AbfJOFcI (ORCPT ); Tue, 15 Oct 2019 01:32:08 -0400 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iKFQl-0008Rx-Gz; Tue, 15 Oct 2019 07:31:35 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 134D41C03AB; Tue, 15 Oct 2019 07:31:35 +0200 (CEST) Date: Tue, 15 Oct 2019 05:31:34 -0000 From: "tip-bot2 for Jiri Olsa" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] perf tools: Propagate CFLAGS to libperf Cc: Andi Kleen , Jiri Olsa , Alexander Shishkin , Michael Petlan , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo , Ingo Molnar , Borislav Petkov , linux-kernel@vger.kernel.org In-Reply-To: <20191011122155.15738-1-jolsa@kernel.org> References: <20191011122155.15738-1-jolsa@kernel.org> MIME-Version: 1.0 Message-ID: <157111749498.12254.4769233203292412993.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the perf/core branch of tip: Commit-ID: 55542113c690a567e728e40d4181d7d037fc21b0 Gitweb: https://git.kernel.org/tip/55542113c690a567e728e40d4181d7d037fc21b0 Author: Jiri Olsa AuthorDate: Fri, 11 Oct 2019 14:21:55 +02:00 Committer: Arnaldo Carvalho de Melo CommitterDate: Fri, 11 Oct 2019 10:55:22 -03:00 perf tools: Propagate CFLAGS to libperf Andi reported that 'make DEBUG=1' does not propagate to the libbperf code. It's true also for the other flags. Changing the code to propagate the global build flags to libperf compilation. Reported-by: Andi Kleen Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20191011122155.15738-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/Makefile.config | 28 +++++++++++++++------------- tools/perf/Makefile.perf | 2 +- tools/perf/lib/core.c | 3 ++- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 46f7fba..063202c 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -188,7 +188,7 @@ endif # Treat warnings as errors unless directed not to ifneq ($(WERROR),0) - CFLAGS += -Werror + CORE_CFLAGS += -Werror CXXFLAGS += -Werror endif @@ -198,9 +198,9 @@ endif ifeq ($(DEBUG),0) ifeq ($(CC_NO_CLANG), 0) - CFLAGS += -O3 + CORE_CFLAGS += -O3 else - CFLAGS += -O6 + CORE_CFLAGS += -O6 endif endif @@ -245,12 +245,12 @@ FEATURE_CHECK_LDFLAGS-libaio = -lrt FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl -CFLAGS += -fno-omit-frame-pointer -CFLAGS += -ggdb3 -CFLAGS += -funwind-tables -CFLAGS += -Wall -CFLAGS += -Wextra -CFLAGS += -std=gnu99 +CORE_CFLAGS += -fno-omit-frame-pointer +CORE_CFLAGS += -ggdb3 +CORE_CFLAGS += -funwind-tables +CORE_CFLAGS += -Wall +CORE_CFLAGS += -Wextra +CORE_CFLAGS += -std=gnu99 CXXFLAGS += -std=gnu++11 -fno-exceptions -fno-rtti CXXFLAGS += -Wall @@ -272,12 +272,12 @@ include $(FEATURES_DUMP) endif ifeq ($(feature-stackprotector-all), 1) - CFLAGS += -fstack-protector-all + CORE_CFLAGS += -fstack-protector-all endif ifeq ($(DEBUG),0) ifeq ($(feature-fortify-source), 1) - CFLAGS += -D_FORTIFY_SOURCE=2 + CORE_CFLAGS += -D_FORTIFY_SOURCE=2 endif endif @@ -301,10 +301,12 @@ INC_FLAGS += -I$(src-perf)/util INC_FLAGS += -I$(src-perf) INC_FLAGS += -I$(srctree)/tools/lib/ -CFLAGS += $(INC_FLAGS) +CORE_CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE + +CFLAGS += $(CORE_CFLAGS) $(INC_FLAGS) CXXFLAGS += $(INC_FLAGS) -CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE +LIBPERF_CFLAGS := $(CORE_CFLAGS) $(EXTRA_CFLAGS) ifeq ($(feature-sync-compare-and-swap), 1) CFLAGS += -DHAVE_SYNC_COMPARE_AND_SWAP_SUPPORT diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 45c14dc..a099a8a 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -769,7 +769,7 @@ $(LIBBPF)-clean: $(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) clean >/dev/null $(LIBPERF): FORCE - $(Q)$(MAKE) -C $(LIBPERF_DIR) O=$(OUTPUT) $(OUTPUT)libperf.a + $(Q)$(MAKE) -C $(LIBPERF_DIR) EXTRA_CFLAGS="$(LIBPERF_CFLAGS)" O=$(OUTPUT) $(OUTPUT)libperf.a $(LIBPERF)-clean: $(call QUIET_CLEAN, libperf) diff --git a/tools/perf/lib/core.c b/tools/perf/lib/core.c index d0b9ae4..58fc894 100644 --- a/tools/perf/lib/core.c +++ b/tools/perf/lib/core.c @@ -5,11 +5,12 @@ #include #include #include +#include #include #include #include "internal.h" -static int __base_pr(enum libperf_print_level level, const char *format, +static int __base_pr(enum libperf_print_level level __maybe_unused, const char *format, va_list args) { return vfprintf(stderr, format, args);