diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2022-03-10 09:28:09 +0100 |
---|---|---|
committer | Tobias Klauser <tobias.klauser@gmail.com> | 2022-03-11 06:03:26 +0000 |
commit | c1f22134f22158ebeebf450357f711eb22fab202 (patch) | |
tree | 4fe46483d6010f87e145a53b78c069bf641ce59c /src/syscall/zsyscall_solaris_amd64.go | |
parent | fe75fe3c7ae99713ed4e452ea8a4fcb589517dd9 (diff) | |
download | go-git-c1f22134f22158ebeebf450357f711eb22fab202.tar.gz |
runtime/pprof, syscall: report MaxRSS on all unix platforms
All unix platforms currently supported by Go provide the getrusage
syscall. On aix and solaris the Getrusage syscall wrapper is not
available yet, so add and use it to report MaxRSS in memory profiles.
Change-Id: Ie880a3058171031fd2e12ccf9adfb85ce18858b1
Reviewed-on: https://go-review.googlesource.com/c/go/+/391434
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Trust: Michael Pratt <mpratt@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/syscall/zsyscall_solaris_amd64.go')
-rw-r--r-- | src/syscall/zsyscall_solaris_amd64.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/syscall/zsyscall_solaris_amd64.go b/src/syscall/zsyscall_solaris_amd64.go index dad0580027..7b012bf9bb 100644 --- a/src/syscall/zsyscall_solaris_amd64.go +++ b/src/syscall/zsyscall_solaris_amd64.go @@ -35,6 +35,7 @@ import "unsafe" //go:cgo_import_dynamic libc_Getppid getppid "libc.so" //go:cgo_import_dynamic libc_Getpriority getpriority "libc.so" //go:cgo_import_dynamic libc_Getrlimit getrlimit "libc.so" +//go:cgo_import_dynamic libc_Getrusage getrusage "libc.so" //go:cgo_import_dynamic libc_Gettimeofday gettimeofday "libc.so" //go:cgo_import_dynamic libc_Getuid getuid "libc.so" //go:cgo_import_dynamic libc_Kill kill "libc.so" @@ -120,6 +121,7 @@ import "unsafe" //go:linkname libc_Getppid libc_Getppid //go:linkname libc_Getpriority libc_Getpriority //go:linkname libc_Getrlimit libc_Getrlimit +//go:linkname libc_Getrusage libc_Getrusage //go:linkname libc_Gettimeofday libc_Gettimeofday //go:linkname libc_Getuid libc_Getuid //go:linkname libc_Kill libc_Kill @@ -208,6 +210,7 @@ var ( libc_Getppid, libc_Getpriority, libc_Getrlimit, + libc_Getrusage, libc_Gettimeofday, libc_Getuid, libc_Kill, @@ -580,6 +583,16 @@ func Getrlimit(which int, lim *Rlimit) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Getrusage(who int, rusage *Rusage) (err error) { + _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Getrusage)), 2, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0, 0, 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Gettimeofday)), 1, uintptr(unsafe.Pointer(tv)), 0, 0, 0, 0, 0) if e1 != 0 { |