Dynamic Go Instrumentation for Production Environments
summary
A pure-Go compiler proxy is built that uses go tool exec to intercept each package compile, rewrite source with inserted prologue/epilogue hooks, emit a generated hook table, and forward to the real compiler and linker. Runtime API finds symbols by function name, atomically attaches callbacks that can abort calls or mutate return values. Demo instruments println, the build reports 123 hooks (and the main binary shows ~1,000+ hooks) and the demo output matches expectations.
AI-written summary · about
chapters (7)
- 0:00Intro
- 1:20Application Security
- 3:12Dynamic Instrumentation
- 7:10Compiler Instrumentation
- 10:25Source Code Instrumentation
- 15:01Dynamic Go Instrumentation
- 17:16Demo
related talks
31mAdvancing Observability With Compile-Time Auto-Instrumentation in Golang
16mLightning Talks
30mDynamically Instrumenting Go Programs
23mCompile Time Code Weaving in Go, Large Systems Debugging/Profiling
33mInstrument Go Without Changing a Single Line
43mAutomatically Instrument Your Go Source Code with Orchestrion
43mDebugging Code Generation in Go
43mDeep dive into Go's build system
