diff options
author | Austin Clements <austin@google.com> | 2017-09-22 15:16:26 -0400 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2017-09-22 22:17:15 +0000 |
commit | 229aaac19e041ac74ab043d6ef09c8406bb0a9e7 (patch) | |
tree | bfe5daa095c648c67152a4cfdc7365b55c203876 /src/runtime/mprof.go | |
parent | 8cb2952f2f9c80246572b951e2663e79962796c0 (diff) | |
download | go-229aaac19e041ac74ab043d6ef09c8406bb0a9e7.tar.gz go-229aaac19e041ac74ab043d6ef09c8406bb0a9e7.zip |
runtime: remove getcallerpc argument
Now that getcallerpc is a compiler intrinsic on x86 and non-x86
platforms don't need the argument, we can drop it.
Sadly, this doesn't let us remove any dummy arguments since all of
those cases also use getcallersp, which still takes the argument
pointer, but this is at least an improvement.
Change-Id: I9c34a41cf2c18cba57f59938390bf9491efb22d2
Reviewed-on: https://go-review.googlesource.com/65474
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/runtime/mprof.go')
-rw-r--r-- | src/runtime/mprof.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/runtime/mprof.go b/src/runtime/mprof.go index 2bd09b6a26..259473c9ce 100644 --- a/src/runtime/mprof.go +++ b/src/runtime/mprof.go @@ -596,7 +596,7 @@ func record(r *MemProfileRecord, b *bucket) { r.AllocObjects = int64(mp.active.allocs) r.FreeObjects = int64(mp.active.frees) if raceenabled { - racewriterangepc(unsafe.Pointer(&r.Stack0[0]), unsafe.Sizeof(r.Stack0), getcallerpc(unsafe.Pointer(&r)), funcPC(MemProfile)) + racewriterangepc(unsafe.Pointer(&r.Stack0[0]), unsafe.Sizeof(r.Stack0), getcallerpc(), funcPC(MemProfile)) } if msanenabled { msanwrite(unsafe.Pointer(&r.Stack0[0]), unsafe.Sizeof(r.Stack0)) @@ -644,7 +644,7 @@ func BlockProfile(p []BlockProfileRecord) (n int, ok bool) { r.Count = bp.count r.Cycles = bp.cycles if raceenabled { - racewriterangepc(unsafe.Pointer(&r.Stack0[0]), unsafe.Sizeof(r.Stack0), getcallerpc(unsafe.Pointer(&p)), funcPC(BlockProfile)) + racewriterangepc(unsafe.Pointer(&r.Stack0[0]), unsafe.Sizeof(r.Stack0), getcallerpc(), funcPC(BlockProfile)) } if msanenabled { msanwrite(unsafe.Pointer(&r.Stack0[0]), unsafe.Sizeof(r.Stack0)) @@ -741,7 +741,7 @@ func GoroutineProfile(p []StackRecord) (n int, ok bool) { // Save current goroutine. sp := getcallersp(unsafe.Pointer(&p)) - pc := getcallerpc(unsafe.Pointer(&p)) + pc := getcallerpc() systemstack(func() { saveg(pc, sp, gp, &r[0]) }) @@ -786,7 +786,7 @@ func Stack(buf []byte, all bool) int { if len(buf) > 0 { gp := getg() sp := getcallersp(unsafe.Pointer(&buf)) - pc := getcallerpc(unsafe.Pointer(&buf)) + pc := getcallerpc() systemstack(func() { g0 := getg() // Force traceback=1 to override GOTRACEBACK setting, @@ -826,7 +826,7 @@ func tracealloc(p unsafe.Pointer, size uintptr, typ *_type) { } if gp.m.curg == nil || gp == gp.m.curg { goroutineheader(gp) - pc := getcallerpc(unsafe.Pointer(&p)) + pc := getcallerpc() sp := getcallersp(unsafe.Pointer(&p)) systemstack(func() { traceback(pc, sp, 0, gp) @@ -846,7 +846,7 @@ func tracefree(p unsafe.Pointer, size uintptr) { gp.m.traceback = 2 print("tracefree(", p, ", ", hex(size), ")\n") goroutineheader(gp) - pc := getcallerpc(unsafe.Pointer(&p)) + pc := getcallerpc() sp := getcallersp(unsafe.Pointer(&p)) systemstack(func() { traceback(pc, sp, 0, gp) |