Re: [Elftoolchain-developers] addr2line improvements - sys/tree.h on Linux

2020-02-14 Thread Joseph Koshy via Elftoolchain-developers
ed> Should the build glue (adding appropriate -I arguments, etc.) already
ed> be in place?

ed> I tried building the change on Ubuntu 18.04 via CI and it failed to
ed> find .

The example programs in the libelf tutorial use "libbsd-dev".

To build on Ubuntu you may need something like the following to be
incorporated into your patch:

Index: addr2line.c
===
--- addr2line.c (revision 3822)
+++ addr2line.c (working copy)
@@ -25,6 +25,8 @@
  */

 #include 
+#include 
+
 #include 
 #include 
 #include 
Index: os.Linux.mk
===
--- os.Linux.mk (nonexistent)
+++ os.Linux.mk (working copy)
@@ -0,0 +1,2 @@
+CFLAGS+=-I/usr/include/bsd -DLIBBSD_OVERLAY
+LDADD+= -lbsd


-- 
Joseph Koshy | Volunteer Developer, The Elftoolchain Project


___
Elftoolchain-developers mailing list
Elftoolchain-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/elftoolchain-developers


Re: [Elftoolchain-developers] addr2line improvements - sys/tree.h on Linux

2020-02-13 Thread Ed Maste
On Thu, 13 Feb 2020 at 16:13, Joseph Koshy  wrote:
>
> > However this uses BSD's sys/tree.h, and I am not sure if it's
> > available on Linux distros. Once we have CI for Linux (or get advice
> > on sys/tree.h there) I will work on bringing these changes upstream.
>
>  would be part of the "libbsd-dev" package in
> Ubuntu/Debian ("libbsd-dev" is listed as a build pre-requisite).

Should the build glue (adding appropriate -I arguments, etc.) already
be in place?

I tried building the change on Ubuntu 18.04 via CI and it failed to
find .


___
Elftoolchain-developers mailing list
Elftoolchain-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/elftoolchain-developers


Re: [Elftoolchain-developers] addr2line improvements - sys/tree.h on Linux

2020-02-13 Thread Joseph Koshy via Elftoolchain-developers
jk> In https://reviews.freebsd.org/D23418 there is mention of increased
jk> memory usage, from 256K to 77M.  This seems a large increase; was it
jk> looked at in FreeBSD?

markj> This is stale and was due to a bug in an early version of the patch.  We
markj> did some heap profiling and found that the actual increase in memory
markj> usage from the patch is negligible (I believe tens of KB when resolving
markj> addresses in the FreeBSD kernel).

That is good to know - thanks for the clarification.

Thank you for folding these changes upstream.

-- 
Joseph Koshy | Volunteer Developer, The Elftoolchain Project


___
Elftoolchain-developers mailing list
Elftoolchain-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/elftoolchain-developers


Re: [Elftoolchain-developers] addr2line improvements - sys/tree.h on Linux

2020-02-13 Thread Mark Johnston
On Thu, Feb 13, 2020 at 09:13:08PM +, Joseph Koshy via 
Elftoolchain-developers wrote:
> Ed,
> 
> > https://reviews.freebsd.org/rS357450
> > addr2line: Cache CU DIEs upon a successful address lookup
> 
> In https://reviews.freebsd.org/D23418 there is mention of increased
> memory usage, from 256K to 77M.  This seems a large increase; was it
> looked at in FreeBSD?

This is stale and was due to a bug in an early version of the patch.  We
did some heap profiling and found that the actual increase in memory
usage from the patch is negligible (I believe tens of KB when resolving
addresses in the FreeBSD kernel).

> The Minix microkernel is one of our supported OSes -- I would keep an
> eye on RAM usage so that the project remains usable there.
> 
> What is the specific problem that this patch is attempting to address?

The case where addr2line is consuming a large number of input addresses.
Today it sequentially scans the CU DIEs for each address without doing
any caching.

> > However this uses BSD's sys/tree.h, and I am not sure if it's
> > available on Linux distros. Once we have CI for Linux (or get advice
> > on sys/tree.h there) I will work on bringing these changes upstream.
> 
>  would be part of the "libbsd-dev" package in
> Ubuntu/Debian ("libbsd-dev" is listed as a build pre-requisite).
> 
> --
> Joseph Koshy | Volunteer Developer, The Elftoolchain Project
> 
> 
> ___
> Elftoolchain-developers mailing list
> Elftoolchain-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/elftoolchain-developers


___
Elftoolchain-developers mailing list
Elftoolchain-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/elftoolchain-developers


Re: [Elftoolchain-developers] addr2line improvements - sys/tree.h on Linux

2020-02-13 Thread Joseph Koshy via Elftoolchain-developers
Ed,

> https://reviews.freebsd.org/rS357450
> addr2line: Cache CU DIEs upon a successful address lookup

In https://reviews.freebsd.org/D23418 there is mention of increased
memory usage, from 256K to 77M.  This seems a large increase; was it
looked at in FreeBSD?

The Minix microkernel is one of our supported OSes -- I would keep an
eye on RAM usage so that the project remains usable there.

What is the specific problem that this patch is attempting to address?

> However this uses BSD's sys/tree.h, and I am not sure if it's
> available on Linux distros. Once we have CI for Linux (or get advice
> on sys/tree.h there) I will work on bringing these changes upstream.

 would be part of the "libbsd-dev" package in
Ubuntu/Debian ("libbsd-dev" is listed as a build pre-requisite).

--
Joseph Koshy | Volunteer Developer, The Elftoolchain Project


___
Elftoolchain-developers mailing list
Elftoolchain-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/elftoolchain-developers