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

Commit 272a8161 authored by Rafal Slawik's avatar Rafal Slawik
Browse files

Add process start time to ProcessMemoryState atom

Also, add the start time to non-additive in statsd.

Bug: 118249210
Test: manually verified values are included in a report
Change-Id: Ib91d4d0f416a1cbd298f4a010e8264a3e8f0ee16
parent 77b75008
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2399,6 +2399,10 @@ message ProcessMemoryState {
    // Peak RSS usage of the process. Value is read from the VmHWM field in /proc/PID/status or
    // from memory.max_usage_in_bytes under /dev/memcg if the device uses per-app memory cgroups.
    optional int64 rss_high_watermark_in_bytes = 9;

    // Elapsed real time when the process started.
    // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
    optional int64 start_time_nanos = 10;
}

/*
+3 −3
Original line number Diff line number Diff line
@@ -167,13 +167,13 @@ const std::map<int, PullAtomInfo> StatsPullerManager::kAllPullAtomInfo = {
        // process_memory_state
        {android::util::PROCESS_MEMORY_STATE,
         {{4, 5, 6, 7, 8, 9},
          {2, 3},
          {2, 3, 10},
          1 * NS_PER_SEC,
          new StatsCompanionServicePuller(android::util::PROCESS_MEMORY_STATE)}},
        // native_process_memory_state
        {android::util::NATIVE_PROCESS_MEMORY_STATE,
         {{3, 4, 5, 6, 7},
          {2},
         {{3, 4, 5, 6},
          {2, 7},
          1 * NS_PER_SEC,
          new StatsCompanionServicePuller(android::util::NATIVE_PROCESS_MEMORY_STATE)}},
        // temperature
+1 −0
Original line number Diff line number Diff line
@@ -1004,6 +1004,7 @@ public class StatsCompanionService extends IStatsCompanionService.Stub {
            e.writeLong(processMemoryState.cacheInBytes);
            e.writeLong(processMemoryState.swapInBytes);
            e.writeLong(processMemoryState.rssHighWatermarkInBytes);
            e.writeLong(processMemoryState.startTimeNanos);
            pulledData.add(e);
        }
    }