aboutsummaryrefslogtreecommitdiff
path: root/src/testing/benchmark.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/benchmark.go')
-rw-r--r--src/testing/benchmark.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/testing/benchmark.go b/src/testing/benchmark.go
index ac9ca58397..bef1492cd6 100644
--- a/src/testing/benchmark.go
+++ b/src/testing/benchmark.go
@@ -506,14 +506,17 @@ func (b *B) Run(name string, f func(b *B)) bool {
if !ok {
return true
}
+ var pc [maxStackLen]uintptr
+ n := runtime.Callers(2, pc[:])
sub := &B{
common: common{
- signal: make(chan bool),
- name: benchName,
- parent: &b.common,
- level: b.level + 1,
- w: b.w,
- chatty: b.chatty,
+ signal: make(chan bool),
+ name: benchName,
+ parent: &b.common,
+ level: b.level + 1,
+ creator: pc[:n],
+ w: b.w,
+ chatty: b.chatty,
},
importPath: b.importPath,
benchFunc: f,