process-cpp 3.0.0
A simple convenience library for handling processes in C++11.
stat.h
Go to the documentation of this file.
1/*
2 * Copyright © 2012-2013 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Thomas Voß <thomas.voss@canonical.com>
17 */
18#ifndef CORE_POSIX_LINUX_PROC_PROCESS_STAT_H_
19#define CORE_POSIX_LINUX_PROC_PROCESS_STAT_H_
20
22
24
25#include <string>
26
27namespace core
28{
29namespace posix
30{
31class Process;
32namespace linux
33{
34namespace proc
35{
36namespace process
37{
42{
43 pid_t pid = 1;
44 std::string executable;
46 pid_t parent = -1;
47 pid_t process_group = -1;
48 int session_id = -1;
49 int tty_nr = -1;
51 unsigned int kernel_flags = 0;
52 long unsigned int minor_faults_count = 0;
53 long unsigned int minor_faults_count_by_children = 0;
54 long unsigned int major_faults_count = 0;
55 long unsigned int major_faults_count_by_children = 0;
56 struct
57 {
58 long unsigned int user = 0;
59 long unsigned int system = 0;
60 long unsigned int user_for_children = 0;
61 long unsigned int system_for_children = 0;
62 } time;
76 long int priority = 0;
77 long int nice = 0;
78 long int thread_count = 0;
80 long int start_time = 0;
81 struct
82 {
83 long unsigned int virt = 0;
84 long unsigned int resident_set = 0;
85 long unsigned int resident_set_limit = 0;
86 } size;
87 struct
88 {
89 long unsigned int start_code = 0;
90 long unsigned int end_code = 0;
91 long unsigned int start_stack = 0;
92 long unsigned int stack_pointer = 0;
93 long unsigned int instruction_pointer = 0;
94 } addresses;
95 struct
96 {
97 long unsigned int pending = 0;
98 long unsigned int blocked = 0;
99 long unsigned int ignored = 0;
100 long unsigned int caught = 0;
101 } signals;
102 long unsigned int channel = 0;
103 long unsigned int swap_count = 0;
104 long unsigned int swap_count_children = 0;
105 int exit_signal = -1;
106 int cpu_count = -1;
107 unsigned int realtime_priority = 0;
108 unsigned int scheduling_policy = 0;
109 long long unsigned int aggregated_block_io_delays = 0;
110 long unsigned int guest_time = 0;
111 long unsigned int guest_time_children = 0;
112};
113
115}
116}
117}
118}
119}
120#endif // CORE_POSIX_LINUX_PROC_PROCESS_STAT_H_
The Process class models a process and possible operations on it.
Definition process.h:45
CORE_POSIX_DLL_PUBLIC const posix::Process & operator>>(const posix::Process &process, OomAdj &adj)
Read the OomAdj value for a process instance.
Definition oom_adj.cpp:55
The Stat struct encapsulates status information about a process.
Definition stat.h:42
State state
State of the process.
Definition stat.h:45
int exit_signal
Signal to be sent to parent when we die.
Definition stat.h:105
long unsigned int guest_time_children
Guest time of the process's children, measured in clock ticks.
Definition stat.h:111
long int thread_count
Number of threads in this process (since Linux 2.6).
Definition stat.h:78
long unsigned int major_faults_count_by_children
The number of major faults that the process's waited-for children have made.
Definition stat.h:55
long unsigned int channel
This is the "channel" in which the process is waiting. It is the address of a system call,...
Definition stat.h:102
pid_t parent
The PID of the parent.
Definition stat.h:46
long unsigned int major_faults_count
The number of major faults the process has made which have required loading a memory page from disk.
Definition stat.h:54
int session_id
The session ID of the process.
Definition stat.h:48
long int nice
The nice value (see setpriority(2)), a value in the range 19 (low priority) to -20 (high priority).
Definition stat.h:77
long unsigned int resident_set
Resident Set Size: number of pages the process has in real memory. This is just the pages which count...
Definition stat.h:84
long long unsigned int aggregated_block_io_delays
Aggregated block I/O delays, measured in clock ticks (centiseconds).
Definition stat.h:109
long unsigned int minor_faults_count_by_children
The number of minor faults that the process's waited-for children have made.
Definition stat.h:53
std::string executable
The filename of the executable, in parentheses.
Definition stat.h:44
pid_t process_group
The process group ID of the process.
Definition stat.h:47
long unsigned int system_for_children
Amount of time that this process's waited-for children have been scheduled in kernel mode,...
Definition stat.h:61
long unsigned int swap_count
Number of pages swapped (not maintained).
Definition stat.h:103
long unsigned int swap_count_children
Cumulative nswap for child processes (not maintained).
Definition stat.h:104
long unsigned int blocked
The bitmap of blocked signals, displayed as a decimal number. Obsolete, because it does not provide i...
Definition stat.h:98
long unsigned int minor_faults_count
The number of minor faults the process has made which have not required loading a memory page from di...
Definition stat.h:52
long unsigned int start_stack
The address of the start (i.e., bottom) of the stack.
Definition stat.h:91
long unsigned int instruction_pointer
The current EIP (instruction pointer).
Definition stat.h:93
unsigned int kernel_flags
The kernel flags word of the process.
Definition stat.h:51
long unsigned int caught
The bitmap of caught signals, displayed as a decimal number. Obsolete, because it does not provide in...
Definition stat.h:100
long unsigned int end_code
The address below which program text can run.
Definition stat.h:90
long unsigned int system
Amount of time that this process has been scheduled in kernel mode, [clock ticks].
Definition stat.h:59
long unsigned int stack_pointer
The current value of ESP (stack pointer), as found in the kernel stack page for the process.
Definition stat.h:92
long unsigned int pending
The bitmap of pending signals, displayed as a decimal number. Obsolete, because it does not provide i...
Definition stat.h:97
long unsigned int virt
Virtual memory size in bytes.
Definition stat.h:83
long unsigned int guest_time
Guest time of the process (time spent running a virtual CPU for a guest operating system),...
Definition stat.h:110
int cpu_count
CPU number last executed on.
Definition stat.h:106
int tty_nr
The controlling terminal of the process.
Definition stat.h:49
int controlling_process_group
The ID of the foreground process group of the controlling terminal of the process.
Definition stat.h:50
long int start_time
The time the process started after system boot. In kernels before Linux 2.6, this value was expressed...
Definition stat.h:80
long unsigned int start_code
The address above which program text can run.
Definition stat.h:89
long unsigned int resident_set_limit
Current soft limit in bytes on the rss of the process; see the description of RLIMIT_RSS in getrlimit...
Definition stat.h:85
unsigned int realtime_priority
Real-time scheduling priority, a number in the range 1 to 99 for processes scheduled under a real-tim...
Definition stat.h:107
long unsigned int user_for_children
Amount of time that this process's waited-for children have been scheduled in user mode,...
Definition stat.h:60
long unsigned int user
Amount of time that this process has been scheduled in user mode, [clock ticks].
Definition stat.h:58
unsigned int scheduling_policy
Scheduling policy (see sched_setscheduler(2)). Decode using the SCHED_* constants in linux/sched....
Definition stat.h:108
long unsigned int ignored
The bitmap of ignored signals, displayed as a decimal number. Obsolete, because it does not provide i...
Definition stat.h:99
long int time_before_next_sig_alarm
The time in jiffies before the next SIGALRM is sent to the process due to an interval timer....
Definition stat.h:79
#define CORE_POSIX_DLL_PUBLIC
Definition visibility.h:26