Since Windows does not distinguish between Major and Minor faults, all faults are treated as Major

pull/1769/head
Mingyang Zheng 1 week ago
parent 0be0ec4e46
commit a2f71c4078

@ -127,7 +127,6 @@ type PageFaultsStat struct {
MajorFaults uint64 `json:"majorFaults"`
ChildMinorFaults uint64 `json:"childMinorFaults"`
ChildMajorFaults uint64 `json:"childMajorFaults"`
TotalFaults uint64 `json:"totalFaults"`
}
// Resource limit constants are from /usr/include/x86_64-linux-gnu/bits/resource.h

@ -1135,7 +1135,6 @@ func (p *Process) fillFromTIDStatWithContext(ctx context.Context, tid int32) (ui
MajorFaults: majFault,
ChildMinorFaults: cMinFault,
ChildMajorFaults: cMajFault,
TotalFaults: minFault + majFault + cMinFault + cMajFault,
}
return terminal, int32(ppid), cpuTimes, createTime, uint32(rtpriority), nice, faults, nil

@ -658,7 +658,7 @@ func (p *Process) PageFaultsWithContext(ctx context.Context) (*PageFaultsStat, e
}
ret := &PageFaultsStat{
TotalFaults: uint64(mem.PageFaultCount),
MajorFaults: uint64(mem.PageFaultCount), //Since Windows does not distinguish between Major and Minor faults, all faults are treated as Major
}
return ret, nil

Loading…
Cancel
Save