From nobody Tue Nov 26 17:18:01 2024 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (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 2BB6F538A for ; Thu, 17 Oct 2024 00:14:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729124062; cv=none; b=ZBZQJSekv14P8aesK+V+3rFs1zB3bapfzcja2IKODB3j4rhMi5xtSjADzjcWDMAg+KSbQj0YcbzfNRNOjAfB/KhnCtGyZ9r+yH1Xv2BNTS0ty3QzMbswHvxfl/sKWCRdP+wCzmaOyF6tHlJhnHkKBm4W/pf1wSLepXA+fPML7ew= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729124062; c=relaxed/simple; bh=P0Gp28BkMYlC/A7gXQDsJFdIHzwBEhHd5H8cstYec9E=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=d5fUce7n6p/fgO9O7fzW4cXa+UODTTLri7rtnwS2xglWtKkx3aBTgTONVo9/rJbsOGXsJl76A+wGMgq5TTKQ0Oh0wtvRbgAZ+90eHQYX5IDCwv39APbrMlnd7ERLCmySMlSdoLN8pFaH65HEC9AUImAvAjypQ5xxty7sfdV9M+o= 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=RcCveLKS; arc=none smtp.client-ip=209.85.219.202 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="RcCveLKS" Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-e28edea9af6so595811276.3 for ; Wed, 16 Oct 2024 17:14:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729124060; x=1729728860; 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=Tad0E7gcGFVieZCra5vDET9AmRJVsC8ZllrVS3JLUH0=; b=RcCveLKS+p5TDdzfYCp6NC8DtwV2A2S4w1uvXboxEy9HshglDB7YuGXGYBPlZoSutM 5gc/Q+D4XikKNRfVo1IYs+eL5V3PEq8aw0upxB03GNAL9reA5//uDusJUCvAbeUWeT4L n/4JXoDchwHFL5F+UVW4uoqA54I8vB7WqcD+CJZXNDRDf4tjaMmRY7q7iQ+/GVPmKVPI IrlFeSvlF5ptfr+8XUUW7zttx+w+0/6Ncn3EIGoZQUvcZ4WNz/mrbXfS+cXwJkfFYzMp HNUfKOV7rDpA2PEeqmCY32vDkGQ2UAqEVwj6fthjojSr1kb2YnOZ7HB51WdsGrkv09Ku QFEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729124060; x=1729728860; 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=Tad0E7gcGFVieZCra5vDET9AmRJVsC8ZllrVS3JLUH0=; b=FzP7V/91DwtPesdCuJCRXZFSYfSo7kMZForEbkTJRzVu2O6K1wKBzLP8r5JZXbQxmC IucHI/cvYRysXXauX9f8VvTC+2Io/xwnXE8ftPhVuTJRBl0CnVjpctwLup1QBLHVwK0/ tSRSGtTQF9Is1aTkt8lT8AEPrnBv8DnqdAJTrW3uufaq7pBu9gavSxDC3seYyH7VwR5K FoOEFGhx0Z9ULBUg0ZRAyiH4OERleaiM6dOVg0jvgzU5rQTm4FsxqzWUqHqPdby0LfSm mIlhYqy1/HdTD/2rwyI2BT+6R21Q6+nGTYPzRsKkVp06tljkPBo+gl0D3kZPkZ51etuF 9EiQ== X-Forwarded-Encrypted: i=1; AJvYcCULt5Ccm1Wt3tr5NOj2HbEkpESAtPpWGtq0Z9xP3jr5060GFf5LDeYfyzrFDdCPhDIAnhQgkl8QJugWRrs=@vger.kernel.org X-Gm-Message-State: AOJu0YxlhFpvr7tYzCzRYM6W9qUa8tBHKRu/6NnrRmPHAk1sJQPQ9q9I HtrVru8WNowG1N5xBybtm03NMcy3jNNoaz+LL/Je6guSB2bu+smid72yPvtDfDG39ay6FqGcc/z XmNopXg== X-Google-Smtp-Source: AGHT+IGePwSgVpWBgHdlZAEHvgtdZU4v9XTpwRgCq9JMZeuOMFSyMOIR6zQOqhOB1mh8mXpAaT7pdZ4G4iD7 X-Received: from irogers.svl.corp.google.com ([2620:15c:2c5:11:a00a:f237:9bc0:79c]) (user=irogers job=sendgmr) by 2002:a25:dc4e:0:b0:e28:f231:1aa8 with SMTP id 3f1490d57ef6-e29782bbb03mr7701276.2.1729124060026; Wed, 16 Oct 2024 17:14:20 -0700 (PDT) Date: Wed, 16 Oct 2024 17:13:50 -0700 In-Reply-To: <20241017001354.56973-1-irogers@google.com> Message-Id: <20241017001354.56973-8-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 07/11] perf build: Combine test-dwarf-getcfi into test-libdw 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" dwarf_getcfi support in libdw is 15 years old. Make libdw imply dwarf_getcfi support and simplify build logic. Signed-off-by: Ian Rogers --- tools/build/Makefile.feature | 1 - tools/build/feature/Makefile | 4 ---- tools/build/feature/test-dwarf_getcfi.c | 9 --------- tools/build/feature/test-libdw.c | 10 +++++++++- tools/perf/Makefile.config | 8 +------- 5 files changed, 10 insertions(+), 22 deletions(-) delete mode 100644 tools/build/feature/test-dwarf_getcfi.c diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature index cf6a967575ea..ef72aae3dd49 100644 --- a/tools/build/Makefile.feature +++ b/tools/build/Makefile.feature @@ -31,7 +31,6 @@ endef FEATURE_TESTS_BASIC :=3D \ backtrace \ libdw \ - dwarf_getcfi \ eventfd \ fortify-source \ get_current_dir_name \ diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile index 0af3e0255fed..d28ad7672a27 100644 --- a/tools/build/feature/Makefile +++ b/tools/build/feature/Makefile @@ -6,7 +6,6 @@ FILES=3D \ test-backtrace.bin \ test-bionic.bin \ test-libdw.bin \ - test-dwarf_getcfi.bin \ test-eventfd.bin \ test-fortify-source.bin \ test-get_current_dir_name.bin \ @@ -187,9 +186,6 @@ endif $(OUTPUT)test-libdw.bin: $(BUILD) $(DWLIBS) =20 -$(OUTPUT)test-dwarf_getcfi.bin: - $(BUILD) $(DWLIBS) - $(OUTPUT)test-libelf-getphdrnum.bin: $(BUILD) -lelf =20 diff --git a/tools/build/feature/test-dwarf_getcfi.c b/tools/build/feature/= test-dwarf_getcfi.c deleted file mode 100644 index 50e7d7cb7bdf..000000000000 --- a/tools/build/feature/test-dwarf_getcfi.c +++ /dev/null @@ -1,9 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include -#include - -int main(void) -{ - Dwarf *dwarf =3D NULL; - return dwarf_getcfi(dwarf) =3D=3D NULL; -} diff --git a/tools/build/feature/test-libdw.c b/tools/build/feature/test-li= bdw.c index 83ea5d5f235d..71c6f8e3b0ee 100644 --- a/tools/build/feature/test-libdw.c +++ b/tools/build/feature/test-libdw.c @@ -34,7 +34,15 @@ int test_libdw_getlocations(void) return (int)dwarf_getlocations(&attr, offset, &base, &start, &end, &op, &= nops); } =20 +int test_libdw_getcfi(void) +{ + Dwarf *dwarf =3D NULL; + + return dwarf_getcfi(dwarf) =3D=3D NULL; +} + int main(void) { - return test_libdw() + test_libdw_unwind() + test_libdw_getlocations(); + return test_libdw() + test_libdw_unwind() + test_libdw_getlocations() + + test_libdw_getcfi(); } diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index fefa779041a0..6378811f2568 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-dwarf_getcfi :=3D $(LIBDW_CFLAGS) -FEATURE_CHECK_LDFLAGS-dwarf_getcfi :=3D $(LIBDW_LDFLAGS) $(DWARFLIBS) =20 # for linking with debug library, run like: # make DEBUG=3D1 LIBBABELTRACE_DIR=3D/opt/libbabeltrace/ @@ -470,11 +468,7 @@ else endif else CFLAGS +=3D -DHAVE_DWARF_GETLOCATIONS_SUPPORT - ifneq ($(feature-dwarf_getcfi), 1) - $(warning Old libdw.h, finding variables at given 'perf probe' poi= nt will not work, install elfutils-devel/libdw-dev >=3D 0.142) - else - CFLAGS +=3D -DHAVE_DWARF_CFI_SUPPORT - endif # dwarf_getcfi + CFLAGS +=3D -DHAVE_DWARF_CFI_SUPPORT endif # Dwarf support endif # libelf support endif # NO_LIBELF --=20 2.47.0.105.g07ac214952-goog