File: ps.proto

package info (click to toggle)
android-platform-frameworks-base 1%3A10.0.0%2Br36-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 321,788 kB
  • sloc: java: 962,234; cpp: 274,314; xml: 242,770; python: 5,060; sh: 1,432; ansic: 494; makefile: 47; sed: 19
file content (117 lines) | stat: -rw-r--r-- 4,303 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/*
 * Copyright (C) 2017 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

syntax = "proto2";

package android.os;

option java_multiple_files = true;

import "frameworks/base/core/proto/android/privacy.proto";

message PsProto {
    option (android.msg_privacy).dest = DEST_AUTOMATIC;

    message Process {
        option (android.msg_privacy).dest = DEST_AUTOMATIC;

        // Security label, most commonly used for SELinux context data.
        optional string label = 1;
        // String representation of uid.
        optional string user = 2;
        // Process ID number.
        optional int32 pid = 3;
        // The unique number representing a dispatchable entity (alias lwp,
        // spid).  This value may also appear as: a process ID (pid); a process
        // group ID (pgrp); a session ID for the session leader (sid); a thread
        // group ID for the thread group leader (tgid); and a tty process group
        // ID for the process group leader (tpgid).
        optional int32 tid = 4;
        // Parent process ID.
        optional int32 ppid = 5;
        // Virtual set size (memory size) of the process, in KiB.
        optional int32 vsz = 6;
        // Resident set size. How many physical pages are associated with the
        // process; real memory usage, in KiB.
        optional int32 rss = 7;
        // Name of the kernel function in which the process is sleeping, a "-"
        // if the process is running, or a "*" if the process is multi-threaded
        // and ps is not displaying threads.
        optional string wchan = 8;
        // Memory address of the process.
        optional string addr = 9 [ (android.privacy).dest = DEST_LOCAL ];

        enum ProcessStateCode {
            STATE_UNKNOWN = 0;
            // Uninterruptible sleep (usually IO).
            STATE_D = 1;
            // Running or runnable (on run queue).
            STATE_R = 2;
            // Interruptible sleep (waiting for an event to complete).
            STATE_S = 3;
            // Stopped by job control signal.
            STATE_T = 4;
            // Stopped by debugger during the tracing.
            STATE_TRACING = 5;
            // Dead (should never be seen).
            STATE_X = 6;
            // Defunct ("zombie") process. Terminated but not reaped by its
            // parent.
            STATE_Z = 7;
        }
        // Minimal state display
        optional ProcessStateCode s = 10;
        // Priority of the process. Higher number means lower priority.
        optional int32 pri = 11;
        // Nice value. This ranges from 19 (nicest) to -20 (not nice to others).
        optional sint32 ni = 12;
        // Realtime priority.
        optional string rtprio = 13; // Number or -

        enum SchedulingPolicy {
            option allow_alias = true;

            // Regular names conflict with macros defined in
            // bionic/libc/kernel/uapi/linux/sched.h.
            SCH_OTHER = 0;
            SCH_NORMAL = 0;

            SCH_FIFO = 1;
            SCH_RR = 2;
            SCH_BATCH = 3;
            SCH_ISO = 4;
            SCH_IDLE = 5;
        }
        // Scheduling policy of the process.
        optional SchedulingPolicy sch = 14;

        // How Android memory manager will treat the task
        enum Policy {
            POLICY_UNKNOWN = 0;
            // Foreground.
            POLICY_FG = 1;
            // Background.
            POLICY_BG = 2;
            POLICY_TA = 3;  // TODO: figure out what this value is
        }
        optional Policy pcy = 15;
        // Total CPU time, "[DD-]HH:MM:SS" format.
        optional string time = 16;
        // Command with all its arguments as a string.
        optional string cmd = 17;
    }
    repeated Process processes = 1;
}