From nobody Mon Apr 13 12:10:19 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7608C00140 for ; Wed, 10 Aug 2022 15:39:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230440AbiHJPjT (ORCPT ); Wed, 10 Aug 2022 11:39:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230050AbiHJPjQ (ORCPT ); Wed, 10 Aug 2022 11:39:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C55F82D1F5 for ; Wed, 10 Aug 2022 08:39:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6D23B60B98 for ; Wed, 10 Aug 2022 15:39:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 460C6C433D6; Wed, 10 Aug 2022 15:39:14 +0000 (UTC) Date: Wed, 10 Aug 2022 11:39:18 -0400 From: Steven Rostedt To: LKML Cc: Linus Torvalds , Daniel Bristot de Oliveira Subject: [PATCH] rtla: Consolidate and show all necessary libraries that failed for building Message-ID: <20220810113918.5d19ce59@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: "Steven Rostedt (Google)" When building rtla tools, if the necessary libraries are not installed (libtraceevent and libtracefs), show the ones that are missing in one consolidated output, and also show how to install them (at least for Fedora). Link: https://lore.kernel.org/all/CAHk-=3Dwh+e1qcCnEYJ3JRDVLNCYbJ=3D0u+Ts5b= OYZnY3mX_k-hFA@mail.gmail.com/ Suggested-by: Linus Torvalds Signed-off-by: Steven Rostedt (Google) --- tools/tracing/rtla/Makefile | 62 +++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 26 deletions(-) diff --git a/tools/tracing/rtla/Makefile b/tools/tracing/rtla/Makefile index 3822f4ea5f49..09ed1de3685f 100644 --- a/tools/tracing/rtla/Makefile +++ b/tools/tracing/rtla/Makefile @@ -61,40 +61,50 @@ endif LIBTRACEEVENT_MIN_VERSION =3D 1.5 LIBTRACEFS_MIN_VERSION =3D 1.3 =20 +.PHONY: all warnings show_warnings +all: warnings rtla + TEST_LIBTRACEEVENT =3D $(shell sh -c "$(PKG_CONFIG) --atleast-version $(LI= BTRACEEVENT_MIN_VERSION) libtraceevent > /dev/null 2>&1 || echo n") ifeq ("$(TEST_LIBTRACEEVENT)", "n") -.PHONY: warning_traceevent -warning_traceevent: - @echo "********************************************" - @echo "** NOTICE: libtraceevent version $(LIBTRACEEVENT_MIN_VERSION) or h= igher not found" - @echo "**" - @echo "** Consider installing the latest libtraceevent from your" - @echo "** distribution, e.g., 'dnf install libtraceevent' on Fedora," - @echo "** or from source:" - @echo "**" - @echo "** https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git= / " - @echo "**" - @echo "********************************************" +WARNINGS =3D show_warnings +MISSING_LIBS +=3D echo "** libtraceevent version $(LIBTRACEEVENT_MIN_VER= SION) or higher"; +MISSING_PACKAGES +=3D "libtraceevent-devel" +MISSING_SOURCE +=3D echo "** https://git.kernel.org/pub/scm/libs/libtrace= /libtraceevent.git/ "; endif =20 TEST_LIBTRACEFS =3D $(shell sh -c "$(PKG_CONFIG) --atleast-version $(LIBTR= ACEFS_MIN_VERSION) libtracefs > /dev/null 2>&1 || echo n") ifeq ("$(TEST_LIBTRACEFS)", "n") -.PHONY: warning_tracefs -warning_tracefs: - @echo "********************************************" - @echo "** NOTICE: libtracefs version $(LIBTRACEFS_MIN_VERSION) or higher = not found" - @echo "**" - @echo "** Consider installing the latest libtracefs from your" - @echo "** distribution, e.g., 'dnf install libtracefs' on Fedora," - @echo "** or from source:" - @echo "**" - @echo "** https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/ " - @echo "**" - @echo "********************************************" +WARNINGS =3D show_warnings +MISSING_LIBS +=3D echo "** libtracefs version $(LIBTRACEFS_MIN_VERSION) = or higher"; +MISSING_PACKAGES +=3D "libtracefs-devel" +MISSING_SOURCE +=3D echo "** https://git.kernel.org/pub/scm/libs/libtrace= /libtracefs.git/ "; endif =20 -.PHONY: all -all: rtla +define show_dependencies + @echo "********************************************"; \ + echo "** NOTICE: Failed build dependencies"; \ + echo "**"; \ + echo "** Required Libraries:"; \ + $(MISSING_LIBS) \ + echo "**"; \ + echo "** Consider installing the latest libtracefs from your"; \ + echo "** distribution, e.g., 'dnf install $(MISSING_PACKAGES)' on Fedora,= "; \ + echo "** or from source:"; \ + echo "**"; \ + $(MISSING_SOURCE) \ + echo "**"; \ + echo "********************************************" +endef + +show_warnings: + $(call show_dependencies); + +ifneq ("$(WARNINGS)", "") +ERROR_OUT =3D $(error Please add the necessary dependencies) + +warnings: $(WARNINGS) + $(ERROR_OUT) +endif =20 rtla: $(OBJ) $(CC) -o rtla $(LDFLAGS) $(OBJ) $(LIBS) --=20 2.35.1