From 4e81681ab397520daa2da375ebb31992857e41ee Mon Sep 17 00:00:00 2001 From: Tyler Dixon Date: Fri, 24 May 2019 09:48:27 -0700 Subject: [PATCH] code review --- internal/common/common_linux.go | 5 ----- process/process_linux.go | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/internal/common/common_linux.go b/internal/common/common_linux.go index 415c848..29a9be7 100644 --- a/internal/common/common_linux.go +++ b/internal/common/common_linux.go @@ -49,11 +49,6 @@ func NumProcs() (uint64, error) { // cachedBootTime must be accessed via atomic.Load/StoreUint64 var cachedBootTime uint64 -// BootTime returns the system boot time expressed in seconds since the epoch. -func BootTime() (uint64, error) { - return BootTimeWithContext(context.Background()) -} - func BootTimeWithContext(ctx context.Context) (uint64, error) { t := atomic.LoadUint64(&cachedBootTime) if t != 0 { diff --git a/process/process_linux.go b/process/process_linux.go index 49e5829..c3d2c12 100644 --- a/process/process_linux.go +++ b/process/process_linux.go @@ -1235,7 +1235,7 @@ func (p *Process) fillFromTIDStatWithContext(ctx context.Context, tid int32) (ui System: float64(stime / ClockTicks), } - bootTime, _ := common.BootTime() + bootTime, _ := common.BootTimeWithContext(ctx) t, err := strconv.ParseUint(fields[i+20], 10, 64) if err != nil { return 0, 0, nil, 0, 0, 0, nil, err