[Buildroot] [PATCH 1/1] package/uftrace: new package

Giacomo Longo gabibbo97 at gmail.com
Mon Oct 26 23:14:14 UTC 2020


>From 57e136108b4ff900f3b7972f1f1c19a59ef9cf12 Mon Sep 17 00:00:00 2001
From: Giacomo Longo <gabibbo97 at gmail.com>
Date: Mon, 26 Oct 2020 23:11:41 +0100
Subject: [PATCH 1/1] package/uftrace: new package

Hello, first time trying to package something for BuildRoot and
sending a patch via email.

The package is a tracing utility similar to ltrace and strace that
allows profiling of programs and their library calls.

I have performed a run of ./utils/check-package package/uftrace/* with
the following result:

> 78 lines processed
> 0 warnings generated

I have performed a run of ./utils/test-pkg -d ../test-pkg -c
../uftrace.config -p uftrace -a

> 45 builds, 36 skipped, 0 build failed, 0 legal-info failed

The only architectures supported upstream are aarch64, arm and x86_64/i386.
I could not build the program without glibc so it's marked as
requiring a glibc toolchain.

I am looking for some pointers on how to upstream my modification and
feedback on the patch in its current state.

Signed-off-by: Giacomo Longo <gabibbo97 at gmail.com>
---
package/Config.in | 1 +
package/uftrace/Config.in | 41 ++++++++++++++++++++++++++++++++++++
package/uftrace/uftrace.hash | 3 +++
package/uftrace/uftrace.mk | 34 ++++++++++++++++++++++++++++++
4 files changed, 79 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/package/Config.in b/package/Config.in
index ee05467479..b9c51dc3f1 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -140,6 +140,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..4912d1d8cc
--- /dev/null
+++ b/package/uftrace/Config.in
@@ -0,0 +1,41 @@
+config BR2_PACKAGE_UFTRACE_ARCH_SUPPORTS
+ bool
+ default y if BR2_aarch64
+ default y if BR2_arm
+ default y if BR2_i386
+ default y if BR2_x86_64
+
+config BR2_PACKAGE_UFTRACE
+ bool "uftrace"
+ depends on BR2_TOOLCHAIN_USES_GLIBC
+ depends on BR2_PACKAGE_UFTRACE_ARCH_SUPPORTS
+ depends on !BR2_STATIC_LIBS
+ select BR2_PACKAGE_ELFUTILS
+ select BR2_PACKAGE_UTIL_LINUX
+ select BR2_INSTALL_LIBSTDCPP
+ help
+ Tool to trace and analyze execution of a program.
+
+ https://uftrace.github.io/slide
+
+comment "uftrace needs a glibc toolchain w/ C++, dynamic library"
+ depends on !BR2_TOOLCHAIN_USES_GLIBC || BR2_STATIC_LIBS ||
!BR2_INSTALL_LIBSTDCPP
+
+if BR2_PACKAGE_UFTRACE
+
+config BR2_PACKAGE_UFTRACE_LUAJIT
+ bool "luajit scripting support"
+ default n
+ select BR2_PACKAGE_LUAJIT
+ help
+ Enable luajit scripting support
+
+config BR2_PACKAGE_UFTRACE_TUI
+ bool "TUI support"
+ default n
+ depends on BR2_USE_WCHAR
+ select BR2_PACKAGE_NCURSES
+ help
+ Enable TUI support
+
+endif
diff --git a/package/uftrace/uftrace.hash b/package/uftrace/uftrace.hash
new file mode 100644
index 0000000000..8f38e7431d
--- /dev/null
+++ b/package/uftrace/uftrace.hash
@@ -0,0 +1,3 @@
+# Locally computed:
+sha512 f73ad4461051b9c61668161e077897d118ac556d234ff204e32bf14ecdc2c0df148da30ea5d5054641e79ea20b29261d6f637908f5047f5669207ef244865358
uftrace-v0.9.4.tar.gz
+sha512 aee80b1f9f7f4a8a00dcf6e6ce6c41988dcaedc4de19d9d04460cbfb05d99829ffe8f9d038468eabbfba4d65b38e8dbef5ecf5eb8a1b891d9839cda6c48ee957
COPYING
diff --git a/package/uftrace/uftrace.mk b/package/uftrace/uftrace.mk
new file mode 100644
index 0000000000..4c60962151
--- /dev/null
+++ b/package/uftrace/uftrace.mk
@@ -0,0 +1,34 @@
+################################################################################
+#
+# uftrace
+#
+################################################################################
+
+UFTRACE_VERSION = v0.9.4
+UFTRACE_SITE = $(call github,namhyung,uftrace,$(UFTRACE_VERSION))
+UFTRACE_LICENSE = GPL-2.0+
+UFTRACE_LICENSE_FILES = COPYING
+UFTRACE_DEPENDENCIES = elfutils
+
+ifeq ($(BR2_PACKAGE_UFTRACE_LUAJIT),y)
+UFTRACE_DEPENDENCIES += luajit
+endif
+
+ifeq ($(BR2_PACKAGE_UFTRACE_TUI),y)
+UFTRACE_DEPENDENCIES += ncurses
+endif
+
+ifeq ($(BR2_aarch64),y)
+UFTRACE_CONF_OPTS = --arch=aarch64
+else ifeq ($(BR2_arm),y)
+UFTRACE_CONF_OPTS = --arch=arm
+else ifeq ($(BR2_i386),y)
+UFTRACE_CONF_OPTS = --arch=x86
+else ifeq ($(BR2_x86_64),y)
+UFTRACE_CONF_OPTS = --arch=x86_64
+endif
+
+UFTRACE_CONF_OPTS += --without-libpython
+UFTRACE_CONF_OPTS += --without-capstone
+
+$(eval $(autotools-package))
--
2.28.0


More information about the buildroot mailing list