summaryrefslogtreecommitdiff
path: root/vendor/google.golang.org/grpc/internal/syscall
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-07-01 19:53:51 +0200
committerPaul Holzinger <pholzing@redhat.com>2021-07-02 17:36:30 +0200
commit924cd37a37f1c58911ce7bc10b82ec9579c5c70e (patch)
tree915c05707555d02ca272036b5bbd55b7d3b41a9a /vendor/google.golang.org/grpc/internal/syscall
parent04209873562dff25c5d6f800e4a535dff18d485a (diff)
downloadpodman-924cd37a37f1c58911ce7bc10b82ec9579c5c70e.tar.gz
podman-924cd37a37f1c58911ce7bc10b82ec9579c5c70e.tar.bz2
podman-924cd37a37f1c58911ce7bc10b82ec9579c5c70e.zip
Bump github.com/spf13/cobra to v1.2.1
Fixes #9730 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'vendor/google.golang.org/grpc/internal/syscall')
-rw-r--r--vendor/google.golang.org/grpc/internal/syscall/syscall_linux.go20
-rw-r--r--vendor/google.golang.org/grpc/internal/syscall/syscall_nonlinux.go2
2 files changed, 10 insertions, 12 deletions
diff --git a/vendor/google.golang.org/grpc/internal/syscall/syscall_linux.go b/vendor/google.golang.org/grpc/internal/syscall/syscall_linux.go
index 2fdcb76e6..4b2964f2a 100644
--- a/vendor/google.golang.org/grpc/internal/syscall/syscall_linux.go
+++ b/vendor/google.golang.org/grpc/internal/syscall/syscall_linux.go
@@ -44,25 +44,23 @@ func GetCPUTime() int64 {
}
// Rusage is an alias for syscall.Rusage under linux environment.
-type Rusage syscall.Rusage
+type Rusage = syscall.Rusage
// GetRusage returns the resource usage of current process.
-func GetRusage() (rusage *Rusage) {
- rusage = new(Rusage)
- syscall.Getrusage(syscall.RUSAGE_SELF, (*syscall.Rusage)(rusage))
- return
+func GetRusage() *Rusage {
+ rusage := new(Rusage)
+ syscall.Getrusage(syscall.RUSAGE_SELF, rusage)
+ return rusage
}
// CPUTimeDiff returns the differences of user CPU time and system CPU time used
// between two Rusage structs.
func CPUTimeDiff(first *Rusage, latest *Rusage) (float64, float64) {
- f := (*syscall.Rusage)(first)
- l := (*syscall.Rusage)(latest)
var (
- utimeDiffs = l.Utime.Sec - f.Utime.Sec
- utimeDiffus = l.Utime.Usec - f.Utime.Usec
- stimeDiffs = l.Stime.Sec - f.Stime.Sec
- stimeDiffus = l.Stime.Usec - f.Stime.Usec
+ utimeDiffs = latest.Utime.Sec - first.Utime.Sec
+ utimeDiffus = latest.Utime.Usec - first.Utime.Usec
+ stimeDiffs = latest.Stime.Sec - first.Stime.Sec
+ stimeDiffus = latest.Stime.Usec - first.Stime.Usec
)
uTimeElapsed := float64(utimeDiffs) + float64(utimeDiffus)*1.0e-6
diff --git a/vendor/google.golang.org/grpc/internal/syscall/syscall_nonlinux.go b/vendor/google.golang.org/grpc/internal/syscall/syscall_nonlinux.go
index adae60d65..7913ef1db 100644
--- a/vendor/google.golang.org/grpc/internal/syscall/syscall_nonlinux.go
+++ b/vendor/google.golang.org/grpc/internal/syscall/syscall_nonlinux.go
@@ -50,7 +50,7 @@ func GetCPUTime() int64 {
type Rusage struct{}
// GetRusage is a no-op function under non-linux or appengine environment.
-func GetRusage() (rusage *Rusage) {
+func GetRusage() *Rusage {
log()
return nil
}