From patchwork Thu Oct 17 00:13:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13839134 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7DA34D2F7D8 for ; Thu, 17 Oct 2024 00:37:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:To:From:Subject :References:Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Tad0E7gcGFVieZCra5vDET9AmRJVsC8ZllrVS3JLUH0=; b=XcQJ6G3yf4NZC8r1R9AEV3TeWu y/s4Wd8vSVKDmMxId6Fbru5/sCxJxviamuTkt6/nvedjpr64UyA1Rsa4fN48HXhklSCXQ41YPqleT 4bBw9u0fF6/mUS++3H8fjxaM13IxFLDu+6lXYFF8Xn8OLX9B80GwcWLvCmN7xSWOLZHcp3Ya5Q/Y6 MjatXatH5wOiawTcr9UmAFKbabEev1gaoicPahvxsAFXOQB3ioETLJufEUnmGeCsH3OCxuVXdK3xO O6cJeYytYfcwUoDozG9FvdbhRz1Nf7xvWM5BM1Wz1HlBsVap4eYWrVZpD7LQnvEbLWvRnV3DzFAAx iOgPHU6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1EVm-0000000DMuu-2oxC; Thu, 17 Oct 2024 00:37:06 +0000 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1E9l-0000000DIGL-1Frj for linux-arm-kernel@lists.infradead.org; Thu, 17 Oct 2024 00:14:22 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-e290222fde4so519681276.1 for ; Wed, 16 Oct 2024 17:14:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729124060; x=1729728860; darn=lists.infradead.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=QtW2CkpQv3IBf0FmlCtJYLVB34c6lrKtCogQLdiP/zfu8Y7eSVnSSYPxmphBoCQ3Aa NFAPRioefSW5sQLJnhhPlXIArXOvio4uiZ2VMzzuO/siqT2gUiXWa0R8JNkwj5AObhbX U2Fq1hCjyg6258MKHDLs5eCb4zJIjXHStoTABLgbAbmZxECC9KjRGkCNbXVhPwcBlwsX vrNLGWa2HaV9T7GY6ZirrZiASjfFJ25ejbkbNHkplSMp3NwC61CiukBSocIoj/PzEDFm 4uNYMDKhz2G7jNUqfBK2fRxTojOvaVxc5widIKCfudyft51bIDNebcMvYVZqMJiymBJX v+cA== 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=uQfPOFfkZScgHd7zIFIQRDCtYhi3wcG9DXTN/8xx+lzVavbzWaSQ8keeYpenG+11RQ KNMXUsLYb1BggM3UO3FcY2RaFOSw0kXmqtnLyEkHyHY8VysIT4TaOJ53Lya7wEnwa7UM BtSQpAAOUumODBKOjFYCcw3MFKrbD3pP3voY2FR9WfOGA4+O6En/HrmvoSam57iX/slk Ut3AMg1BoO+ba86psB6GyIK4RiXafsSF3afTIdVPk5/BTmZGZ4KSI4O3eG6P0lUp2jvK giNTavdxtIQB5yYBUSd4YvZzHolYwpVnID0qO5Fjxabtonc3QNOLmOdxU4HfgXN4FR3W H/Ig== X-Forwarded-Encrypted: i=1; AJvYcCXQp2hSXR3dNvoFiD9wC2sWzgUMSVjccVBha4Hx0M8ZMVpOrgqsQkYhvyZDfW852lacpsyQPy8f4ZjrEZD/bPV7@lists.infradead.org X-Gm-Message-State: AOJu0YyadFcVWj4p3JVRgGa2gW8ukTPXKiG61zvuii5FoKOPJJ2iD33N iie69jin/EJUUbkWBauWspf/mZ30n3iwbdX3/+2v4EAQwJgUtHlEL5kkTFXQQRjRrkayvk4dlQh nBic1fQ== 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> 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241016_171421_368823_EBAAA844 X-CRM114-Status: GOOD ( 15.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 := \ 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= \ 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) -$(OUTPUT)test-dwarf_getcfi.bin: - $(BUILD) $(DWLIBS) - $(OUTPUT)test-libelf-getphdrnum.bin: $(BUILD) -lelf 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 = NULL; - return dwarf_getcfi(dwarf) == NULL; -} diff --git a/tools/build/feature/test-libdw.c b/tools/build/feature/test-libdw.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); } +int test_libdw_getcfi(void) +{ + Dwarf *dwarf = NULL; + + return dwarf_getcfi(dwarf) == 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 := $(LIBDW_CFLAGS) FEATURE_CHECK_LDFLAGS-libdw := $(LIBDW_LDFLAGS) $(DWARFLIBS) -FEATURE_CHECK_CFLAGS-dwarf_getcfi := $(LIBDW_CFLAGS) -FEATURE_CHECK_LDFLAGS-dwarf_getcfi := $(LIBDW_LDFLAGS) $(DWARFLIBS) # for linking with debug library, run like: # make DEBUG=1 LIBBABELTRACE_DIR=/opt/libbabeltrace/ @@ -470,11 +468,7 @@ else endif else CFLAGS += -DHAVE_DWARF_GETLOCATIONS_SUPPORT - ifneq ($(feature-dwarf_getcfi), 1) - $(warning Old libdw.h, finding variables at given 'perf probe' point will not work, install elfutils-devel/libdw-dev >= 0.142) - else - CFLAGS += -DHAVE_DWARF_CFI_SUPPORT - endif # dwarf_getcfi + CFLAGS += -DHAVE_DWARF_CFI_SUPPORT endif # Dwarf support endif # libelf support endif # NO_LIBELF