[lttng-dev] Golang agent for LTTng-ust

Loïc Gelle loic.gelle at polymtl.ca
Fri May 4 06:03:15 EDT 2018


There has been a previous discussion on the mailing list about porting LTTng to Golang, about a year ago: https://lists.lttng.org/pipermail/lttng-dev/2017-June/027203.html <https://lists.lttng.org/pipermail/lttng-dev/2017-June/027203.html> . This new topic is to discuss more precisely about implementation possibilities.

Currently, one has to use the the C UST agent from LTTng in order to instrument Golang programs, and to compile the whole thing using custom Makefiles and cgo. Here is a recent example that I wrote: https://github.com/loicgelle/jaeger-go-lttng-instr <https://github.com/loicgelle/jaeger-go-lttng-instr>

As you can guess, there are a low of drawbacks in that approach. It is actually a hack and cannot be integrated into more complex Golang program that use a more complex build process (e.g. the Golang runtime itself), because of the compiler instructions that you have to include at the top of the Golang files. There is also a big concern about the performance of this solution, as calling a C function from Go requires to do a full context switch on the stack, because the calling conventions in C and Golang are different.

I think a more integrated and performant solution is needed. We can’t really ignore a language such as Golang that is now widely adopted for cloud applications. LTTng is really the best solution out there in terms of overhead per tracepoint, and could benefit from being made available to such a large community. My question to the experts on this mailing list: how much would it take to write a Golang agent for LTTng?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.lttng.org/pipermail/lttng-dev/attachments/20180504/e8de3069/attachment.html>

More information about the lttng-dev mailing list