From ad600610dab2e4c1152e5bcfa04cca352cc9e972 Mon Sep 17 00:00:00 2001 From: braydonk Date: Tue, 2 Apr 2024 14:34:30 +0000 Subject: [PATCH] process: Add exported BootTimeWithContext --- process/process_linux.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/process/process_linux.go b/process/process_linux.go index 557435b..0138829 100644 --- a/process/process_linux.go +++ b/process/process_linux.go @@ -491,6 +491,10 @@ func (p *Process) EnvironWithContext(ctx context.Context) ([]string, error) { return strings.Split(string(environContent), "\000"), nil } +func BootTimeWithContext(ctx context.Context) (uint64, error) { + return common.BootTimeWithContext(ctx, enableBootTimeCache) +} + /** ** Internal functions **/ @@ -1071,7 +1075,7 @@ func (p *Process) fillFromTIDStatWithContext(ctx context.Context, tid int32) (ui Iowait: iotime / float64(clockTicks), } - bootTime, _ := common.BootTimeWithContext(ctx, enableBootTimeCache) + bootTime, _ := BootTimeWithContext(ctx) t, err := strconv.ParseUint(fields[22], 10, 64) if err != nil { return 0, 0, nil, 0, 0, 0, nil, err