{
int c, flags = 0, unit_set = 0;
struct commandline_arguments args;
- struct procps_meminfo *mem_info = NULL;
+ struct meminfo_info *mem_info = NULL;
/*
* For long options that have no equivalent short option, use a
#define PIDS_GETINT(e) PROCPS_PIDS_VAL(EU_ ## e, s_int, stack)
#define PIDS_GETULL(e) PROCPS_PIDS_VAL(EU_ ## e, ull_int, stack)
#define PIDS_GETSTR(e) PROCPS_PIDS_VAL(EU_ ## e, str, stack)
- struct procps_pidsinfo *info=NULL;
+ struct pids_info *info=NULL;
struct procps_namespaces nsp;
struct pids_stack *stack;
unsigned long long saved_start_time; /* for new/old support */
{
enum pids_item items[] = { PROCPS_PIDS_ID_PID, PROCPS_PIDS_CMD, PROCPS_PIDS_CMDLINE_V };
enum rel_items { rel_pid, rel_cmd, rel_cmdline };
- struct procps_pidsinfo *info = NULL;
+ struct pids_info *info = NULL;
struct pids_stack *stack;
int match;
static int size = 0;
int main(int argc, char **argv)
{
- struct procps_pidsinfo *info = NULL;
+ struct pids_info *info = NULL;
struct pids_fetch *pids_fetch;
unsigned *pidlist;
int reap_count, user_count;
int check_pids_new_toomany(void *data)
{
- struct procps_pidsinfo *info;
+ struct pids_info *info;
testname = "procps_pids_new() too many items returns -EINVAL";
return (procps_pids_new(&info, items, 1) == -EINVAL);
}
int check_pids_new_and_unref(void *data)
{
- struct procps_pidsinfo *info = NULL;
+ struct pids_info *info = NULL;
testname = "procps_pids new then unref";
return ( (procps_pids_new(&info, items, 2) == 0) &&
(procps_pids_unref(&info) == 0) &&
return 0; \
} }
-extern struct procps_pidsinfo *Pids_info;
-extern enum pids_item *Pids_items;
-extern int Pids_index;
+extern struct pids_info *Pids_info;
+extern enum pids_item *Pids_items;
+extern int Pids_index;
// most of these need not be extern, they're unique to output.c
// (but for future flexibility the easiest path has been taken)
// --- <pids> interface begin ||||||||||||||||||||||||||||||||||||||||||||
// -----------------------------------------------------------------------
-struct procps_pidsinfo *Pids_info = NULL; // our required <pids> context
+struct pids_info *Pids_info = NULL; // our required <pids> context
enum pids_item *Pids_items; // allocated as PIDSITEMS
int Pids_index; // actual number of active enums
static void get_boot_time(void)
{
- struct procps_statinfo *stat_info = NULL;
+ struct stat_info *stat_info = NULL;
if (procps_stat_new(&stat_info) < 0)
xerrx(EXIT_FAILURE, _("Unable to create NEW ystem stat structure"));
boot_time = PROCPS_STAT_GET(stat_info, PROCPS_STAT_SYS_TIME_OF_BOOT, ul_int);
static void get_memory_total()
{
- struct procps_meminfo *mem_info = NULL;
+ struct meminfo_info *mem_info = NULL;
if (procps_meminfo_new(&mem_info) < 0)
xerrx(EXIT_FAILURE,
_("Unable to create meminfo structure"));
{
#define PIDS_GETINT(e) PROCPS_PIDS_VAL(EU_ ## e, s_int, reap->stacks[i])
#define PIDS_GETSTR(e) PROCPS_PIDS_VAL(EU_ ## e, str, reap->stacks[i])
- struct procps_pidsinfo *info=NULL;
+ struct pids_info *info=NULL;
struct pids_fetch *reap;
int i, total_procs;
static long Delay = 3;
static int Run_once = 0;
-static struct procps_slabinfo *Slab_info;
+static struct slabinfo_info *Slab_info;
enum slabinfo_item Sort_item = DEFAULT_SORT;
enum slabinfo_sort_order Sort_Order = PROCPS_SLABINFO_DESCEND;
/* Support for the new library API -- acquired (if necessary)
at program startup and referenced throughout our lifetime. */
// --- <proc/meminfo.h> -----------------------------------------------
-static struct procps_meminfo *Mem_ctx;
+static struct meminfo_info *Mem_ctx;
static struct meminfo_stack *Mem_stack;
static enum meminfo_item Mem_items[] = {
PROCPS_MEMINFO_MEM_FREE, PROCPS_MEMINFO_MEM_USED, PROCPS_MEMINFO_MEM_TOTAL,
// mem stack results extractor macro, where e=rel enum
#define MEM_VAL(e) PROCPS_MEMINFO_VAL(e, ul_int, Mem_stack)
// --- <proc/pids.h> --------------------------------------------------
-static struct procps_pidsinfo *Pids_ctx;
+static struct pids_info *Pids_ctx;
static int Pids_itms_cur; // 'current' max (<= Fieldstab)
static enum pids_item *Pids_itms; // allocated as MAXTBL(Fieldstab)
static struct pids_fetch *Pids_reap; // for reap or select
// ( but many functions use their own unique tailored version for access )
#define PID_VAL(e,t,s) PROCPS_PIDS_VAL(Fieldstab[ e ].erel, t, s)
// --- <proc/stat.h> --------------------------------------------------
-static struct procps_statinfo *Stat_ctx;
+static struct stat_info *Stat_ctx;
static struct stat_reaped *Stat_reap;
static enum stat_item Stat_items[] = {
PROCPS_STAT_TIC_ID, PROCPS_STAT_TIC_NUMA_NODE,
struct tm *tm_ptr;
time_t the_time;
char timebuf[32];
- struct procps_vmstat *vm_info = NULL;
- struct procps_statinfo *sys_info = NULL;
+ struct vmstat_info *vm_info = NULL;
+ struct stat_info *sys_info = NULL;
struct stat_stack *stat_stack;
- struct procps_meminfo *mem_info = NULL;
+ struct meminfo_info *mem_info = NULL;
struct meminfo_stack *mem_stack;
sleep_half = (sleep_time / 2);
hz = procps_hertz_get();
new_header();
+
if (procps_vmstat_new(&vm_info) < 0)
xerrx(EXIT_FAILURE, _("Unable to create vmstat structure"));
if (procps_stat_new(&sys_info) < 0)
static void diskpartition_format(const char *partition_name)
{
#define partVAL(x) PROCPS_DISKSTATS_VAL(x, ul_int, stack)
- struct procps_diskstats *disk_stat;
+ struct diskstats_info *disk_stat;
struct diskstats_stack *stack;
struct diskstats_result *got;
const char format[] = "%20lu %10lu %10lu %10lu\n";
static void diskformat(void)
{
#define diskVAL(e,t) PROCPS_DISKSTATS_VAL(e, t, reap->stacks[j])
- struct procps_diskstats *disk_stat;
+ struct diskstats_info *disk_stat;
struct diskstats_reap *reap;
int i, j;
time_t the_time;
static void slabformat (void)
{
#define MAX_ITEMS (int)(sizeof(node_items) / sizeof(node_items[0]))
- struct procps_slabinfo *slab_info;
+ struct slabinfo_info *slab_info;
struct slabinfo_reap *reaped;
int i, j;
enum slabinfo_item node_items[] = {
static void disksum_format(void)
{
#define diskVAL(e,t) PROCPS_DISKSTATS_VAL(e, t, reap->stacks[j])
- struct procps_diskstats *disk_stat;
+ struct diskstats_info *disk_stat;
struct diskstats_reap *reap;
int j, disk_count, part_count;
unsigned long reads, merged_reads, read_sectors, milli_reading, writes,
#define TICv(E) PROCPS_STAT_VAL(E, ull_int, stat_stack)
#define SYSv(E) PROCPS_STAT_VAL(E, ul_int, stat_stack)
#define MEMv(E) unitConvert(PROCPS_STAT_VAL(E, ul_int, mem_stack))
- struct procps_statinfo *sys_info = NULL;
- struct procps_vmstat *vm_info = NULL;
- struct procps_meminfo *mem_info = NULL;
+ struct stat_info *sys_info = NULL;
+ struct vmstat_info *vm_info = NULL;
+ struct meminfo_info *mem_info = NULL;
struct stat_stack *stat_stack;
struct meminfo_stack *mem_stack;
static void fork_format(void)
{
- struct procps_statinfo *sys_info = NULL;
+ struct stat_info *sys_info = NULL;
if (procps_stat_new(&sys_info) < 0)
xerrx(EXIT_FAILURE, _("Unable to create system stat structure"));
unsigned long long best_time = 0;
unsigned long long secondbest_time = 0;
- struct procps_pidsinfo *info=NULL;
+ struct pids_info *info=NULL;
struct pids_fetch *reap;
enum pids_item items[] = {
PROCPS_PIDS_ID_TGID,