Re: [go-nuts] [RFC] Dynamically instrumentation Go binaries

2018-11-19 Thread Julio Guerra
On Thu, Nov 15, 2018 at 9:57 PM Tristan Colgate wrote: > Maybe you mean something like support for linux uprobes? > There is some discussion here: > https://github.com/golang/go/issues/22008 > Google for "golang uprobes" picks up a couple of other links: > >

Re: [go-nuts] [RFC] Dynamically instrumentation Go binaries

2018-11-19 Thread Julio Guerra
On Thu, Nov 15, 2018 at 7:55 PM Michael Jones wrote: > You could study Rob Pike’s coverage/profiling tool to see how he adds and > exploits basic block counting. Good work as always. > Good idea, thanks. I had a look at the implementation of it, and at the way it is integrated into the go

Re: [go-nuts] [RFC] Dynamically instrumentation Go binaries

2018-11-15 Thread robert engels
Even if you could get uprobes to work, I think you will still have problems with inlining, and if you are going to compile with inlining disabled, etc. you might as well use Pike’s “coverage” method. > On Nov 15, 2018, at 3:23 PM, robert engels wrote: > > Can’t you just ptrace the process,

Re: [go-nuts] [RFC] Dynamically instrumentation Go binaries

2018-11-15 Thread robert engels
Can’t you just ptrace the process, and use the ptrace related tools ? > On Nov 15, 2018, at 2:56 PM, Tristan Colgate wrote: > > Maybe you mean something like support for linux uprobes? > There is some discussion here: > https://github.com/golang/go/issues/22008 >

Re: [go-nuts] [RFC] Dynamically instrumentation Go binaries

2018-11-15 Thread Tristan Colgate
Maybe you mean something like support for linux uprobes? There is some discussion here: https://github.com/golang/go/issues/22008 Google for "golang uprobes" picks up a couple of other links: http://www.brendangregg.com/blog/2017-01-31/golang-bcc-bpf-function-tracing.html

Re: [go-nuts] [RFC] Dynamically instrumentation Go binaries

2018-11-15 Thread robert engels
Pike’s “coverage" uses source code rewriting and recompiling, so it is not dynamic instrumentation - at least how I would define it. Dynamic instrumentation to me means to instrument at runtime on an existing binary/distribution. > On Nov 15, 2018, at 12:55 PM, Michael Jones wrote: > > You

Re: [go-nuts] [RFC] Dynamically instrumentation Go binaries

2018-11-15 Thread Michael Jones
You could study Rob Pike’s coverage/profiling tool to see how he adds and exploits basic block counting. Good work as always. On Thu, Nov 15, 2018 at 9:34 AM Robert Engels wrote: > AFAIK dtrace support is compiled in. If not enabled there are some tricks > to make is essentially zero cost, but

Re: [go-nuts] [RFC] Dynamically instrumentation Go binaries

2018-11-15 Thread Robert Engels
AFAIK dtrace support is compiled in. If not enabled there are some tricks to make is essentially zero cost, but it is still there from the start. Could be wrong but that’s my understanding. Sent from my iPhone > On Nov 15, 2018, at 11:27 AM, Steven Hartland wrote: > > dtrace support? > >>

Re: [go-nuts] [RFC] Dynamically instrumentation Go binaries

2018-11-15 Thread Steven Hartland
dtrace support? On 15/11/2018 16:51, ju...@sqreen.io wrote: Hi, I am working on dynamic instrumentation of Go programs at run time, possibly without static source-code instrumentation. As I would like a solution as close to Go and standard as possible, I was first thinking of using `go

Re: [go-nuts] [RFC] Dynamically instrumentation Go binaries

2018-11-15 Thread Robert Engels
Go is statically compiled. Pretty sure you cant do dynamic instrumentation - like logging method entry and exit - much of this is even lost due to inlining. You could possibly have an instrumented stdlib and dynamically link to that, but that is still not dynamic instrumentation. The profiler

[go-nuts] [RFC] Dynamically instrumentation Go binaries

2018-11-15 Thread julio
Hi, I am working on dynamic instrumentation of Go programs at run time, possibly without static source-code instrumentation. As I would like a solution as close to Go and standard as possible, I was first thinking of using `go generate` to generate a file adding things `reflect` doesn't