Commit 3034b48a authored by Ian Rogers's avatar Ian Rogers Committed by Namhyung Kim
Browse files

perf build: Combine libdw-dwarf-unwind into libdw feature tests



Support in libdw has been present for 10 years so let's simplify the
build logic with a single feature test.

Signed-off-by: default avatarIan Rogers <irogers@google.com>
Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
Tested-by: default avatarLeo Yan <leo.yan@arm.com>
Cc: Anup Patel <anup@brainfault.org>
Cc: Yang Jihong <yangjihong@bytedance.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Shenlin Liang <liangshenlin@eswincomputing.com>
Cc: Nick Terrell <terrelln@fb.com>
Cc: Guilherme Amadio <amadio@gentoo.org>
Cc: Steinar H. Gunderson <sesse@google.com>
Cc: Changbin Du <changbin.du@huawei.com>
Cc: Alexander Lobakin <aleksander.lobakin@intel.com>
Cc: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Guo Ren <guoren@kernel.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Cc: Will Deacon <will@kernel.org>
Cc: James Clark <james.clark@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Chen Pei <cp0613@linux.alibaba.com>
Cc: Leo Yan <leo.yan@linux.dev>
Cc: Oliver Upton <oliver.upton@linux.dev>
Cc: Aditya Gupta <adityag@linux.ibm.com>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-riscv@lists.infradead.org
Cc: Bibo Mao <maobibo@loongson.cn>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Atish Patra <atishp@rivosinc.com>
Cc: Dima Kogan <dima@secretsauce.net>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Dr. David Alan Gilbert <linux@treblig.org>
Cc: linux-csky@vger.kernel.org
Link: https://lore.kernel.org/r/20241017001354.56973-6-irogers@google.com


Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
parent 7c943261
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -60,7 +60,6 @@ FEATURE_TESTS_BASIC := \
        reallocarray                    \
        stackprotector-all              \
        timerfd                         \
        libdw-dwarf-unwind              \
        zlib                            \
        lzma                            \
        get_cpuid                       \
@@ -133,7 +132,6 @@ FEATURE_DISPLAY ?= \
         libpython              \
         libcrypto              \
         libunwind              \
         libdw-dwarf-unwind     \
         libcapstone            \
         llvm-perf              \
         zlib                   \
+0 −4
Original line number Diff line number Diff line
@@ -52,7 +52,6 @@ FILES= \
         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)

$(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)

+0 −5
Original line number Diff line number Diff line
@@ -98,10 +98,6 @@
# include "test-stackprotector-all.c"
#undef main

#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();
+0 −14
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0

#include <elfutils/libdwfl.h>

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;
}
+18 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
#include <dwarf.h>
#include <elfutils/libdw.h>
#include <elfutils/libdwfl.h>
#include <elfutils/version.h>

int main(void)
int test_libdw(void)
{
	Dwarf *dbg = dwarf_begin(0, DWARF_C_READ);

	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();
}
Loading