Add atom for per-process system ion heap size

The pulling code will be added in the next commit.

Bug: 130526489
Test: statsd_testdrive
Change-Id: I0fea4b6a7a8dbbdc574fb342c1e07aa0165bf797
(cherry picked from commit 77987ed47f)
This commit is contained in:
Rafal Slawik
2019-06-17 12:28:23 +01:00
parent 9af8d15783
commit 6d44d6dafa
3 changed files with 37 additions and 1 deletions

View File

@@ -322,7 +322,7 @@ message Atom {
}
// Pulled events will start at field 10000.
// Next: 10059
// Next: 10062
oneof pulled {
WifiBytesTransfer wifi_bytes_transfer = 10000;
WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
@@ -385,6 +385,7 @@ message Atom {
FaceSettings face_settings = 10058;
CoolingDevice cooling_device = 10059;
AppOps app_ops = 10060;
ProcessSystemIonHeapSize process_system_ion_heap_size = 10061;
}
// DO NOT USE field numbers above 100,000 in AOSP.
@@ -6369,6 +6370,28 @@ message SystemIonHeapSize {
optional int64 size_in_bytes = 1;
}
/*
* Logs the per-process size of the system ion heap.
*
* Pulled from StatsCompanionService.
*/
message ProcessSystemIonHeapSize {
// The uid if available. -1 means not available.
optional int32 uid = 1 [(is_uid) = true];
// The process name (from /proc/PID/cmdline).
optional string process_name = 2;
// Sum of sizes of all allocations.
optional int32 total_size_in_kilobytes = 3;
// Number of allocations.
optional int32 allocation_count = 4;
// Size of the largest allocation.
optional int32 max_size_in_kilobytes = 5;
}
/**
* Push network stack events.
*

View File

@@ -156,6 +156,9 @@ std::map<int, PullAtomInfo> StatsPullerManager::kAllPullAtomInfo = {
// system_ion_heap_size
{android::util::SYSTEM_ION_HEAP_SIZE,
{.puller = new StatsCompanionServicePuller(android::util::SYSTEM_ION_HEAP_SIZE)}},
// process_system_ion_heap_size
{android::util::PROCESS_SYSTEM_ION_HEAP_SIZE,
{.puller = new StatsCompanionServicePuller(android::util::PROCESS_SYSTEM_ION_HEAP_SIZE)}},
// temperature
{android::util::TEMPERATURE,
{.puller = new StatsCompanionServicePuller(android::util::TEMPERATURE)}},

View File

@@ -1271,6 +1271,12 @@ public class StatsCompanionService extends IStatsCompanionService.Stub {
pulledData.add(e);
}
private void pullProcessSystemIonHeapSize(
int tagId, long elapsedNanos, long wallClockNanos,
List<StatsLogEventWrapper> pulledData) {
// TODO(b/130526489): Read from debugfs.
}
private void pullBinderCallsStats(
int tagId, long elapsedNanos, long wallClockNanos,
List<StatsLogEventWrapper> pulledData) {
@@ -2333,6 +2339,10 @@ public class StatsCompanionService extends IStatsCompanionService.Stub {
pullSystemIonHeapSize(tagId, elapsedNanos, wallClockNanos, ret);
break;
}
case StatsLog.PROCESS_SYSTEM_ION_HEAP_SIZE: {
pullProcessSystemIonHeapSize(tagId, elapsedNanos, wallClockNanos, ret);
break;
}
case StatsLog.BINDER_CALLS: {
pullBinderCallsStats(tagId, elapsedNanos, wallClockNanos, ret);
break;