aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/symtab.go
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2022-09-30 17:08:43 -0400
committerMichael Pratt <mpratt@google.com>2022-10-14 14:48:40 +0000
commita401468b0092446d537edc2000c23e8015ce6b58 (patch)
tree38b59e415f489ac13d4ba25ff9c384dfcc9ae2a3 /src/runtime/symtab.go
parentf2656f20ea420ada5f15ef06ddf18d2797e18841 (diff)
downloadgo-a401468b0092446d537edc2000c23e8015ce6b58.tar.xz
runtime/pprof: set Function.start_line field
Now that we plumb the start line to the runtime, we can include in pprof files. Since runtime.Frame.startLine is not (currently) exported, we need a runtime helper to get the value. For #55022. Updates #56135. Change-Id: Ifc5b68a7b7170fd7895e4099deb24df7977b22ea Reviewed-on: https://go-review.googlesource.com/c/go/+/438255 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/symtab.go')
-rw-r--r--src/runtime/symtab.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go
index 920ec12d54..f47f96dd0f 100644
--- a/src/runtime/symtab.go
+++ b/src/runtime/symtab.go
@@ -170,6 +170,13 @@ func (ci *Frames) Next() (frame Frame, more bool) {
return
}
+// runtime_FrameStartLine returns the start line of the function in a Frame.
+//
+//go:linkname runtime_FrameStartLine runtime/pprof.runtime_FrameStartLine
+func runtime_FrameStartLine(f *Frame) int {
+ return f.startLine
+}
+
// runtime_expandFinalInlineFrame expands the final pc in stk to include all
// "callers" if pc is inline.
//