From 3c2e73c8c3323887e6b95f72adb6242b8727ba8b Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 11 Mar 2022 08:20:55 +0100 Subject: [PATCH] runtime/pprof: use syscall.RUSAGE_SELF Change-Id: Idc37429de5a48e708eda868ca7fa26b28620bac0 Reviewed-on: https://go-review.googlesource.com/c/go/+/391854 Trust: Tobias Klauser Run-TryBot: Tobias Klauser TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor --- src/runtime/pprof/pprof_rusage.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/pprof/pprof_rusage.go b/src/runtime/pprof/pprof_rusage.go index 7df81eca23c..984a32e79d4 100644 --- a/src/runtime/pprof/pprof_rusage.go +++ b/src/runtime/pprof/pprof_rusage.go @@ -28,6 +28,6 @@ func addMaxRSS(w io.Writer) { } var rusage syscall.Rusage - syscall.Getrusage(0, &rusage) + syscall.Getrusage(syscall.RUSAGE_SELF, &rusage) fmt.Fprintf(w, "# MaxRSS = %d\n", uintptr(rusage.Maxrss)*rssToBytes) }