From patchwork Fri Apr 23 17:24:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asaf Kahlon X-Patchwork-Id: 1469725 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=2605:bc80:3010::136; helo=smtp3.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=lXhD5b/Q; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (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 4FRh4c3Z5lz9sCD for ; Sat, 24 Apr 2021 03:25:02 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 2841260709; Fri, 23 Apr 2021 17:25:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org 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 c-h1i1jBWuG9; Fri, 23 Apr 2021 17:24:59 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 622E4606EF; Fri, 23 Apr 2021 17:24:58 +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 3FFCB1BF286 for ; Fri, 23 Apr 2021 17:24:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 2F395606EF for ; Fri, 23 Apr 2021 17:24:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org 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 CNfgDr-fDckT for ; Fri, 23 Apr 2021 17:24:56 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by smtp3.osuosl.org (Postfix) with ESMTPS id 1881D606B9 for ; Fri, 23 Apr 2021 17:24:55 +0000 (UTC) Received: by mail-wm1-x32d.google.com with SMTP id w186so21893740wmg.3 for ; Fri, 23 Apr 2021 10:24:55 -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=9Mb3xp9pcGkOmSt7kBMMpxTE94W2ZFRwcIvfcjba/3Q=; b=lXhD5b/QYVyggDxrXuF/CDkIFW5iSFjXGgEP+okiqYRduge1w1Efp+vCftYRcxuCPN /XP9bwG1pYTLmCSqq0rU5UP/qVhIDBHA2zi85uaPHM6LZicCUnrB40IwbLiWjj5K3oQl HMHshp/487GA86qXblMXUQgaiSc07n4WbN/I3W8rZiPBDWe0GHekLHD+/kAzhVuoyUAr S9ADJ7wMRqgP6oFZeUADy+El1opO/Tr0SY5KDK5RcKf9xUOvQAnHolRfZ+rZ4aj3+vyz x9tbWVaj3RrQYa1SziI72zig9xtz+wllP75qrsiPSSeXOmT6uYBeicm2I4aiQPUu3eYi 6JYA== 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=9Mb3xp9pcGkOmSt7kBMMpxTE94W2ZFRwcIvfcjba/3Q=; b=NwefavZqfOLNfjdG67jFjwDROdU6W81/cJmOGdwbBqUD9m0N2EgHBHr9aHHChUVLQ1 Vve/AYMO1owLcTKeur+nYHNabxrC6hyRZdrFtFPRaGVL8E97SrASsX//g3rCrGO3u/JG NwGsPE64WtDK1u2nQSYUzRN8DYujxmp5Yws8e9ntpyKsi1KZzdYiCmytt5MnoHvXZLlZ ev7hjwC8biVUnec48kXDYxgDj2vEwQZwpZuLwwCGaSl5a/tXyxrl1f41e0Ia5SzYWUAb LJ1oUoEHNW4U9jCyIPKlpsI7g6wCvYflMwb70nPCRCrZqLHhQAq1GyuMT3DOfSJ83rRG ojlA== X-Gm-Message-State: AOAM531wBMNzcnYKXqt32Tsa7I/Pj2A10Rayn+dFOK912pI93VQmB7JN Yj1b2WBTNRkjIelL8omUPV4PyXnafflt2OlO X-Google-Smtp-Source: ABdhPJw10ywUMMX8IYdGmaaSvSBXa2Ua2YJnyjHlabTFGPBcsSPpB2rNzeAmkLd+ITvQx47MHIyRGA== X-Received: by 2002:a05:600c:2dc8:: with SMTP id e8mr6656762wmh.10.1619198694006; Fri, 23 Apr 2021 10:24:54 -0700 (PDT) Received: from asaf.. ([2a10:8002:6b25:0:e1f1:1183:2856:58ed]) by smtp.gmail.com with ESMTPSA id o62sm11726219wme.5.2021.04.23.10.24.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Apr 2021 10:24:53 -0700 (PDT) From: Asaf Kahlon To: buildroot@buildroot.org Date: Fri, 23 Apr 2021 20:24:49 +0300 Message-Id: <20210423172449.126847-1-asafka7@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v4 1/1] The uftrace tool is to trace and analyze execution of a program written in C/C++. 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" 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))