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

Commit 93c871d5 authored by Rafal Slawik's avatar Rafal Slawik Committed by Android (Google) Code Review
Browse files

Merge "Add atom for per-process system ion heap size"

parents f3509b9a 77987ed4
Loading
Loading
Loading
Loading
+24 −1
Original line number Diff line number Diff line
@@ -312,7 +312,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;
@@ -375,6 +375,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.
@@ -6353,6 +6354,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.
 *
+3 −0
Original line number Diff line number Diff line
@@ -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)}},
+10 −0
Original line number Diff line number Diff line
@@ -1254,6 +1254,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) {
@@ -2317,6 +2323,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;