Merge "Add process start time to ProcessMemoryState atom"

This commit is contained in:
TreeHugger Robot
2018-11-01 18:19:56 +00:00
committed by Android (Google) Code Review
3 changed files with 8 additions and 3 deletions

View File

@@ -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;
}
/*

View File

@@ -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

View File

@@ -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);
}
}