Does golang support SystemTap well?

312 views
Skip to first unread message

nea...@gmail.com

unread,
Sep 19, 2017, 8:43:03 AM9/19/17
to golang-nuts
ENV :
     SystemTap version : 3.1/0.160
     Linux kernal : 3.10.0-229.el7.x86_64
     Golang : 1.8.3

Recently, I use SystemTap to do some tracing for a golang application. But it occurred many fatal error, e.g:

SIGILL: illegal instruction
PC=0x7fffffffe015 m=41 sigcode=2

...

SIGTRAP: trace trap
PC=0x7fffffffe001 m=45 sigcode=0

....


fatal error: unknown caller pc
....

Is the PC  corrupted by SystemTap? 
Or SystemTap make some conflict with go runtime?
The SystemTap 2.8 release say it support golang. Is it right? https://sourceware.org/ml/systemtap/2015-q2/msg00160.html

I search some topic related to this here, but those topics is obsoleted.Is there any newly update?

Thanks.

 

Ian Lance Taylor

unread,
Sep 19, 2017, 9:27:31 AM9/19/17
to nea...@gmail.com, golang-nuts
In Go 1.9 the Go compiler uses frame pointers by default. That should
at least give you better tracebacks.

I don't know where those signals are coming from, though. I don't
know why Go programs would not work with systemtap.

Ian

Aram Hăvărneanu

unread,
Sep 19, 2017, 11:41:57 AM9/19/17
to Ian Lance Taylor, nea...@gmail.com, golang-nuts
> I don't know why Go programs would not work with systemtap.

Because when tracing function call returns systemtap installs
trampolines in the return address slots. This confuses traceback,
which doesn't expect systemtap functions in the stack trace. It
also breaks stack frame copy for the same reason.

I don't know why the original SIGILL comes from exactly, but I have
experienced it also, among many other problems. Systemtap doesn't
work well with Go. In fact, a few years back it didn't work at all.
Systemtap uses the literal Go symbol names as C identifiers in the
generated C kernel driver (whtout mangling), which then didn't even
compile.

--
Aram Hăvărneanu

nea...@gmail.com

unread,
Sep 19, 2017, 10:57:02 PM9/19/17
to golang-nuts
Thanks your reply.

As I known, `pprof` only can tell your which function is busy on cpu, memory allocated/in-use and so on.
But It cannot tell you a function latency/elapsed, how long we wait on a mutex.
Is there any plan to add more feature in pprof ?

在 2017年9月19日星期二 UTC+8下午9:27:31,Ian Lance Taylor写道:

nea...@gmail.com

unread,
Sep 19, 2017, 11:04:17 PM9/19/17
to golang-nuts
Thanks your reply.

You say "Systemtap uses the literal Go symbol names as C identifiers".
But SystemTap 2.8 release say it support golang. It does do any adapting work for golang application? I cannot find more information for this.
Do you know any up to date information for this?

在 2017年9月19日星期二 UTC+8下午11:41:57,Aram Hăvărneanu写道:

Aram Hăvărneanu

unread,
Sep 20, 2017, 6:38:18 AM9/20/17
to nea...@gmail.com, golang-nuts
I would not use systemtap, its design is fundamentally flawed and
requires special kernels. Linux supports now eBPF in mainline, which
is a superior technical solution.

Note that NO TRACER can support function return tracing in Go
(including DTrace), for the reasons outlined above. In order to
support function return we would have to change the Go calling
convention.

--
Aram Hăvărneanu
Reply all
Reply to author
Forward
0 new messages