* [Buildroot] [PATCH] uftrace: new package
@ 2017-06-25 19:37 Vincent Stehle
2017-07-03 14:45 ` Romain Naour
2017-10-29 12:51 ` Eric Le Bihan
0 siblings, 2 replies; 8+ messages in thread
From: Vincent Stehle @ 2017-06-25 19:37 UTC (permalink / raw)
To: buildroot
From: Vincent Stehl? <vincent.stehle@laposte.net>
Add a package for uftrace, a simple function call tracer for user programs.
The x86_64 and arm/aarch64 architectures are supported.
Tracing necessitates that the executable you want to trace be compiled with
-pg or -finstrument-functions option.
See https://github.com/namhyung/uftrace
Signed-off-by: Vincent Stehl? <vincent.stehle@laposte.net>
---
DEVELOPERS | 3 ++-
package/Config.in | 1 +
package/uftrace/Config.in | 20 ++++++++++++++++++++
package/uftrace/uftrace.hash | 2 ++
package/uftrace/uftrace.mk | 28 ++++++++++++++++++++++++++++
5 files changed, 53 insertions(+), 1 deletion(-)
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 9e421f4b4..5f2a6b0db 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1706,9 +1706,10 @@ F: package/openmpi/
F: package/pinentry/
F: package/trinity/
-N: Vincent Stehl? <vincent.stehle@intel.com>
+N: Vincent Stehl? <vincent.stehle@laposte.net>
F: package/i7z/
F: package/msr-tools/
+F: package/uftrace/
N: Vinicius Tinti <viniciustinti@gmail.com>
F: package/python-thrift/
diff --git a/package/Config.in b/package/Config.in
index f69f67f3e..d9639b040 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -121,6 +121,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/whetstone/Config.in"
endmenu
diff --git a/package/uftrace/Config.in b/package/uftrace/Config.in
new file mode 100644
index 000000000..bb766238c
--- /dev/null
+++ b/package/uftrace/Config.in
@@ -0,0 +1,20 @@
+config BR2_PACKAGE_UFTRACE
+ bool "uftrace"
+ depends on BR2_aarch64 || BR2_arm || BR2_x86_64
+ depends on !(BR2_arm &&?BR2_ARM_SOFT_FLOAT)
+ depends on BR2_PACKAGE_ELFUTILS
+ depends on BR2_TOOLCHAIN_USES_GLIBC
+ help
+ A simple function call tracer for user programs.
+
+ Note that the executable you want to trace should be compiled
+ with -pg or -finstrument-functions option.
+
+ https://github.com/namhyung/uftrace
+
+comment "uftrace needs a glibc toolchain and elfutils"
+ depends on BR2_aarch64 || BR2_arm || BR2_x86_64
+ depends on !BR2_PACKAGE_ELFUTILS || !BR2_TOOLCHAIN_USES_GLIBC
+
+comment "uftrace needs a toolchain with hardware floats on ARM"
+ depends on BR2_arm &&?BR2_ARM_SOFT_FLOAT
diff --git a/package/uftrace/uftrace.hash b/package/uftrace/uftrace.hash
new file mode 100644
index 000000000..8509197cc
--- /dev/null
+++ b/package/uftrace/uftrace.hash
@@ -0,0 +1,2 @@
+# Locally computed:
+sha256 afa698053ef10582c2ed3973ea134c0775d7ff4dcece3034905026185c52b272 uftrace-v0.7.tar.gz
diff --git a/package/uftrace/uftrace.mk b/package/uftrace/uftrace.mk
new file mode 100644
index 000000000..e23f01816
--- /dev/null
+++ b/package/uftrace/uftrace.mk
@@ -0,0 +1,28 @@
+################################################################################
+#
+# uftrace
+#
+################################################################################
+
+UFTRACE_VERSION = v0.7
+UFTRACE_SITE = $(call github,namhyung,uftrace,$(UFTRACE_VERSION))
+UFTRACE_DEPENDENCIES = elfutils
+UFTRACE_LICENSE = GPL-2.0
+UFTRACE_LICENSE_FILES = COPYING
+
+define UFTRACE_CONFIGURE_CMDS
+ cd $(@D) && \
+ $(TARGET_MAKE_ENV) CC="$(TARGET_CC)" CFLAGS="$(TARGET_CFLAGS)" \
+ LD="$(TARGET_LD)" ARCH="$(ARCH)" \
+ ./configure --prefix=/usr
+endef
+
+define UFTRACE_BUILD_CMDS
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
+endef
+
+define UFTRACE_INSTALL_TARGET_CMDS
+ $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install DESTDIR="$(TARGET_DIR)"
+endef
+
+$(eval $(generic-package))
--
2.11.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] uftrace: new package
2017-06-25 19:37 [Buildroot] [PATCH] uftrace: new package Vincent Stehle
@ 2017-07-03 14:45 ` Romain Naour
2017-07-03 14:59 ` Arnout Vandecappelle
2017-07-03 20:47 ` Vincent Stehlé
2017-10-29 12:51 ` Eric Le Bihan
1 sibling, 2 replies; 8+ messages in thread
From: Romain Naour @ 2017-07-03 14:45 UTC (permalink / raw)
To: buildroot
Hi Vincent,
Le 25/06/2017 ? 21:37, Vincent Stehle a ?crit :
> From: Vincent Stehl? <vincent.stehle@laposte.net>
>
> Add a package for uftrace, a simple function call tracer for user programs.
>
> The x86_64 and arm/aarch64 architectures are supported.
>
> Tracing necessitates that the executable you want to trace be compiled with
> -pg or -finstrument-functions option.
>
> See https://github.com/namhyung/uftrace
>
> Signed-off-by: Vincent Stehl? <vincent.stehle@laposte.net>
> ---
> DEVELOPERS | 3 ++-
> package/Config.in | 1 +
> package/uftrace/Config.in | 20 ++++++++++++++++++++
> package/uftrace/uftrace.hash | 2 ++
> package/uftrace/uftrace.mk | 28 ++++++++++++++++++++++++++++
> 5 files changed, 53 insertions(+), 1 deletion(-)
> 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 9e421f4b4..5f2a6b0db 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -1706,9 +1706,10 @@ F: package/openmpi/
> F: package/pinentry/
> F: package/trinity/
>
> -N: Vincent Stehl? <vincent.stehle@intel.com>
> +N: Vincent Stehl? <vincent.stehle@laposte.net>
This should be part of another commit since it's not related to uftrace.
> F: package/i7z/
> F: package/msr-tools/
> +F: package/uftrace/
>
> N: Vinicius Tinti <viniciustinti@gmail.com>
> F: package/python-thrift/
> diff --git a/package/Config.in b/package/Config.in
> index f69f67f3e..d9639b040 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -121,6 +121,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/whetstone/Config.in"
> endmenu
> diff --git a/package/uftrace/Config.in b/package/uftrace/Config.in
> new file mode 100644
> index 000000000..bb766238c
> --- /dev/null
> +++ b/package/uftrace/Config.in
> @@ -0,0 +1,20 @@
> +config BR2_PACKAGE_UFTRACE
> + bool "uftrace"
> + depends on BR2_aarch64 || BR2_arm || BR2_x86_64
> + depends on !(BR2_arm && BR2_ARM_SOFT_FLOAT)
This could be:
depends on BR2_aarch64 || (BR2_arm && !BR2_ARM_SOFT_FLOAT) || BR2_x86_64
Btw, can you explain why only armhf is supported ?
> + depends on BR2_PACKAGE_ELFUTILS
Can you select BR2_PACKAGE_ELFUTILS and add reverse decencies
depends on BR2_USE_WCHAR # elfutils
depends on !BR2_STATIC_LIBS # elfutils
Also add thread dependency:
depends on BR2_TOOLCHAIN_HAS_THREADS
> + depends on BR2_TOOLCHAIN_USES_GLIBC
Why it's restricted to glibc based toolchain ?
At least you can keep the elfutils reverse dependencies:
depends on BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC # elfutils
It should be fine with uClibc-ng toolchains.
> + help
> + A simple function call tracer for user programs.
> +
> + Note that the executable you want to trace should be compiled
> + with -pg or -finstrument-functions option.
> +
> + https://github.com/namhyung/uftrace
> +
> +comment "uftrace needs a glibc toolchain and elfutils"
> + depends on BR2_aarch64 || BR2_arm || BR2_x86_64
> + depends on !BR2_PACKAGE_ELFUTILS || !BR2_TOOLCHAIN_USES_GLIBC
update the comment dependencies accordingly:
comment "uftrace needs a glibc or uClibc toolchain w/ dynamic library, threads,
wchar"
depends on BR2_aarch64 || (BR2_arm && !BR2_ARM_SOFT_FLOAT) || BR2_x86_64
depends on !BR2_USE_WCHAR || BR2_STATIC_LIBS \
|| !(BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC)
> +
> +comment "uftrace needs a toolchain with hardware floats on ARM"
> + depends on BR2_arm && BR2_ARM_SOFT_FLOAT
> diff --git a/package/uftrace/uftrace.hash b/package/uftrace/uftrace.hash
> new file mode 100644
> index 000000000..8509197cc
> --- /dev/null
> +++ b/package/uftrace/uftrace.hash
> @@ -0,0 +1,2 @@
> +# Locally computed:
> +sha256 afa698053ef10582c2ed3973ea134c0775d7ff4dcece3034905026185c52b272 uftrace-v0.7.tar.gz
> diff --git a/package/uftrace/uftrace.mk b/package/uftrace/uftrace.mk
> new file mode 100644
> index 000000000..e23f01816
> --- /dev/null
> +++ b/package/uftrace/uftrace.mk
> @@ -0,0 +1,28 @@
> +################################################################################
> +#
> +# uftrace
> +#
> +################################################################################
> +
> +UFTRACE_VERSION = v0.7
> +UFTRACE_SITE = $(call github,namhyung,uftrace,$(UFTRACE_VERSION))
> +UFTRACE_DEPENDENCIES = elfutils
> +UFTRACE_LICENSE = GPL-2.0
> +UFTRACE_LICENSE_FILES = COPYING
> +
> +define UFTRACE_CONFIGURE_CMDS
> + cd $(@D) && \
> + $(TARGET_MAKE_ENV) CC="$(TARGET_CC)" CFLAGS="$(TARGET_CFLAGS)" \
> + LD="$(TARGET_LD)" ARCH="$(ARCH)" \
> + ./configure --prefix=/usr
> +endef
Use $(TARGET_CONFIGURE_OPTS) instead of defining CC, CFLAGS etc on the command
line. Also add parenthesis
Something like:
(cd $(@D) && \
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \
ARCH="$(ARCH)" \
./configure --prefix=/usr)
> +
> +define UFTRACE_BUILD_CMDS
> + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
Keep $(TARGET_CONFIGURE_OPTS) and ARCH="$(ARCH)"
> +endef
> +
> +define UFTRACE_INSTALL_TARGET_CMDS
> + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install DESTDIR="$(TARGET_DIR)"
Same here.
Best regards,
Romain
> +endef
> +
> +$(eval $(generic-package))
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] uftrace: new package
2017-07-03 14:45 ` Romain Naour
@ 2017-07-03 14:59 ` Arnout Vandecappelle
2017-07-03 20:47 ` Vincent Stehlé
1 sibling, 0 replies; 8+ messages in thread
From: Arnout Vandecappelle @ 2017-07-03 14:59 UTC (permalink / raw)
To: buildroot
On 03-07-17 16:45, Romain Naour wrote:
> Use $(TARGET_CONFIGURE_OPTS) instead of defining CC, CFLAGS etc on the command
> line. Also add parenthesis
> Something like:
>
> (cd $(@D) && \
> $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \
> ARCH="$(ARCH)" \
> ./configure --prefix=/usr)
No, don't add parenthesis. Somebody a long time ago started doing that but
there is absolutely no reason for it, it just creates an additional shell level
that serves no purpose whatsoever.
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] uftrace: new package
2017-07-03 14:45 ` Romain Naour
2017-07-03 14:59 ` Arnout Vandecappelle
@ 2017-07-03 20:47 ` Vincent Stehlé
2017-07-03 20:58 ` Arnout Vandecappelle
2017-07-03 21:19 ` Romain Naour
1 sibling, 2 replies; 8+ messages in thread
From: Vincent Stehlé @ 2017-07-03 20:47 UTC (permalink / raw)
To: buildroot
On 07/03/2017 04:45 PM, Romain Naour wrote:
> Hi Vincent,
>
Hi Romain,
Thank you for reviewing!
> Le 25/06/2017 ? 21:37, Vincent Stehle a ?crit :
>> From: Vincent Stehl? <vincent.stehle@laposte.net>
>>
>> Add a package for uftrace, a simple function call tracer for user programs.
>>
>> The x86_64 and arm/aarch64 architectures are supported.
>>
>> Tracing necessitates that the executable you want to trace be compiled with
>> -pg or -finstrument-functions option.
>>
>> See https://github.com/namhyung/uftrace
>>
>> Signed-off-by: Vincent Stehl? <vincent.stehle@laposte.net>
>> ---
>> DEVELOPERS | 3 ++-
>> package/Config.in | 1 +
>> package/uftrace/Config.in | 20 ++++++++++++++++++++
>> package/uftrace/uftrace.hash | 2 ++
>> package/uftrace/uftrace.mk | 28 ++++++++++++++++++++++++++++
>> 5 files changed, 53 insertions(+), 1 deletion(-)
>> 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 9e421f4b4..5f2a6b0db 100644
>> --- a/DEVELOPERS
>> +++ b/DEVELOPERS
>> @@ -1706,9 +1706,10 @@ F: package/openmpi/
>> F: package/pinentry/
>> F: package/trinity/
>>
>> -N: Vincent Stehl? <vincent.stehle@intel.com>
>> +N: Vincent Stehl? <vincent.stehle@laposte.net>
>
> This should be part of another commit since it's not related to uftrace.
If you insist I can separate this update from the patch, sure.
Note that half the commits in the tree touching the DEVELOPERS file do
in fact modify something else in the mean time so I guess we are still
somewhat in the "tradition" :)
>
>> F: package/i7z/
>> F: package/msr-tools/
>> +F: package/uftrace/
>>
>> N: Vinicius Tinti <viniciustinti@gmail.com>
>> F: package/python-thrift/
>> diff --git a/package/Config.in b/package/Config.in
>> index f69f67f3e..d9639b040 100644
>> --- a/package/Config.in
>> +++ b/package/Config.in
>> @@ -121,6 +121,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/whetstone/Config.in"
>> endmenu
>> diff --git a/package/uftrace/Config.in b/package/uftrace/Config.in
>> new file mode 100644
>> index 000000000..bb766238c
>> --- /dev/null
>> +++ b/package/uftrace/Config.in
>> @@ -0,0 +1,20 @@
>> +config BR2_PACKAGE_UFTRACE
>> + bool "uftrace"
>> + depends on BR2_aarch64 || BR2_arm || BR2_x86_64
>> + depends on !(BR2_arm && BR2_ARM_SOFT_FLOAT)
>
> This could be:
> depends on BR2_aarch64 || (BR2_arm && !BR2_ARM_SOFT_FLOAT) || BR2_x86_64
This is clearer, thanks.
>
> Btw, can you explain why only armhf is supported ?
Certainly: the inline assembly fragments used to retrieve the registers
access the NEON/float registers without any #ifdef:
https://github.com/namhyung/uftrace/blob/master/arch/arm/mcount-support.c#L353
I guess it should be possible to "port" uftrace to arm soft float as well.
>
>> + depends on BR2_PACKAGE_ELFUTILS
>
> Can you select BR2_PACKAGE_ELFUTILS and add reverse decencies
>
> depends on BR2_USE_WCHAR # elfutils
> depends on !BR2_STATIC_LIBS # elfutils
>
> Also add thread dependency:
> depends on BR2_TOOLCHAIN_HAS_THREADS
Ok I'll go for select + "propagating" the dependencies, thanks.
>
>> + depends on BR2_TOOLCHAIN_USES_GLIBC
>
> Why it's restricted to glibc based toolchain ?
> At least you can keep the elfutils reverse dependencies:
>
> depends on BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC # elfutils
>
> It should be fine with uClibc-ng toolchains.
When I tested with test-pkg I found no way of making it build properly
on uClibc/musl based toolchains. Let me retry with the select/depends
reworked as you proposed and I'll let you know how it goes.
>
>> + help
>> + A simple function call tracer for user programs.
>> +
>> + Note that the executable you want to trace should be compiled
>> + with -pg or -finstrument-functions option.
>> +
>> + https://github.com/namhyung/uftrace
>> +
>> +comment "uftrace needs a glibc toolchain and elfutils"
>> + depends on BR2_aarch64 || BR2_arm || BR2_x86_64
>> + depends on !BR2_PACKAGE_ELFUTILS || !BR2_TOOLCHAIN_USES_GLIBC
>
> update the comment dependencies accordingly:
> comment "uftrace needs a glibc or uClibc toolchain w/ dynamic library, threads,
> wchar"
> depends on BR2_aarch64 || (BR2_arm && !BR2_ARM_SOFT_FLOAT) || BR2_x86_64
> depends on !BR2_USE_WCHAR || BR2_STATIC_LIBS \
> || !(BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC)
Ok, I'll update the comments, thanks.
>
>> +
>> +comment "uftrace needs a toolchain with hardware floats on ARM"
>> + depends on BR2_arm && BR2_ARM_SOFT_FLOAT
>> diff --git a/package/uftrace/uftrace.hash b/package/uftrace/uftrace.hash
>> new file mode 100644
>> index 000000000..8509197cc
>> --- /dev/null
>> +++ b/package/uftrace/uftrace.hash
>> @@ -0,0 +1,2 @@
>> +# Locally computed:
>> +sha256 afa698053ef10582c2ed3973ea134c0775d7ff4dcece3034905026185c52b272 uftrace-v0.7.tar.gz
>> diff --git a/package/uftrace/uftrace.mk b/package/uftrace/uftrace.mk
>> new file mode 100644
>> index 000000000..e23f01816
>> --- /dev/null
>> +++ b/package/uftrace/uftrace.mk
>> @@ -0,0 +1,28 @@
>> +################################################################################
>> +#
>> +# uftrace
>> +#
>> +################################################################################
>> +
>> +UFTRACE_VERSION = v0.7
>> +UFTRACE_SITE = $(call github,namhyung,uftrace,$(UFTRACE_VERSION))
>> +UFTRACE_DEPENDENCIES = elfutils
>> +UFTRACE_LICENSE = GPL-2.0
>> +UFTRACE_LICENSE_FILES = COPYING
>> +
>> +define UFTRACE_CONFIGURE_CMDS
>> + cd $(@D) && \
>> + $(TARGET_MAKE_ENV) CC="$(TARGET_CC)" CFLAGS="$(TARGET_CFLAGS)" \
>> + LD="$(TARGET_LD)" ARCH="$(ARCH)" \
>> + ./configure --prefix=/usr
>> +endef
>
> Use $(TARGET_CONFIGURE_OPTS) instead of defining CC, CFLAGS etc on the command
> line. Also add parenthesis
> Something like:
>
> (cd $(@D) && \
> $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \
> ARCH="$(ARCH)" \
> ./configure --prefix=/usr)
This one I'll drop if you don't mind.
>
>> +
>> +define UFTRACE_BUILD_CMDS
>> + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
>
> Keep $(TARGET_CONFIGURE_OPTS) and ARCH="$(ARCH)"
>
>> +endef
>> +
>> +define UFTRACE_INSTALL_TARGET_CMDS
>> + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install DESTDIR="$(TARGET_DIR)"
>
> Same here.
Well some of the environment settings and configure options are
"sampled" by this configure script of theirs (which resembles autoconf
and is not). This ends up being stored in a file, which is reused
afterwards.
I did not want to add the conf opts and arch to the following steps and
give the impression that they were taken into account while this is the
local configuration file in fact, which has the priority.
Can I please keep it as is?
Meanwhile I'll work on a v2. Thank you for spending time reviewing this
patch!
Best regards,
Vincent.
>
> Best regards,
> Romain
>
>> +endef
>> +
>> +$(eval $(generic-package))
>>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] uftrace: new package
2017-07-03 20:47 ` Vincent Stehlé
@ 2017-07-03 20:58 ` Arnout Vandecappelle
2017-07-03 21:19 ` Romain Naour
1 sibling, 0 replies; 8+ messages in thread
From: Arnout Vandecappelle @ 2017-07-03 20:58 UTC (permalink / raw)
To: buildroot
On 03-07-17 22:47, Vincent Stehl? wrote:
> Well some of the environment settings and configure options are
> "sampled" by this configure script of theirs (which resembles autoconf
> and is not). This ends up being stored in a file, which is reused
> afterwards.
Please keep this explanation either in the commit log or in a comment in the
.mk file itself, otherwise people will ask the same question again.
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] uftrace: new package
2017-07-03 20:47 ` Vincent Stehlé
2017-07-03 20:58 ` Arnout Vandecappelle
@ 2017-07-03 21:19 ` Romain Naour
1 sibling, 0 replies; 8+ messages in thread
From: Romain Naour @ 2017-07-03 21:19 UTC (permalink / raw)
To: buildroot
Hi Vincent,
Le 03/07/2017 ? 22:47, Vincent Stehl? a ?crit :
> On 07/03/2017 04:45 PM, Romain Naour wrote:
>> Hi Vincent,
>>
>
> Hi Romain,
>
> Thank you for reviewing!
>
>> Le 25/06/2017 ? 21:37, Vincent Stehle a ?crit :
>>> From: Vincent Stehl? <vincent.stehle@laposte.net>
>>>
>>> Add a package for uftrace, a simple function call tracer for user programs.
>>>
>>> The x86_64 and arm/aarch64 architectures are supported.
>>>
>>> Tracing necessitates that the executable you want to trace be compiled with
>>> -pg or -finstrument-functions option.
>>>
>>> See https://github.com/namhyung/uftrace
>>>
>>> Signed-off-by: Vincent Stehl? <vincent.stehle@laposte.net>
>>> ---
>>> DEVELOPERS | 3 ++-
>>> package/Config.in | 1 +
>>> package/uftrace/Config.in | 20 ++++++++++++++++++++
>>> package/uftrace/uftrace.hash | 2 ++
>>> package/uftrace/uftrace.mk | 28 ++++++++++++++++++++++++++++
>>> 5 files changed, 53 insertions(+), 1 deletion(-)
>>> 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 9e421f4b4..5f2a6b0db 100644
>>> --- a/DEVELOPERS
>>> +++ b/DEVELOPERS
>>> @@ -1706,9 +1706,10 @@ F: package/openmpi/
>>> F: package/pinentry/
>>> F: package/trinity/
>>>
>>> -N: Vincent Stehl? <vincent.stehle@intel.com>
>>> +N: Vincent Stehl? <vincent.stehle@laposte.net>
>>
>> This should be part of another commit since it's not related to uftrace.
>
> If you insist I can separate this update from the patch, sure.
It seems you're doing the same change in pixz package so it will conflict while
applying. It's just an advice to avoid this :)
>
> Note that half the commits in the tree touching the DEVELOPERS file do
> in fact modify something else in the mean time so I guess we are still
> somewhat in the "tradition" :)
Touching the DEVEOPERS file should be done only when adding a new package.
(I forgot to do so earlier today with my llvm series :-/)
>
>>
>>> F: package/i7z/
>>> F: package/msr-tools/
>>> +F: package/uftrace/
>>>
>>> N: Vinicius Tinti <viniciustinti@gmail.com>
>>> F: package/python-thrift/
>>> diff --git a/package/Config.in b/package/Config.in
>>> index f69f67f3e..d9639b040 100644
>>> --- a/package/Config.in
>>> +++ b/package/Config.in
>>> @@ -121,6 +121,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/whetstone/Config.in"
>>> endmenu
>>> diff --git a/package/uftrace/Config.in b/package/uftrace/Config.in
>>> new file mode 100644
>>> index 000000000..bb766238c
>>> --- /dev/null
>>> +++ b/package/uftrace/Config.in
>>> @@ -0,0 +1,20 @@
>>> +config BR2_PACKAGE_UFTRACE
>>> + bool "uftrace"
>>> + depends on BR2_aarch64 || BR2_arm || BR2_x86_64
>>> + depends on !(BR2_arm && BR2_ARM_SOFT_FLOAT)
>>
>> This could be:
>> depends on BR2_aarch64 || (BR2_arm && !BR2_ARM_SOFT_FLOAT) || BR2_x86_64
>
> This is clearer, thanks.
>
>>
>> Btw, can you explain why only armhf is supported ?
>
> Certainly: the inline assembly fragments used to retrieve the registers
> access the NEON/float registers without any #ifdef:
>
> https://github.com/namhyung/uftrace/blob/master/arch/arm/mcount-support.c#L353
>
> I guess it should be possible to "port" uftrace to arm soft float as well.
Maybe you can add this info in the commit log, it's not obvious.
>
>>
>>> + depends on BR2_PACKAGE_ELFUTILS
>>
>> Can you select BR2_PACKAGE_ELFUTILS and add reverse decencies
>>
>> depends on BR2_USE_WCHAR # elfutils
>> depends on !BR2_STATIC_LIBS # elfutils
>>
>> Also add thread dependency:
>> depends on BR2_TOOLCHAIN_HAS_THREADS
>
> Ok I'll go for select + "propagating" the dependencies, thanks.
>
>>
>>> + depends on BR2_TOOLCHAIN_USES_GLIBC
>>
>> Why it's restricted to glibc based toolchain ?
>> At least you can keep the elfutils reverse dependencies:
>>
>> depends on BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC # elfutils
>>
>> It should be fine with uClibc-ng toolchains.
>
> When I tested with test-pkg I found no way of making it build properly
> on uClibc/musl based toolchains. Let me retry with the select/depends
> reworked as you proposed and I'll let you know how it goes.
I did some testing with test-pkg script today and it uftrace build fine with
uClibc-ng toolchains. musl toolchains can't be enabled due to elfutils dependencies.
>
>>
>>> + help
>>> + A simple function call tracer for user programs.
>>> +
>>> + Note that the executable you want to trace should be compiled
>>> + with -pg or -finstrument-functions option.
>>> +
>>> + https://github.com/namhyung/uftrace
>>> +
>>> +comment "uftrace needs a glibc toolchain and elfutils"
>>> + depends on BR2_aarch64 || BR2_arm || BR2_x86_64
>>> + depends on !BR2_PACKAGE_ELFUTILS || !BR2_TOOLCHAIN_USES_GLIBC
>>
>> update the comment dependencies accordingly:
>> comment "uftrace needs a glibc or uClibc toolchain w/ dynamic library, threads,
>> wchar"
>> depends on BR2_aarch64 || (BR2_arm && !BR2_ARM_SOFT_FLOAT) || BR2_x86_64
>> depends on !BR2_USE_WCHAR || BR2_STATIC_LIBS \
>> || !(BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC)
>
> Ok, I'll update the comments, thanks.
>
>>
>>> +
>>> +comment "uftrace needs a toolchain with hardware floats on ARM"
>>> + depends on BR2_arm && BR2_ARM_SOFT_FLOAT
>>> diff --git a/package/uftrace/uftrace.hash b/package/uftrace/uftrace.hash
>>> new file mode 100644
>>> index 000000000..8509197cc
>>> --- /dev/null
>>> +++ b/package/uftrace/uftrace.hash
>>> @@ -0,0 +1,2 @@
>>> +# Locally computed:
>>> +sha256 afa698053ef10582c2ed3973ea134c0775d7ff4dcece3034905026185c52b272 uftrace-v0.7.tar.gz
>>> diff --git a/package/uftrace/uftrace.mk b/package/uftrace/uftrace.mk
>>> new file mode 100644
>>> index 000000000..e23f01816
>>> --- /dev/null
>>> +++ b/package/uftrace/uftrace.mk
>>> @@ -0,0 +1,28 @@
>>> +################################################################################
>>> +#
>>> +# uftrace
>>> +#
>>> +################################################################################
>>> +
>>> +UFTRACE_VERSION = v0.7
>>> +UFTRACE_SITE = $(call github,namhyung,uftrace,$(UFTRACE_VERSION))
>>> +UFTRACE_DEPENDENCIES = elfutils
>>> +UFTRACE_LICENSE = GPL-2.0
>>> +UFTRACE_LICENSE_FILES = COPYING
>>> +
>>> +define UFTRACE_CONFIGURE_CMDS
>>> + cd $(@D) && \
>>> + $(TARGET_MAKE_ENV) CC="$(TARGET_CC)" CFLAGS="$(TARGET_CFLAGS)" \
>>> + LD="$(TARGET_LD)" ARCH="$(ARCH)" \
>>> + ./configure --prefix=/usr
>>> +endef
>>
>> Use $(TARGET_CONFIGURE_OPTS) instead of defining CC, CFLAGS etc on the command
>> line. Also add parenthesis
>> Something like:
>>
>> (cd $(@D) && \
>> $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \
>> ARCH="$(ARCH)" \
>> ./configure --prefix=/usr)
>
> This one I'll drop if you don't mind.
>
>>
>>> +
>>> +define UFTRACE_BUILD_CMDS
>>> + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
>>
>> Keep $(TARGET_CONFIGURE_OPTS) and ARCH="$(ARCH)"
>>
>>> +endef
>>> +
>>> +define UFTRACE_INSTALL_TARGET_CMDS
>>> + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install DESTDIR="$(TARGET_DIR)"
>>
>> Same here.
>
> Well some of the environment settings and configure options are
> "sampled" by this configure script of theirs (which resembles autoconf
> and is not). This ends up being stored in a file, which is reused
> afterwards.
>
> I did not want to add the conf opts and arch to the following steps and
> give the impression that they were taken into account while this is the
> local configuration file in fact, which has the priority.
Indeed, I just see this file using the "override" keyword on each Make variable...
>
> Can I please keep it as is?
Sure, no problem it was a suggestion.
>
> Meanwhile I'll work on a v2. Thank you for spending time reviewing this
> patch!
Thanks for you contribution.
Best regards,
Romain
>
> Best regards,
>
> Vincent.
>
>>
>> Best regards,
>> Romain
>>
>>> +endef
>>> +
>>> +$(eval $(generic-package))
>>>
>>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] uftrace: new package
2017-06-25 19:37 [Buildroot] [PATCH] uftrace: new package Vincent Stehle
2017-07-03 14:45 ` Romain Naour
@ 2017-10-29 12:51 ` Eric Le Bihan
2017-10-29 18:11 ` Vincent Stehlé
1 sibling, 1 reply; 8+ messages in thread
From: Eric Le Bihan @ 2017-10-29 12:51 UTC (permalink / raw)
To: buildroot
Hi!
On 17-06-25 21:37:43, Vincent Stehle wrote:
> From: Vincent Stehl? <vincent.stehle@laposte.net>
>
> Add a package for uftrace, a simple function call tracer for user programs.
Any update on this patch series?
>
> The x86_64 and arm/aarch64 architectures are supported.
>
> Tracing necessitates that the executable you want to trace be compiled with
> -pg or -finstrument-functions option.
How can those flags be passed when compiling Buildroot packages?
Regards,
--
ELB
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] uftrace: new package
2017-10-29 12:51 ` Eric Le Bihan
@ 2017-10-29 18:11 ` Vincent Stehlé
0 siblings, 0 replies; 8+ messages in thread
From: Vincent Stehlé @ 2017-10-29 18:11 UTC (permalink / raw)
To: buildroot
On Sun, Oct 29, 2017 at 01:51:48PM +0100, Eric Le Bihan wrote:
> Any update on this patch series?
Bonjour Eric,
I am sorry, it has been a while since I worked on those patches :(
(-pg or -finstrument-functions)
> How can those flags be passed when compiling Buildroot packages?
I am not sure if we have a clean way through a configuration variable.
The way I did it was a bit of a hack as I edited the concerned package makefile
directly (and I find it one strength of buildroot that you can do that type of
modification so easily when needed.)
Maybe we need a way to add arbitrary options to the CFLAGS, per package?
Best regards,
Vincent.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-10-29 18:11 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-25 19:37 [Buildroot] [PATCH] uftrace: new package Vincent Stehle
2017-07-03 14:45 ` Romain Naour
2017-07-03 14:59 ` Arnout Vandecappelle
2017-07-03 20:47 ` Vincent Stehlé
2017-07-03 20:58 ` Arnout Vandecappelle
2017-07-03 21:19 ` Romain Naour
2017-10-29 12:51 ` Eric Le Bihan
2017-10-29 18:11 ` Vincent Stehlé
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox