From patchwork Fri Apr 23 17:26:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asaf Kahlon X-Patchwork-Id: 1469726 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=a19iRXVH; dkim-atps=neutral Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FRh5y6L1Wz9sCD for ; Sat, 24 Apr 2021 03:26:14 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id AB8F884425; Fri, 23 Apr 2021 17:26:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gcUEoLVClJOX; Fri, 23 Apr 2021 17:26:11 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 0D6878434A; Fri, 23 Apr 2021 17:26:11 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 68E291BF286 for ; Fri, 23 Apr 2021 17:26:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 65337606EF for ; Fri, 23 Apr 2021 17:26:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ghCmt8UD955B for ; Fri, 23 Apr 2021 17:26:08 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by smtp3.osuosl.org (Postfix) with ESMTPS id 4647B606F4 for ; Fri, 23 Apr 2021 17:26:07 +0000 (UTC) Received: by mail-wr1-x42f.google.com with SMTP id e7so40139866wrs.11 for ; Fri, 23 Apr 2021 10:26:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5CDgKLCofv6Cuasy1CDU+BBnlteUEz7BAbElfVWdL8Q=; b=a19iRXVHqnKQgjxaptJqsotnxlobMrC/hiFRmdhTFwrFBlUyCzMRmCsfCocttiLvDu eHHzo0rXl+WPn219lEqfyswSHdCG3ZAjcdgWfoFzgCRuQUgoPfbtoF2y9zPGssa3EPiB bczKk5gSF2YXUZ+iGajx2uzW1gr+LzYjNM7EPV+oFp990CQKZcDMaDCnjXHnErKBt4E9 4PD3Q6Sh5ezyugf+jybGpSQH76DufHIeQnczTcAEgf/AJhn9NN+0c9GAuequs/x5kgtW kDU/6MRQBKLebdWeCtU/Aq2VSQ5nHEpRLpPCuL4zAlbexROvRPrSiHEqwY5XTNMxR/+u 01cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5CDgKLCofv6Cuasy1CDU+BBnlteUEz7BAbElfVWdL8Q=; b=kdAfZ1C82OwcpI4bRiux4Jlj9cpwL0+b5XrFImxjkxr2hiUKTVZtOBawfyVTRdMQZ2 zh0Voj++RhrDbU8NoMNFupoh/eJYPuoeTUk3e9fCckzu6BaqAwzBQQ4GKDHsI/J2oxag +dqWilwRR2LNM2BI2k3C8OLnIIwf9XziVZyF9mMSTvYJKjdekmp/6apT5ioFZCuMKjR4 PBp7k1StIW7CJqUKGsGnuXNSn4PYmUHaJrI8ZoB9A/r4GzaKnA7aNMyYVZ2Yj4a7Ti0b mdEnQQCOb388tc33jav1JITXONIPGTmrlnZ5/Ag03LfUi6tueIL4s/5WaW0adoHR0YXJ AUSw== X-Gm-Message-State: AOAM531hiideg+Z4P2Ww+47k+E6XJoq5EXoRxMyd6dHAR7TP6TviLSs7 4AQz7zySRqwHZe7c6Ix3LzAlI9QF1wnXwo2Q X-Google-Smtp-Source: ABdhPJytardauwvIiiEgcSdtAoo0t2jjcUs04Y0riXSQDD3Coedo4hh1LC7Yb+McwV/D4wrin0Dz1g== X-Received: by 2002:a5d:5444:: with SMTP id w4mr5908256wrv.202.1619198766161; Fri, 23 Apr 2021 10:26:06 -0700 (PDT) Received: from asaf.. ([2a10:8002:6b25:0:e1f1:1183:2856:58ed]) by smtp.gmail.com with ESMTPSA id 61sm11240325wrm.52.2021.04.23.10.26.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Apr 2021 10:26:05 -0700 (PDT) From: Asaf Kahlon To: buildroot@buildroot.org Date: Fri, 23 Apr 2021 20:26:01 +0300 Message-Id: <20210423172601.127205-1-asafka7@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v4 1/1] package/uftrace: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Asaf Kahlon , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The uftrace tool is to trace and analyze execution of a program written in C/C++. Signed-off-by: Asaf Kahlon --- v3->v4: * define unsupported options exlicitly * Use TARGET_MAKE_ENV instead of TARGET_CONFIGURE_OPTS Signed-off-by: Asaf Kahlon --- DEVELOPERS | 1 + package/Config.in | 1 + package/uftrace/Config.in | 19 ++++++++++++++++ package/uftrace/uftrace.hash | 3 +++ package/uftrace/uftrace.mk | 43 ++++++++++++++++++++++++++++++++++++ 5 files changed, 67 insertions(+) create mode 100644 package/uftrace/Config.in create mode 100644 package/uftrace/uftrace.hash create mode 100644 package/uftrace/uftrace.mk diff --git a/DEVELOPERS b/DEVELOPERS index 95b52d76be..573d8d84de 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -240,6 +240,7 @@ F: package/python* F: package/snmpclitools/ F: package/spdlog/ F: package/uftp/ +F: package/uftrace/ F: package/uvw/ F: package/zeromq/ diff --git a/package/Config.in b/package/Config.in index b9d277428d..6181aaac2c 100644 --- a/package/Config.in +++ b/package/Config.in @@ -144,6 +144,7 @@ menu "Debugging, profiling and benchmark" source "package/trace-cmd/Config.in" source "package/trinity/Config.in" source "package/uclibc-ng-test/Config.in" + source "package/uftrace/Config.in" source "package/valgrind/Config.in" source "package/vmtouch/Config.in" source "package/whetstone/Config.in" diff --git a/package/uftrace/Config.in b/package/uftrace/Config.in new file mode 100644 index 0000000000..a8c6b4ff8a --- /dev/null +++ b/package/uftrace/Config.in @@ -0,0 +1,19 @@ +config BR2_PACKAGE_UFTRACE_ARCH_SUPPORTS + bool + default y if BR2_ARM_CPU_ARMV6 || BR2_ARM_CPU_ARMV7A + default y if BR2_aarch64 + default y if BR2_i386 + default y if BR2_x86_64 + +config BR2_PACKAGE_UFTRACE + bool "uftrace" + depends on BR2_PACKAGE_UFTRACE_ARCH_SUPPORTS + help + The uftrace tool is to trace and analyze execution of a + program written in C/C++. It was heavily inspired by the + ftrace framework of the Linux kernel (especially function + graph tracer) and supports userspace programs. + It supports various kind of commands and filters to help + analysis of the program execution and performance. + + https://github.com/namhyung/uftrace diff --git a/package/uftrace/uftrace.hash b/package/uftrace/uftrace.hash new file mode 100644 index 0000000000..fb1e116be6 --- /dev/null +++ b/package/uftrace/uftrace.hash @@ -0,0 +1,3 @@ +# Locally computed +sha256 418d30c959d3b6d0dcafd55e588a5d414a9984b30f2522a5af004a268824a5a2 uftrace-0.9.4.tar.gz +sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING diff --git a/package/uftrace/uftrace.mk b/package/uftrace/uftrace.mk new file mode 100644 index 0000000000..3be36ae8b5 --- /dev/null +++ b/package/uftrace/uftrace.mk @@ -0,0 +1,43 @@ +################################################################################ +# +# uftrace +# +################################################################################ + +UFTRACE_VERSION = 0.9.4 +UFTRACE_SITE = $(call github,namhyung,uftrace,v$(UFTRACE_VERSION)) +UFTRACE_LICENSE = GPL-2.0 +UFTRACE_LICENSE_FILES = COPYING +UFTRACE_CONFIGURE_OPTS = \ + --without-libdw \ + --without-libstdc++ \ + --without-libpython \ + --without-libluajit \ + --without-libncurses \ + --without-capstone + +# uftrace always compiles a small test program to check if elfutils exists, so +# there's no special flag for it, we just need to make sure it's installed. +ifeq ($(BR2_PACKAGE_ELFUTILS),y) +UFTRACE_DEPENDENCIES += elfutils +else +UFTRACE_CONFIGURE_OPTS += --without-libelf +endif + +define UFTRACE_CONFIGURE_CMDS + (cd $(@D); $(TARGET_CONFIGURE_OPTS) ./configure \ + --arch=$(BR2_ARCH) \ + --prefix=/usr \ + $(UFTRACE_CONFIGURE_OPTS) \ + -o $(@D)/.config) +endef + +define UFTRACE_BUILD_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) +endef + +define UFTRACE_INSTALL_TARGET_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install +endef + +$(eval $(generic-package))