From nobody Tue Nov 26 18:22:29 2024 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D836184D for ; Thu, 17 Oct 2024 00:14:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729124057; cv=none; b=MkXGbvJtfTS1dKg2gw5cZ59w+s0P5aAjCoAYRzYj970yaP4h8zn9GikMVrDnxPEfdBHhTltrj+R0S4dIsO5WQ9laTZIdPdRjH7ba2jmsthLk2PHLt5MJ9Us23OgfjPL4X+XlrOY236JL7wnBt75VGQe8BaLgnDa68P4d2vecQ54= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729124057; c=relaxed/simple; bh=zMh1r3eChZPJViKMzZCqXcyAQ/CCQmSa02OcG8ZRigk=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=JlIoukiv2NHX/Jzv3V+DzYky0d1qdiI51WbBP7fF7lolJNBCdR+ZHQSbyUd+2OSEVvg6byPW8IYezgiZwGjGDAvYvEKULz1SpZ6Az+/wTzBcpkdhMbAwg+sqEV2vjuUdt5mUqeOhD9dWFiJz4ynCJQGd1FP1GtD6Gz9LewqIt+U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=zBTDDswo; arc=none smtp.client-ip=209.85.219.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="zBTDDswo" Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-e28edea9af6so595728276.3 for ; Wed, 16 Oct 2024 17:14:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729124055; x=1729728855; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=XruooYYEp4qZm36/rBHba0zUOpJtUJVrKsk9Et8lqQs=; b=zBTDDswoVJXHnLKlSnDx7/jvuebLgDH/IoBkxNlZ5GkXK9ndEGy6zJjVfWVdWcjI6X NuCu/Hsrr1R+fIiIAdVhLPT22t+cPbdmbsWU4X35Zhk5wLVzb5L95o96dgkKLw3NQhDm MlLl8oL92J0/kgXBoXJVWduUvRXTqKjMhM32viPflN3LCbDjYdAwxiG5YL0gGosaOIeO d3idkkBhj/qBrDnEbDuQJDlTg1WkRetsRu/rWN6MBn2goySefyaDZITsk1ryPXnDWzEA 6hpgfeKn7WghHxoJ11hF59n3WbDj1Aa8Y0W/oH8LwOSAzDNjRd7xwH2D4QvYoQ5vOVr/ ZsRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729124055; x=1729728855; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XruooYYEp4qZm36/rBHba0zUOpJtUJVrKsk9Et8lqQs=; b=hwz0+i+3wYkjsMyaVdpamFW6sW5BeLki+R5duY0ZjqgIk4EwEjROPxgazzRQP0yxhI NjfsfzEPO5YDbXbi58HWgdASyKshK5CPEJbhJBXY7VghKPq3wYQRErlwe5NpALbdBcR5 BgBUT2rj/sYy1zO1zvJNI6wfhcqVHiQXZL4VDX3CKnep9rM3Ca44ljk0mESWBEtdlIT2 gFt0kAJYABZyPkHOnQeFyMXvsx/G0B7fXVJaHHuasJJrpx2xV5+WX7pPjJJgY6ay7Z5w 35JKgndt520kaCDtXhfX12e3GtPVA+diyouTOWasrjL48/ELJpnNVvFKwKayge0aUhq+ zjLQ== X-Forwarded-Encrypted: i=1; AJvYcCUBsCZoNSmFbB/YjHhrPx95iW7b7V9kuzxwO42xbC3QvM0oZJjTgkTtrSZNt6QdQ9+SqqoyHb3fsrzjKgY=@vger.kernel.org X-Gm-Message-State: AOJu0YwJ0Jiw3ut5WUD3EzCW549MQ5XlN69PwmZVOOmgNC9a73ef1Kt7 iXdM4afar2CVD3e7NjnzQVpBMLSjmIH3FzMw7WZVIE3zyssO/I+RW4iQC1P9aQUrP5ZsZV++rMT uaCl8NA== X-Google-Smtp-Source: AGHT+IEWSf9KTS25YKU/OuIukGw6sWQXoPw62GyskrXeRoMByAlrcshBkd7RuFz+z1QPDU6BnqyVlH2IKX9F X-Received: from irogers.svl.corp.google.com ([2620:15c:2c5:11:a00a:f237:9bc0:79c]) (user=irogers job=sendgmr) by 2002:a25:2e0b:0:b0:e0b:f69b:da30 with SMTP id 3f1490d57ef6-e2978571005mr6949276.9.1729124055304; Wed, 16 Oct 2024 17:14:15 -0700 (PDT) Date: Wed, 16 Oct 2024 17:13:48 -0700 In-Reply-To: <20241017001354.56973-1-irogers@google.com> Message-Id: <20241017001354.56973-6-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241017001354.56973-1-irogers@google.com> X-Mailer: git-send-email 2.47.0.105.g07ac214952-goog Subject: [PATCH v3 05/11] perf build: Combine libdw-dwarf-unwind into libdw feature tests From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Guo Ren , Paul Walmsley , Palmer Dabbelt , Albert Ou , Nick Terrell , "Masami Hiramatsu (Google)" , Changbin Du , Guilherme Amadio , Yang Jihong , Aditya Gupta , Athira Rajeev , Masahiro Yamada , Bibo Mao , Huacai Chen , Kajol Jain , Atish Patra , Shenlin Liang , Anup Patel , Oliver Upton , "Steinar H. Gunderson" , "Dr. David Alan Gilbert" , Chen Pei , Dima Kogan , Przemek Kitszel , "David S. Miller" , Alexander Lobakin , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-riscv@lists.infradead.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Support in libdw has been present for 10 years so let's simplify the build logic with a single feature test. Signed-off-by: Ian Rogers --- tools/build/Makefile.feature | 2 -- tools/build/feature/Makefile | 4 ---- tools/build/feature/test-all.c | 5 ----- tools/build/feature/test-libdw-dwarf-unwind.c | 14 -------------- tools/build/feature/test-libdw.c | 19 ++++++++++++++++++- tools/perf/Makefile.config | 8 -------- 6 files changed, 18 insertions(+), 34 deletions(-) delete mode 100644 tools/build/feature/test-libdw-dwarf-unwind.c diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature index 6025810cc346..db3695ec5f83 100644 --- a/tools/build/Makefile.feature +++ b/tools/build/Makefile.feature @@ -60,7 +60,6 @@ FEATURE_TESTS_BASIC :=3D \ reallocarray \ stackprotector-all \ timerfd \ - libdw-dwarf-unwind \ zlib \ lzma \ get_cpuid \ @@ -133,7 +132,6 @@ FEATURE_DISPLAY ?=3D \ libpython \ libcrypto \ libunwind \ - libdw-dwarf-unwind \ libcapstone \ llvm-perf \ zlib \ diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile index 7a1c028ce40b..18f8fef5e843 100644 --- a/tools/build/feature/Makefile +++ b/tools/build/feature/Makefile @@ -52,7 +52,6 @@ FILES=3D \ test-pthread-barrier.bin \ test-stackprotector-all.bin \ test-timerfd.bin \ - test-libdw-dwarf-unwind.bin \ test-libbabeltrace.bin \ test-libcapstone.bin \ test-compile-32.bin \ @@ -317,9 +316,6 @@ $(OUTPUT)test-backtrace.bin: $(OUTPUT)test-timerfd.bin: $(BUILD) =20 -$(OUTPUT)test-libdw-dwarf-unwind.bin: - $(BUILD) # -ldw provided by $(FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind) - $(OUTPUT)test-libbabeltrace.bin: $(BUILD) # -lbabeltrace provided by $(FEATURE_CHECK_LDFLAGS-libbabeltrace) =20 diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c index d60e072b6eca..863c82516433 100644 --- a/tools/build/feature/test-all.c +++ b/tools/build/feature/test-all.c @@ -98,10 +98,6 @@ # include "test-stackprotector-all.c" #undef main =20 -#define main main_test_libdw_dwarf_unwind -# include "test-libdw-dwarf-unwind.c" -#undef main - #define main main_test_zlib # include "test-zlib.c" #undef main @@ -202,7 +198,6 @@ int main(int argc, char *argv[]) main_test_numa_num_possible_cpus(); main_test_timerfd(); main_test_stackprotector_all(); - main_test_libdw_dwarf_unwind(); main_test_zlib(); main_test_pthread_attr_setaffinity_np(); main_test_pthread_barrier(); diff --git a/tools/build/feature/test-libdw-dwarf-unwind.c b/tools/build/fe= ature/test-libdw-dwarf-unwind.c deleted file mode 100644 index ed03d9505609..000000000000 --- a/tools/build/feature/test-libdw-dwarf-unwind.c +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 - -#include - -int main(void) -{ - /* - * This function is guarded via: __nonnull_attribute__ (1, 2). - * Passing '1' as arguments value. This code is never executed, - * only compiled. - */ - dwfl_thread_getframes((void *) 1, (void *) 1, NULL); - return 0; -} diff --git a/tools/build/feature/test-libdw.c b/tools/build/feature/test-li= bdw.c index 8d474bd7371b..793f4ac49514 100644 --- a/tools/build/feature/test-libdw.c +++ b/tools/build/feature/test-libdw.c @@ -1,11 +1,28 @@ // SPDX-License-Identifier: GPL-2.0 #include #include +#include #include =20 -int main(void) +int test_libdw(void) { Dwarf *dbg =3D dwarf_begin(0, DWARF_C_READ); =20 return (long)dbg; } + +int test_libdw_unwind(void) +{ + /* + * This function is guarded via: __nonnull_attribute__ (1, 2). + * Passing '1' as arguments value. This code is never executed, + * only compiled. + */ + dwfl_thread_getframes((void *) 1, (void *) 1, NULL); + return 0; +} + +int main(void) +{ + return test_libdw() + test_libdw_unwind(); +} diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index f1e24c4ae123..fa59ecce4470 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -164,8 +164,6 @@ ifeq ($(findstring -static,${LDFLAGS}),-static) endif FEATURE_CHECK_CFLAGS-libdw :=3D $(LIBDW_CFLAGS) FEATURE_CHECK_LDFLAGS-libdw :=3D $(LIBDW_LDFLAGS) $(DWARFLIBS) -FEATURE_CHECK_CFLAGS-libdw-dwarf-unwind :=3D $(LIBDW_CFLAGS) -FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind :=3D $(LIBDW_LDFLAGS) $(DWARFLIBS) FEATURE_CHECK_CFLAGS-dwarf_getlocations :=3D $(LIBDW_CFLAGS) FEATURE_CHECK_LDFLAGS-dwarf_getlocations :=3D $(LIBDW_LDFLAGS) $(DWARFLIBS) FEATURE_CHECK_CFLAGS-dwarf_getcfi :=3D $(LIBDW_CFLAGS) @@ -467,12 +465,6 @@ else endif endif else - ifndef NO_LIBDW_DWARF_UNWIND - ifneq ($(feature-libdw-dwarf-unwind),1) - NO_LIBDW_DWARF_UNWIND :=3D 1 - $(warning No libdw DWARF unwind found, Please install elfutils-dev= el/libdw-dev >=3D 0.158 and/or set LIBDW_DIR) - endif - endif ifneq ($(feature-libdw), 1) ifndef NO_LIBDW $(warning No libdw.h found or old libdw.h found or elfutils is old= er than 0.138, disables dwarf support. Please install new elfutils-devel/li= bdw-dev) --=20 2.47.0.105.g07ac214952-goog