[lttng-dev] Statically compiling LTTNG

Michael Jeanson mjeanson at efficios.com
Thu Oct 3 10:56:56 EDT 2019


On 2019-10-01 7:19 p.m., Eddie Kong via lttng-dev wrote:
> Hello,
> 
> Thank you for all the good work with LTTNG! We’d love to use LTTNG to do
> analysis in our systems 😊 We are running with a very stripped down
> version of linux (no package manager, a lot of basic functionalities
> removed etc). Was wondering if you know of a way to statically compile
> LTTNG so that we can simply unpack our initrd.img, drop the LTTNG
> binaries in, repack it, and just run LTTNG to collect diagnostic data.
> The intent is to keep the system as minimal as possible with LTTNG
> working inside it.
> 
> Thank you,
> 
> Eddie

Hi,

First it depends if you want to do kernel or userspace tracing?

For userspace, lttng-ust requires dynamic linking, so that's a no go.

On the kernel side, you will need to either build lttng-modules in your
kernel image or ship the modules in your initrd. Then you'll have to
statically build lttng-tools and all it's dependencies. I see no obvious
reasons why it wouldn't work, but it's not a scenario we do any testing for.

Cheers,

Michael


More information about the lttng-dev mailing list