Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1951738pxb; Fri, 25 Mar 2022 08:31:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7XdaSMnDAkJKo/99aZSI7By2X81JvUju4/taG/Dcnrc1jZQtAt8FsEDA6Leeg8LmKBYeP X-Received: by 2002:a05:6a00:1a45:b0:4fb:1cc9:30db with SMTP id h5-20020a056a001a4500b004fb1cc930dbmr1993900pfv.10.1648222277825; Fri, 25 Mar 2022 08:31:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648222277; cv=none; d=google.com; s=arc-20160816; b=J1Dmo7BQ0A2WuUm/UvYhaA1vE06fC9BYnfAByOqG6ZehbDLpyU5n0wMXtJyYhHsOQ9 b+HTwQcoWSD0PwVJfaI6Up21D/BtlBCglQRNpX+6yXWnUaBY64GBoW5/+KiE0EFjPEEh uxyowCb0InXaRAOSkK2gB5fYvaBvm4V3l3MB7JMHtLSXllvmYhMXt054ZuKntFJxTtdy hPRxAeGdZGYCH3++Mn5Kli9TqvIfpebdzRdqevRWb8EfR0Uqg451QMBHSvTdnKutPFV9 IOtMT8aYEcBlwtrL72sSlEtOeJCLbCtP8ZbGZhtsNTZ7InXVYlEmpUY65GeEPDOOXbio PZkg== 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; bh=0PSgVM0IwE2SkRnwYPaMtK3vaKjizb+5+l2By/FC5A8=; b=hcgx8XgWBw3MO8G5b5xxNymWI4W7RcS6ApoejAjECLaCQL2Ca3E2GlmN0lRX0g/qZk hkeclCD30CRNjJMe0Rac6QPaFfHAzUzdK4rEMzRrvM5u4NVFWb35ucznOmNGUuTo064/ HkUic3AQ44/ZE/q6v1pVrsI48OaIXkIsXOgRqNC1hKfp665hLjGksY31LIkHD9p84laB Zla/VLUrg4sd/XBDsacoYUanma0VRY7inNZxG+RRhFXhrBUgQs2WZdfYLwdZdyDsH8iF tLCkci3CScTre3hDeDlDjMRRZPSMfurTcmKeYP7F8GmbWptlQNq9Tab2O/k3FX6suQWM rbuA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 17-20020a17090a191100b001bef4ea053esi5759347pjg.62.2022.03.25.08.31.03; Fri, 25 Mar 2022 08:31:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351194AbiCXPDt convert rfc822-to-8bit (ORCPT + 99 others); Thu, 24 Mar 2022 11:03:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347598AbiCXPDs (ORCPT ); Thu, 24 Mar 2022 11:03:48 -0400 Received: from us-smtp-delivery-44.mimecast.com (us-smtp-delivery-44.mimecast.com [205.139.111.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A3253A94EF for ; Thu, 24 Mar 2022 08:02:15 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-468-oj5YYOTvPUORGiha6ai_Ug-1; Thu, 24 Mar 2022 11:02:11 -0400 X-MC-Unique: oj5YYOTvPUORGiha6ai_Ug-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7516385A5BE; Thu, 24 Mar 2022 15:02:10 +0000 (UTC) Received: from x1.com (unknown [10.22.34.216]) by smtp.corp.redhat.com (Postfix) with ESMTP id 68C8A401476; Thu, 24 Mar 2022 15:02:09 +0000 (UTC) From: Daniel Bristot de Oliveira To: Steven Rostedt Cc: Daniel Bristot de Oliveira , LKML , linux-trace-devel@vger.kernel.org, Ingo Molnar , Andrew Morton , Linus Torvalds Subject: rtla/Makefile: Properly handle dependencies Date: Thu, 24 Mar 2022 16:01:52 +0100 Message-Id: <48c7167c78a330d0b25dc631ee7d6f0f34c096e9.1648132686.git.bristot@kernel.org> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=bristot@kernel.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kernel.org Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset=WINDOWS-1252; x-default=true X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no 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. Cc: Ingo Molnar Cc: Andrew Morton Reported-by: Linus Torvalds Suggested-by: Steven Rostedt Signed-off-by: Daniel Bristot de Oliveira --- tools/tracing/rtla/Makefile | 72 +++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/tools/tracing/rtla/Makefile b/tools/tracing/rtla/Makefile index 5a1eda617992..448e9073736a 100644 --- a/tools/tracing/rtla/Makefile +++ b/tools/tracing/rtla/Makefile @@ -57,6 +57,78 @@ else DOCSRC = $(SRCTREE)/../../../Documentation/tools/rtla/ endif +LIBTRACEEVENT = libtraceevent +LIBTRACEFS = libtracefs +LIBPROCPS = libprocps + +LIBTRACEEVENT_MIN_VERSION = 1.5 +LIBTRACEFS_MIN_VERSION = 1.3 +LIBPROCPS_MIN_VERSION = 3.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 + +TEST_LIBPROCPS = $(shell sh -c "$(PKG_CONFIG) --atleast-version $(LIBPROCPS_MIN_VERSION) $(LIBPROCPS) > /dev/null 2>&1 || echo n") +ifeq ("$(TEST_LIBPROCPS)", "n") +.PHONY: warning_procps +warning_procps: + @echo "********************************************" + @echo "** NOTICE: $(LIBPROCPS) version $(LIBPROCPS_MIN_VERSION) or higher not found" + @echo "**" + @echo "** Consider installing the latest procps-ng-devel from your" + @echo "** distribution, e.g., 'dnf install procps-ng-devel' on Fedora," + @echo "** or from source:" + @echo "**" + @echo "** https://gitlab.com/procps-ng/procps " + @echo "**" + @echo "********************************************" +endif + +TEST_RST2MAN = $(shell sh -c "rst2man --version > /dev/null 2>&1 || echo n") +ifeq ("$(TEST_RST2MAN)", "n") +.PHONY: warning_rst2man +warning_rst2man: + @echo "********************************************" + @echo "** NOTICE: rst2man not found" + @echo "**" + @echo "** Consider installing the latest rst2man from your" + @echo "** distribution, e.g., 'dnf install python3-docutils' on Fedora," + @echo "** or from source:" + @echo "**" + @echo "** https://docutils.sourceforge.io/docs/dev/repository.html " + @echo "**" + @echo "********************************************" +endif + .PHONY: all all: rtla -- 2.35.1