devname.h   devname.h 
skipping to change at line 13 skipping to change at line 13
#include "procps.h" #include "procps.h"
#include "readproc.h" #include "readproc.h"
EXTERN_C_BEGIN EXTERN_C_BEGIN
#define ABBREV_DEV 1 /* remove /dev/ */ #define ABBREV_DEV 1 /* remove /dev/ */
#define ABBREV_TTY 2 /* remove tty */ #define ABBREV_TTY 2 /* remove tty */
#define ABBREV_PTS 4 /* remove pts/ */ #define ABBREV_PTS 4 /* remove pts/ */
extern unsigned dev_to_tty(char *restrict ret, unsigned chop, dev_t dev_t_d ev, int pid, unsigned int flags); extern unsigned dev_to_tty(char *__restrict ret, unsigned chop, dev_t dev_t _dev, int pid, unsigned int flags);
extern int tty_to_dev(const char *restrict const name); extern int tty_to_dev(const char *__restrict const name);
EXTERN_C_END EXTERN_C_END
#endif #endif
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 escape.h   escape.h 
skipping to change at line 17 skipping to change at line 17
#include "readproc.h" #include "readproc.h"
EXTERN_C_BEGIN EXTERN_C_BEGIN
#define ESC_STRETCH 1 // since we mangle to '?' this is 1 (would be 4 for octal escapes) #define ESC_STRETCH 1 // since we mangle to '?' this is 1 (would be 4 for octal escapes)
#define ESC_ARGS 0x1 // try to use cmdline instead of cmd #define ESC_ARGS 0x1 // try to use cmdline instead of cmd
#define ESC_BRACKETS 0x2 // if using cmd, put '[' and ']' around it #define ESC_BRACKETS 0x2 // if using cmd, put '[' and ']' around it
#define ESC_DEFUNCT 0x4 // mark zombies with " <defunct>" #define ESC_DEFUNCT 0x4 // mark zombies with " <defunct>"
extern int escape_strlist(char *restrict dst, char *restrict const *restric extern int escape_strlist(char *__restrict dst, char *__restrict const *__r
t src, size_t n, int *cells); estrict src, size_t n, int *cells);
extern int escape_str(char *restrict dst, const char *restrict src, int buf extern int escape_str(char *__restrict dst, const char *__restrict src, int
size, int *maxcells); bufsize, int *maxcells);
extern int escape_command(char *restrict const outbuf, const proc_t *restri extern int escape_command(char *__restrict const outbuf, const proc_t *__re
ct const pp, int bytes, int *cells, unsigned flags); strict const pp, int bytes, int *cells, unsigned flags);
extern int escaped_copy(char *restrict dst, const char *restrict src, int b extern int escaped_copy(char *__restrict dst, const char *__restrict src, i
ufsize, int *maxroom); nt bufsize, int *maxroom);
EXTERN_C_END EXTERN_C_END
#endif #endif
 End of changes. 1 change blocks. 
8 lines changed or deleted 8 lines changed or added


 procps.h   procps.h 
skipping to change at line 36 skipping to change at line 36
// __mips_eabi means eabi, which comes in both sizes, but isn't used. // __mips_eabi means eabi, which comes in both sizes, but isn't used.
// //
// PowerPC: Big ugly problem! 32-bit Macs are still popular. :-/ // PowerPC: Big ugly problem! 32-bit Macs are still popular. :-/
// //
// x86-64: So far, nobody has been dumb enough to go 32-bit. // x86-64: So far, nobody has been dumb enough to go 32-bit.
// //
// Unknown: PA-RISC and zSeries // Unknown: PA-RISC and zSeries
// //
#if defined(k64test) || (defined(_ABIN32) && _MIPS_SIM == _ABIN32) #if defined(k64test) || (defined(_ABIN32) && _MIPS_SIM == _ABIN32)
#define KLONG long long // not typedef; want "unsigned KLONG" to work #define KLONG long long // not typedef; want "unsigned KLONG" to work
#define KLF "L" #define KLF "ll"
#define STRTOUKL strtoull #define STRTOUKL strtoull
#else #else
#define KLONG long #define KLONG long
#define KLF "l" #define KLF "l"
#define STRTOUKL strtoul #define STRTOUKL strtoul
#endif #endif
// since gcc-2.5 // since gcc-2.5
#define NORETURN __attribute__((__noreturn__)) #define NORETURN __attribute__((__noreturn__))
#define FUNCTION __attribute__((__const__)) // no access to global mem, ev en via ptr, and no side effect #define FUNCTION __attribute__((__const__)) // no access to global mem, ev en via ptr, and no side effect
skipping to change at line 105 skipping to change at line 105
// Like HIDDEN, but for an alias that gets created. // Like HIDDEN, but for an alias that gets created.
// In gcc-3.2 there is an alias+hidden conflict. // In gcc-3.2 there is an alias+hidden conflict.
// Many will have patched this bug, but oh well. // Many will have patched this bug, but oh well.
#if ( __GNUC__ == 3 && __GNUC_MINOR__ > 2 ) || __GNUC__ > 3 #if ( __GNUC__ == 3 && __GNUC_MINOR__ > 2 ) || __GNUC__ > 3
#define HIDDEN_ALIAS(x) extern __typeof(x) x##_direct __attribute__((alias( #x),visibility("hidden"))) #define HIDDEN_ALIAS(x) extern __typeof(x) x##_direct __attribute__((alias( #x),visibility("hidden")))
#else #else
#define HIDDEN_ALIAS(x) extern __typeof(x) x##_direct __attribute__((alias( #x))) #define HIDDEN_ALIAS(x) extern __typeof(x) x##_direct __attribute__((alias( #x)))
#endif #endif
typedef void (*message_fn)(const char *restrict, ...) __attribute__((format (printf,1,2))); typedef void (*message_fn)(const char *__restrict, ...) __attribute__((form at(printf,1,2)));
#endif #endif
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 readproc.h   readproc.h 
skipping to change at line 43 skipping to change at line 43
// Basic data structure which holds all information we can get about a proc ess. // Basic data structure which holds all information we can get about a proc ess.
// (unless otherwise specified, fields are read from /proc/#/stat) // (unless otherwise specified, fields are read from /proc/#/stat)
// //
// Most of it comes from task_struct in linux/sched.h // Most of it comes from task_struct in linux/sched.h
// //
typedef struct proc_t { typedef struct proc_t {
// 1st 16 bytes // 1st 16 bytes
int int
tid, // (special) task id, the POSIX thread ID (see also: tgid) tid, // (special) task id, the POSIX thread ID (see also: tgid)
ppid; // stat,status pid of parent process ppid; // stat,status pid of parent process
unsigned long // next 2 fields are NOT filled in by readproc
maj_delta, // stat (special) major page faults since last upda
te
min_delta; // stat (special) minor page faults since last upda
te
unsigned unsigned
pcpu; // stat (special) %CPU usage (is not filled in by readproc!!!) pcpu; // stat (special) %CPU usage (is not filled in by readproc!!!)
char char
state, // stat,status single-char code for process stat e (S=sleeping) state, // stat,status single-char code for process stat e (S=sleeping)
#ifdef QUICK_THREADS #ifdef QUICK_THREADS
pad_1, // n/a padding (psst, also used if mult i-threaded) pad_1, // n/a padding (psst, also used if mult i-threaded)
#else #else
pad_1, // n/a padding pad_1, // n/a padding
#endif #endif
pad_2, // n/a padding pad_2, // n/a padding
skipping to change at line 175 skipping to change at line 178
#define PROCPATHLEN 64 // must hold /proc/2000222000/task/2000222000/cmdli ne #define PROCPATHLEN 64 // must hold /proc/2000222000/task/2000222000/cmdli ne
typedef struct PROCTAB { typedef struct PROCTAB {
DIR* procfs; DIR* procfs;
// char deBug0[64]; // char deBug0[64];
DIR* taskdir; // for threads DIR* taskdir; // for threads
// char deBug1[64]; // char deBug1[64];
pid_t taskdir_user; // for threads pid_t taskdir_user; // for threads
int did_fake; // used when taskdir is missing int did_fake; // used when taskdir is missing
int(*finder)(struct PROCTAB *restrict const, proc_t *restrict const); int(*finder)(struct PROCTAB *__restrict const, proc_t *__restrict const
proc_t*(*reader)(struct PROCTAB *restrict const, proc_t *restrict const );
); proc_t*(*reader)(struct PROCTAB *__restrict const, proc_t *__restrict c
int(*taskfinder)(struct PROCTAB *restrict const, const proc_t *restrict onst);
const, proc_t *restrict const, char *restrict const); int(*taskfinder)(struct PROCTAB *__restrict const, const proc_t *__rest
proc_t*(*taskreader)(struct PROCTAB *restrict const, const proc_t *rest rict const, proc_t *__restrict const, char *__restrict const);
rict const, proc_t *restrict const, char *restrict const); proc_t*(*taskreader)(struct PROCTAB *__restrict const, const proc_t *__
restrict const, proc_t *__restrict const, char *__restrict const);
pid_t* pids; // pids of the procs pid_t* pids; // pids of the procs
uid_t* uids; // uids of procs uid_t* uids; // uids of procs
int nuid; // cannot really sentinel-terminate unsigned short[] int nuid; // cannot really sentinel-terminate unsigned short[]
int i; // generic int i; // generic
unsigned flags; unsigned flags;
unsigned u; // generic unsigned u; // generic
void * vp; // generic void * vp; // generic
char path[PROCPATHLEN]; // must hold /proc/2000222000/task/2000 222000/cmdline char path[PROCPATHLEN]; // must hold /proc/2000222000/task/2000 222000/cmdline
unsigned pathlen; // length of string in the above (w/o '\0') unsigned pathlen; // length of string in the above (w/o '\0')
} PROCTAB; } PROCTAB;
skipping to change at line 202 skipping to change at line 205
typedef struct proc_data_t { // valued by: (else zero) typedef struct proc_data_t { // valued by: (else zero)
proc_t **tab; // readproctab2, readproctab3 proc_t **tab; // readproctab2, readproctab3
proc_t **proc; // readproctab2 proc_t **proc; // readproctab2
proc_t **task; // * readproctab2 proc_t **task; // * readproctab2
int n; // readproctab2, readproctab3 int n; // readproctab2, readproctab3
int nproc; // readproctab2 int nproc; // readproctab2
int ntask; // * readproctab2 int ntask; // * readproctab2
} proc_data_t; // * when PROC_LOOSE_TASKS set } proc_data_t; // * when PROC_LOOSE_TASKS set
extern proc_data_t *readproctab2(int(*want_proc)(proc_t *buf), int(*want_ta extern proc_data_t *readproctab2(int(*want_proc)(proc_t *buf), int(*want_ta
sk)(proc_t *buf), PROCTAB *restrict const PT); sk)(proc_t *buf), PROCTAB *__restrict const PT);
extern proc_data_t *readproctab3(int(*want_task)(proc_t *buf), PROCTAB *res extern proc_data_t *readproctab3(int(*want_task)(proc_t *buf), PROCTAB *__r
trict const PT); estrict const PT);
// Convenient wrapper around openproc and readproc to slurp in the whole pr ocess // Convenient wrapper around openproc and readproc to slurp in the whole pr ocess
// table subset satisfying the constraints of flags and the optional PID li st. // table subset satisfying the constraints of flags and the optional PID li st.
// Free allocated memory with exit(). Access via tab[N]->member. The poin ter // Free allocated memory with exit(). Access via tab[N]->member. The poin ter
// list is NULL terminated. // list is NULL terminated.
extern proc_t** readproctab(int flags, ... /* same as openproc */ ); extern proc_t** readproctab(int flags, ... /* same as openproc */ );
// Clean-up open files, etc from the openproc() // Clean-up open files, etc from the openproc()
extern void closeproc(PROCTAB* PT); extern void closeproc(PROCTAB* PT);
// Retrieve the next process or task matching the criteria set by the openp roc(). // Retrieve the next process or task matching the criteria set by the openp roc().
// //
// Note: When NULL is used as the readproc 'p', readtask 't' or readeither 'x' // Note: When NULL is used as the readproc 'p', readtask 't' or readeither 'x'
// parameter, the library will allocate the necessary proc_t storage. // parameter, the library will allocate the necessary proc_t storage.
// //
// Alternatively, you may provide your own reuseable buffer address // Alternatively, you may provide your own reuseable buffer address
// in which case that buffer *MUST* be initialized to zero one time // in which case that buffer *MUST* be initialized to zero one time
// only before first use. Thereafter, the library will manage such // only before first use. Thereafter, the library will manage such
// a passed proc_t, freeing any additional acquired memory associated // a passed proc_t, freeing any additional acquired memory associated
// with the previous process or thread. // with the previous process or thread.
extern proc_t* readproc(PROCTAB *restrict const PT, proc_t *restrict p); extern proc_t* readproc(PROCTAB *__restrict const PT, proc_t *__restrict p)
extern proc_t* readtask(PROCTAB *restrict const PT, const proc_t *restrict ;
const p, proc_t *restrict t); extern proc_t* readtask(PROCTAB *__restrict const PT, const proc_t *__restr
extern proc_t* readeither(PROCTAB *restrict const PT, proc_t *restrict x); ict const p, proc_t *__restrict t);
extern proc_t* readeither(PROCTAB *__restrict const PT, proc_t *__restrict
x);
// warning: interface may change // warning: interface may change
extern int read_cmdline(char *restrict const dst, unsigned sz, unsigned pid ); extern int read_cmdline(char *__restrict const dst, unsigned sz, unsigned p id);
extern void look_up_our_self(proc_t *p); extern void look_up_our_self(proc_t *p);
// Deallocate space allocated by readproc // Deallocate space allocated by readproc
extern void freeproc(proc_t* p); extern void freeproc(proc_t* p);
// Fill out a proc_t for a single task // Fill out a proc_t for a single task
extern proc_t * get_proc_stats(pid_t pid, proc_t *p); extern proc_t * get_proc_stats(pid_t pid, proc_t *p);
// openproc/readproctab: // openproc/readproctab:
skipping to change at line 274 skipping to change at line 277
#define PROC_FILLOOM 0x0800 // fill in proc_t oom_score and oom_adj #define PROC_FILLOOM 0x0800 // fill in proc_t oom_score and oom_adj
#define PROC_LOOSE_TASKS 0x2000 // treat threads as if they were proces ses #define PROC_LOOSE_TASKS 0x2000 // treat threads as if they were proces ses
// Obsolete, consider only processes with one of the passed: // Obsolete, consider only processes with one of the passed:
#define PROC_PID 0x1000 // process id numbers ( 0 terminated ) #define PROC_PID 0x1000 // process id numbers ( 0 terminated )
#define PROC_UID 0x4000 // user id numbers ( length needed ) #define PROC_UID 0x4000 // user id numbers ( length needed )
#define PROC_EDITCGRPCVT 0x10000 // edit `cgroup' as single vector #define PROC_EDITCGRPCVT 0x10000 // edit `cgroup' as single vector
#define PROC_EDITCMDLCVT 0x20000 // edit `cmdline' as single vector #define PROC_EDITCMDLCVT 0x20000 // edit `cmdline' as single vector
#define PROC_EDITENVRCVT 0x40000 // edit `environ' as single vector
// it helps to give app code a few spare bits // it helps to give app code a few spare bits
#define PROC_SPARE_1 0x01000000 #define PROC_SPARE_1 0x01000000
#define PROC_SPARE_2 0x02000000 #define PROC_SPARE_2 0x02000000
#define PROC_SPARE_3 0x04000000 #define PROC_SPARE_3 0x04000000
#define PROC_SPARE_4 0x08000000 #define PROC_SPARE_4 0x08000000
EXTERN_C_END EXTERN_C_END
#endif #endif
 End of changes. 6 change blocks. 
16 lines changed or deleted 25 lines changed or added


 sig.h   sig.h 
skipping to change at line 19 skipping to change at line 19
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details. * GNU Library General Public License for more details.
*/ */
#include "procps.h" #include "procps.h"
EXTERN_C_BEGIN EXTERN_C_BEGIN
/* return -1 on failure */ /* return -1 on failure */
extern int signal_name_to_number(const char *restrict name); extern int signal_name_to_number(const char *__restrict name);
extern const char *signal_number_to_name(int signo); extern const char *signal_number_to_name(int signo);
extern int print_given_signals(int argc, const char *restrict const *restri ct argv, int max_line); extern int print_given_signals(int argc, const char *__restrict const *__re strict argv, int max_line);
extern char *strtosig(const char *restrict s); extern char *strtosig(const char *__restrict s);
extern void pretty_print_signals(void); extern void pretty_print_signals(void);
extern void unix_print_signals(void); extern void unix_print_signals(void);
EXTERN_C_END EXTERN_C_END
#endif #endif
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 slab.h   slab.h 
#ifndef _PROC_SLAB_H #ifndef _PROC_SLAB_H
#define _PROC_SLAB_H #define _PROC_SLAB_H
#define SLAB_INFO_NAME_LEN 64 #define SLAB_INFO_NAME_LEN 128
struct slab_info { struct slab_info {
char name[SLAB_INFO_NAME_LEN]; /* name of this cache */ char name[SLAB_INFO_NAME_LEN]; /* name of this cache */
struct slab_info *next; struct slab_info *next;
unsigned long cache_size; /* size of entire cache */ unsigned long cache_size; /* size of entire cache */
unsigned nr_objs; /* number of objects in this cache * / unsigned nr_objs; /* number of objects in this cache * /
unsigned nr_active_objs; /* number of active objects */ unsigned nr_active_objs; /* number of active objects */
unsigned obj_size; /* size of each object */ unsigned obj_size; /* size of each object */
unsigned objs_per_slab; /* number of objects per slab */ unsigned objs_per_slab; /* number of objects per slab */
unsigned pages_per_slab; /* number of pages per slab */ unsigned pages_per_slab; /* number of pages per slab */
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 sysinfo.h   sysinfo.h 
skipping to change at line 59 skipping to change at line 59
extern unsigned long kb_slab; extern unsigned long kb_slab;
extern unsigned long nr_reversemaps; extern unsigned long nr_reversemaps;
extern unsigned long kb_committed_as; extern unsigned long kb_committed_as;
extern unsigned long kb_dirty; extern unsigned long kb_dirty;
extern unsigned long kb_inactive; extern unsigned long kb_inactive;
extern unsigned long kb_mapped; extern unsigned long kb_mapped;
extern unsigned long kb_pagetables; extern unsigned long kb_pagetables;
#define BUFFSIZE (64*1024) #define BUFFSIZE (64*1024)
typedef unsigned long long jiff; typedef unsigned long long jiff;
extern void getstat(jiff *restrict cuse, jiff *restrict cice, jiff *restric extern void getstat(jiff *__restrict cuse, jiff *__restrict cice, jiff *__r
t csys, jiff *restrict cide, jiff *restrict ciow, jiff *restrict cxxx, jiff estrict csys, jiff *__restrict cide, jiff *__restrict ciow, jiff *__restric
*restrict cyyy, jiff *restrict czzz, t cxxx, jiff *__restrict cyyy, jiff *__restrict czzz,
unsigned long *restrict pin, unsigned long *restrict pout, unsi unsigned long *__restrict pin, unsigned long *__restrict pout,
gned long *restrict s_in, unsigned long *restrict sout, unsigned long *__restrict s_in, unsigned long *__restrict sout,
unsigned *restrict intr, unsigned *restrict ctxt, unsigned *__restrict intr, unsigned *__restrict ctxt,
unsigned int *restrict running, unsigned int *restrict blocked, unsigned int *__restrict running, unsigned int *__restrict bloc
unsigned int *restrict btime, unsigned int *restrict processes) ked,
; unsigned int *__restrict btime, unsigned int *__restrict proces
ses);
extern void meminfo(void); extern void meminfo(void);
extern unsigned long vm_nr_dirty; extern unsigned long vm_nr_dirty;
extern unsigned long vm_nr_writeback; extern unsigned long vm_nr_writeback;
extern unsigned long vm_nr_pagecache; extern unsigned long vm_nr_pagecache;
extern unsigned long vm_nr_page_table_pages; extern unsigned long vm_nr_page_table_pages;
extern unsigned long vm_nr_reverse_maps; extern unsigned long vm_nr_reverse_maps;
extern unsigned long vm_nr_mapped; extern unsigned long vm_nr_mapped;
extern unsigned long vm_nr_slab; extern unsigned long vm_nr_slab;
 End of changes. 1 change blocks. 
9 lines changed or deleted 10 lines changed or added


 wchan.h   wchan.h 
#ifndef PROCPS_PROC_WCHAN_H #ifndef PROCPS_PROC_WCHAN_H
#define PROCPS_PROC_WCHAN_H #define PROCPS_PROC_WCHAN_H
#include "procps.h" #include "procps.h"
EXTERN_C_BEGIN EXTERN_C_BEGIN
extern const char * lookup_wchan(unsigned KLONG address, unsigned pid); extern const char * lookup_wchan(unsigned KLONG address, unsigned pid);
extern int open_psdb(const char *restrict override); extern int open_psdb(const char *__restrict override);
extern int open_psdb_message(const char *restrict override, message_fn me extern int open_psdb_message(const char *__restrict override, message_fn
ssage); message);
EXTERN_C_END EXTERN_C_END
#endif #endif
 End of changes. 1 change blocks. 
3 lines changed or deleted 3 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/