Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp218662iob; Mon, 2 May 2022 17:33:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxBJ/eSWcDYYOkZ/a7CkNl4kSPYPH70PMsFqkeFpFo3oUFu+sKK59ymRzZ/S/4XunSuU5j X-Received: by 2002:a65:6942:0:b0:378:9365:5963 with SMTP id w2-20020a656942000000b0037893655963mr11711770pgq.142.1651538005075; Mon, 02 May 2022 17:33:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651538005; cv=none; d=google.com; s=arc-20160816; b=e9d4YWNo0ZgTzkdZoQAaLqTf0Pa+6O2CYvajsj193Q6L8OqGtENniAtv5KfrEWZRVD rKedxyfitqFnpLTqh3vZa/QgrZBI3jesoSL2ZlPrrwh16VsnpIWP7zw53JNCzZP+kXkr S4yQXF6KG1T3WizZDPC+yWG9Sr5Qm4z3cgIGa5XnVE4dDLdpnxHlnPCR2OfHSZwvJP67 zLGVjpqp3FhhHC2oORr8HMMAKK+4W8XPO0a6YTVXJ/4s19565+AgVpSFN53dSc9oP86X g8kuSjCga94IhFWYUtVLxGRCSDm53QwyQ68RfC7my4KSoFl0oD4NlhEgTV0uOEBbveGN vGpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=/NfMs4zaYXS1RQEV/5W0KntONK9Zul3qX6zWOJRuKsE=; b=zHPK0Fn41AI97HzQksWJSS8CVPwTscoUpIATnWBico0+qkgleNOl2ZIA8olDAnPdlu pklEs1AwHB487v12v1Ps9N7tJXs6xhzNTC/ZzziDjxG79dPDtDMBaZVcShOGTBtqg3Dh QEFeCxGaAPtZ+GpWa9qR9vhHo0BSt1dRjdMHBm7OZR14rzEoCiht07wnQ7SInu+apH5I 1zefkffSv7usD7Hy832c+lkwacplNcdAMiJcTHgJhckAprwPoha3ae4pdynWny2MmM7T TSlbDvFZd05cKiV+RJ6627YiAHSWKdKrZULvWqnPaTP07eUCJ53Fvax3RnIpqNhdOlrW 9bsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QvmrisA4; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id f23-20020a631017000000b003982527600dsi7229034pgl.185.2022.05.02.17.33.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 17:33:25 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QvmrisA4; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 13B683B004; Mon, 2 May 2022 17:26:27 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378052AbiD2O62 (ORCPT + 99 others); Fri, 29 Apr 2022 10:58:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378028AbiD2O6Z (ORCPT ); Fri, 29 Apr 2022 10:58:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91BD3A5EAF; Fri, 29 Apr 2022 07:55:05 -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 ams.source.kernel.org (Postfix) with ESMTPS id 45598B835DC; Fri, 29 Apr 2022 14:55:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A847C385A7; Fri, 29 Apr 2022 14:55:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651244103; bh=StvpXoSDdgUWBmP2aTfHIXRYUBtGjxZb/ppRSI+ZPlQ=; h=From:To:Cc:Subject:Date:From; b=QvmrisA4D/9rSSggUM531BwjHs35gIyMgQEEdTwY6+gknhM1qZsdOXYLVRGVX7lHd xYiSut7dxWJ7R/5vyi5XdzyVd3NLTD8WmXb5vyQdYTrIcYR9xRfGDxVLnmxRJWcuzh VLM0sdX/g4k589vV1oZk1Y3KHURj9MGQb7Cgm3FdyMqAnyFCGgadxuZgt5ZutQMSR/ KdIH5LPKJKqCNb4FjaBAnBpze3tsianbVG91B1Fp1VazEnpR60y0EAPpFZWV0y10ki 0YN/9GBznrzn/mm0T2Dem5uiixEFi3Wwas+jMRxmaUdOm0ErJm4xz62nvEf6FLwVZ8 ui9qBVuCr22Sg== From: Daniel Bristot de Oliveira To: Steven Rostedt , linux-trace-devel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Daniel Bristot de Oliveira , Ingo Molnar , Andrew Morton , Linus Torvalds Subject: [PATCH V2] rtla/Makefile: Properly handle dependencies Date: Fri, 29 Apr 2022 16:54:58 +0200 Message-Id: <3f1fac776c37e4b67c876a94e5a0e45ed022ff3d.1651238057.git.bristot@kernel.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Linus had a problem compiling RTLA, saying: "[...] I wish the tracing tools would do a bit more package checking and helpful error messages too, rather than just fail with: fatal error: tracefs.h: No such file or directory" Which is indeed not a helpful message. Update the Makefile, adding proper checks for the dependencies, with useful information about how to resolve possible problems. For example, the previous error is now reported as: $ make ******************************************** ** NOTICE: libtracefs version 1.3 or higher not found ** ** Consider installing the latest libtracefs from your ** distribution, e.g., 'dnf install libtracefs' on Fedora, ** or from source: ** ** https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/ ** ******************************************** These messages are inspired by the ones used on trace-cmd, as suggested by Stevel Rostedt. Link: https://lore.kernel.org/r/CAHk-=whxmA86E=csNv76DuxX_wYsg8mW15oUs3XTabu2Yc80yw@mail.gmail.com/ Changes from V1: - Moved the rst2man check to the install phase (when it is used). - Removed the procps-ng lib check [1] as it is being removed. [1] a0f9f8c1030c66305c9b921057c3d483064d5529.1651220820.git.bristot@kernel.org Cc: Ingo Molnar Cc: Andrew Morton Reported-by: Linus Torvalds Suggested-by: Steven Rostedt Signed-off-by: Daniel Bristot de Oliveira --- Documentation/tools/rtla/Makefile | 14 ++++++++++++- tools/tracing/rtla/Makefile | 35 +++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/Documentation/tools/rtla/Makefile b/Documentation/tools/rtla/Makefile index 9f2b84af1a6c..093af6d7a0e9 100644 --- a/Documentation/tools/rtla/Makefile +++ b/Documentation/tools/rtla/Makefile @@ -17,9 +17,21 @@ DOC_MAN1 = $(addprefix $(OUTPUT),$(_DOC_MAN1)) RST2MAN_DEP := $(shell command -v rst2man 2>/dev/null) RST2MAN_OPTS += --verbose +TEST_RST2MAN = $(shell sh -c "rst2man --version > /dev/null 2>&1 || echo n") + $(OUTPUT)%.1: %.rst ifndef RST2MAN_DEP - $(error "rst2man not found, but required to generate man pages") + $(info ********************************************) + $(info ** NOTICE: rst2man not found) + $(info **) + $(info ** Consider installing the latest rst2man from your) + $(info ** distribution, e.g., 'dnf install python3-docutils' on Fedora,) + $(info ** or from source:) + $(info **) + $(info ** https://docutils.sourceforge.io/docs/dev/repository.html ) + $(info **) + $(info ********************************************) + $(error NOTICE: rst2man required to generate man pages) endif rst2man $(RST2MAN_OPTS) $< > $@ diff --git a/tools/tracing/rtla/Makefile b/tools/tracing/rtla/Makefile index 523f0a8c38c2..3822f4ea5f49 100644 --- a/tools/tracing/rtla/Makefile +++ b/tools/tracing/rtla/Makefile @@ -58,6 +58,41 @@ else DOCSRC = $(SRCTREE)/../../../Documentation/tools/rtla/ endif +LIBTRACEEVENT_MIN_VERSION = 1.5 +LIBTRACEFS_MIN_VERSION = 1.3 + +TEST_LIBTRACEEVENT = $(shell sh -c "$(PKG_CONFIG) --atleast-version $(LIBTRACEEVENT_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 higher 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 "********************************************" +endif + +TEST_LIBTRACEFS = $(shell sh -c "$(PKG_CONFIG) --atleast-version $(LIBTRACEFS_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 "********************************************" +endif + .PHONY: all all: rtla -- 2.32.0