| 1 | /* |
| 2 | This file is part of Mtproto-proxy Library. |
| 3 | |
| 4 | Mtproto-proxy Library is free software: you can redistribute it and/or modify |
| 5 | it under the terms of the GNU Lesser General Public License as published by |
| 6 | the Free Software Foundation, either version 2 of the License, or |
| 7 | (at your option) any later version. |
| 8 | |
| 9 | Mtproto-proxy Library is distributed in the hope that it will be useful, |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | GNU Lesser General Public License for more details. |
| 13 | |
| 14 | You should have received a copy of the GNU Lesser General Public License |
| 15 | along with Mtproto-proxy Library. If not, see <http://www.gnu.org/licenses/>. |
| 16 | |
| 17 | Copyright 2014 Telegram Messenger Inc |
| 18 | 2014 Vitaly Valtman |
| 19 | */ |
| 20 | #pragma once |
| 21 | |
| 22 | struct proc_stats { |
| 23 | int pid; // %d |
| 24 | char comm[256]; // %s |
| 25 | char state; // %c |
| 26 | int ppid; // %d |
| 27 | int pgrp; // %d |
| 28 | int session; // %d |
| 29 | int tty_nr; // %d |
| 30 | int tpgid; // %d |
| 31 | unsigned long flags; // %lu |
| 32 | unsigned long minflt; // %lu |
| 33 | unsigned long cminflt; // %lu |
| 34 | unsigned long majflt; // %lu |
| 35 | unsigned long cmajflt; // %lu |
| 36 | unsigned long utime; // %lu |
| 37 | unsigned long stime; // %lu |
| 38 | long cutime; // %ld |
| 39 | long cstime; // %ld |
| 40 | long priority; // %ld |
| 41 | long nice; // %ld |
| 42 | long num_threads; // %ld |
| 43 | long itrealvalue; // %ld |
| 44 | unsigned long starttime; // %lu |
| 45 | unsigned long vsize; // %lu |
| 46 | long ; // %ld |
| 47 | unsigned long rlim; // %lu |
| 48 | unsigned long startcode; // %lu |
| 49 | unsigned long endcode; // %lu |
| 50 | unsigned long startstack; // %lu |
| 51 | unsigned long kstkesp; // %lu |
| 52 | unsigned long kstkeip; // %lu |
| 53 | unsigned long signal; // %lu |
| 54 | unsigned long blocked; // %lu |
| 55 | unsigned long sigignore; // %lu |
| 56 | unsigned long sigcatch; // %lu |
| 57 | unsigned long wchan; // %lu |
| 58 | unsigned long nswap; // %lu |
| 59 | unsigned long cnswap; // %lu |
| 60 | int exit_signal; // %d |
| 61 | int processor; // %d |
| 62 | unsigned long rt_priority; // %lu |
| 63 | unsigned long policy; // %lu |
| 64 | unsigned long long delayacct_blkio_ticks; // %llu |
| 65 | }; |
| 66 | |
| 67 | int read_proc_stats (int pid, int tid, struct proc_stats *s); |
| 68 | |