Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd465cca authored by Jeongik Cha's avatar Jeongik Cha
Browse files

Use Sec as well as Usec in ProcResInfo

Timeval has two fields: Sec and Usec, but in previous implementation, it
only uses Usec, so Sec data is abandoned.

Bug: 271526845
Test: check metric, and if seconds data is reserved.
Change-Id: I911467f77b41995f6c833099648fe62fbc9909eb
parent ba3a44dd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -135,8 +135,8 @@ func (t *EventTracer) AddProcResInfo(name string, state *os.ProcessState) {
	e := t.peek()
	e.procResInfo = append(e.procResInfo, &soong_metrics_proto.ProcessResourceInfo{
		Name:             proto.String(name),
		UserTimeMicros:   proto.Uint64(uint64(rusage.Utime.Usec)),
		SystemTimeMicros: proto.Uint64(uint64(rusage.Stime.Usec)),
		UserTimeMicros:   proto.Uint64(uint64(state.UserTime().Microseconds())),
		SystemTimeMicros: proto.Uint64(uint64(state.SystemTime().Microseconds())),
		MinorPageFaults:  proto.Uint64(uint64(rusage.Minflt)),
		MajorPageFaults:  proto.Uint64(uint64(rusage.Majflt)),
		// ru_inblock and ru_oublock are measured in blocks of 512 bytes.