2015-08-19 10:30:00 +05:30
|
|
|
/*
|
|
|
|
* pids.h - task/thread/process related declarations for libproc
|
|
|
|
*
|
|
|
|
* Copyright (C) 1998-2005 Albert Cahalan
|
|
|
|
* Copyright (C) 2015 Craig Small <csmall@enc.com.au>
|
|
|
|
* Copyright (C) 2015 Jim Warner <james.warner@comcast.net>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _PROC_PIDS_H
|
|
|
|
#define _PROC_PIDS_H
|
|
|
|
|
2016-04-16 12:33:57 +05:30
|
|
|
#include <features.h>
|
2015-08-19 10:30:00 +05:30
|
|
|
__BEGIN_DECLS
|
|
|
|
|
|
|
|
enum pids_item {
|
2016-06-09 10:30:00 +05:30
|
|
|
PROCPS_PIDS_noop, // ( never altered )
|
|
|
|
PROCPS_PIDS_extra, // ( reset to zero )
|
2016-05-15 10:30:00 +05:30
|
|
|
PROCPS_PIDS_ADDR_END_CODE, // ul_int
|
|
|
|
PROCPS_PIDS_ADDR_KSTK_EIP, // ul_int
|
|
|
|
PROCPS_PIDS_ADDR_KSTK_ESP, // ul_int
|
|
|
|
PROCPS_PIDS_ADDR_START_CODE, // ul_int
|
|
|
|
PROCPS_PIDS_ADDR_START_STACK, // ul_int
|
|
|
|
PROCPS_PIDS_ALARM, // sl_int
|
|
|
|
PROCPS_PIDS_CGNAME, // str
|
|
|
|
PROCPS_PIDS_CGROUP, // str
|
|
|
|
PROCPS_PIDS_CGROUP_V, // strv
|
|
|
|
PROCPS_PIDS_CMD, // str
|
|
|
|
PROCPS_PIDS_CMDLINE, // str
|
|
|
|
PROCPS_PIDS_CMDLINE_V, // strv
|
|
|
|
PROCPS_PIDS_ENVIRON, // str
|
|
|
|
PROCPS_PIDS_ENVIRON_V, // strv
|
|
|
|
PROCPS_PIDS_EXIT_SIGNAL, // s_int
|
|
|
|
PROCPS_PIDS_FLAGS, // ul_int
|
|
|
|
PROCPS_PIDS_FLT_MAJ, // sl_int
|
|
|
|
PROCPS_PIDS_FLT_MAJ_C, // sl_int
|
|
|
|
PROCPS_PIDS_FLT_MAJ_DELTA, // sl_int
|
|
|
|
PROCPS_PIDS_FLT_MIN, // sl_int
|
|
|
|
PROCPS_PIDS_FLT_MIN_C, // sl_int
|
|
|
|
PROCPS_PIDS_FLT_MIN_DELTA, // sl_int
|
|
|
|
PROCPS_PIDS_ID_EGID, // u_int
|
|
|
|
PROCPS_PIDS_ID_EGROUP, // str
|
|
|
|
PROCPS_PIDS_ID_EUID, // u_int
|
|
|
|
PROCPS_PIDS_ID_EUSER, // str
|
|
|
|
PROCPS_PIDS_ID_FGID, // u_int
|
|
|
|
PROCPS_PIDS_ID_FGROUP, // str
|
|
|
|
PROCPS_PIDS_ID_FUID, // u_int
|
|
|
|
PROCPS_PIDS_ID_FUSER, // str
|
|
|
|
PROCPS_PIDS_ID_PGRP, // s_int
|
|
|
|
PROCPS_PIDS_ID_PID, // s_int
|
|
|
|
PROCPS_PIDS_ID_PPID, // s_int
|
|
|
|
PROCPS_PIDS_ID_RGID, // u_int
|
|
|
|
PROCPS_PIDS_ID_RGROUP, // str
|
|
|
|
PROCPS_PIDS_ID_RUID, // u_int
|
|
|
|
PROCPS_PIDS_ID_RUSER, // str
|
|
|
|
PROCPS_PIDS_ID_SESSION, // s_int
|
|
|
|
PROCPS_PIDS_ID_SGID, // u_int
|
|
|
|
PROCPS_PIDS_ID_SGROUP, // str
|
|
|
|
PROCPS_PIDS_ID_SUID, // u_int
|
|
|
|
PROCPS_PIDS_ID_SUSER, // str
|
|
|
|
PROCPS_PIDS_ID_TGID, // s_int
|
|
|
|
PROCPS_PIDS_ID_TPGID, // s_int
|
|
|
|
PROCPS_PIDS_LXCNAME, // str
|
|
|
|
PROCPS_PIDS_MEM_CODE, // sl_int
|
|
|
|
PROCPS_PIDS_MEM_CODE_KIB, // sl_int
|
|
|
|
PROCPS_PIDS_MEM_DATA, // sl_int
|
|
|
|
PROCPS_PIDS_MEM_DATA_KIB, // sl_int
|
|
|
|
PROCPS_PIDS_MEM_DT, // sl_int
|
|
|
|
PROCPS_PIDS_MEM_LRS, // sl_int
|
|
|
|
PROCPS_PIDS_MEM_RES, // sl_int
|
|
|
|
PROCPS_PIDS_MEM_RES_KIB, // sl_int
|
|
|
|
PROCPS_PIDS_MEM_SHR, // sl_int
|
|
|
|
PROCPS_PIDS_MEM_SHR_KIB, // sl_int
|
|
|
|
PROCPS_PIDS_MEM_VIRT, // sl_int
|
|
|
|
PROCPS_PIDS_MEM_VIRT_KIB, // sl_int
|
|
|
|
PROCPS_PIDS_NICE, // sl_int
|
|
|
|
PROCPS_PIDS_NLWP, // s_int
|
|
|
|
PROCPS_PIDS_NS_IPC, // ul_int
|
|
|
|
PROCPS_PIDS_NS_MNT, // ul_int
|
|
|
|
PROCPS_PIDS_NS_NET, // ul_int
|
|
|
|
PROCPS_PIDS_NS_PID, // ul_int
|
|
|
|
PROCPS_PIDS_NS_USER, // ul_int
|
|
|
|
PROCPS_PIDS_NS_UTS, // ul_int
|
|
|
|
PROCPS_PIDS_OOM_ADJ, // s_int
|
|
|
|
PROCPS_PIDS_OOM_SCORE, // s_int
|
|
|
|
PROCPS_PIDS_PRIORITY, // s_int
|
|
|
|
PROCPS_PIDS_PROCESSOR, // u_int
|
|
|
|
PROCPS_PIDS_RSS, // sl_int
|
|
|
|
PROCPS_PIDS_RSS_RLIM, // ul_int
|
|
|
|
PROCPS_PIDS_RTPRIO, // ul_int
|
|
|
|
PROCPS_PIDS_SCHED_CLASS, // ul_int
|
|
|
|
PROCPS_PIDS_SD_MACH, // str
|
|
|
|
PROCPS_PIDS_SD_OUID, // str
|
|
|
|
PROCPS_PIDS_SD_SEAT, // str
|
|
|
|
PROCPS_PIDS_SD_SESS, // str
|
|
|
|
PROCPS_PIDS_SD_SLICE, // str
|
|
|
|
PROCPS_PIDS_SD_UNIT, // str
|
|
|
|
PROCPS_PIDS_SD_UUNIT, // str
|
|
|
|
PROCPS_PIDS_SIGBLOCKED, // str
|
|
|
|
PROCPS_PIDS_SIGCATCH, // str
|
|
|
|
PROCPS_PIDS_SIGIGNORE, // str
|
|
|
|
PROCPS_PIDS_SIGNALS, // str
|
|
|
|
PROCPS_PIDS_SIGPENDING, // str
|
|
|
|
PROCPS_PIDS_STATE, // s_ch
|
|
|
|
PROCPS_PIDS_SUPGIDS, // str
|
|
|
|
PROCPS_PIDS_SUPGROUPS, // str
|
|
|
|
PROCPS_PIDS_TICS_ALL, // ull_int
|
|
|
|
PROCPS_PIDS_TICS_ALL_C, // ull_int
|
|
|
|
PROCPS_PIDS_TICS_DELTA, // sl_int
|
|
|
|
PROCPS_PIDS_TICS_SYSTEM, // ull_int
|
|
|
|
PROCPS_PIDS_TICS_SYSTEM_C, // ull_int
|
|
|
|
PROCPS_PIDS_TICS_USER, // ull_int
|
|
|
|
PROCPS_PIDS_TICS_USER_C, // ull_int
|
|
|
|
PROCPS_PIDS_TIME_ALL, // ull_int
|
|
|
|
PROCPS_PIDS_TIME_ELAPSED, // ull_int
|
|
|
|
PROCPS_PIDS_TIME_START, // ull_int
|
|
|
|
PROCPS_PIDS_TTY, // s_int
|
|
|
|
PROCPS_PIDS_TTY_NAME, // str
|
|
|
|
PROCPS_PIDS_TTY_NUMBER, // str
|
|
|
|
PROCPS_PIDS_VM_DATA, // sl_int
|
|
|
|
PROCPS_PIDS_VM_EXE, // sl_int
|
|
|
|
PROCPS_PIDS_VM_LIB, // sl_int
|
|
|
|
PROCPS_PIDS_VM_RSS, // sl_int
|
|
|
|
PROCPS_PIDS_VM_RSS_ANON, // sl_int
|
|
|
|
PROCPS_PIDS_VM_RSS_FILE, // sl_int
|
|
|
|
PROCPS_PIDS_VM_RSS_LOCKED, // sl_int
|
|
|
|
PROCPS_PIDS_VM_RSS_SHARED, // sl_int
|
|
|
|
PROCPS_PIDS_VM_SIZE, // sl_int
|
|
|
|
PROCPS_PIDS_VM_STACK, // sl_int
|
|
|
|
PROCPS_PIDS_VM_SWAP, // sl_int
|
|
|
|
PROCPS_PIDS_VM_USED, // sl_int
|
|
|
|
PROCPS_PIDS_VSIZE_PGS, // ul_int
|
|
|
|
PROCPS_PIDS_WCHAN_ADDR, // ul_int
|
2016-06-14 10:30:00 +05:30
|
|
|
PROCPS_PIDS_WCHAN_NAME // str
|
2015-08-19 10:30:00 +05:30
|
|
|
};
|
|
|
|
|
library: standardize portions of interface, <PIDS> api
This represents a rather major interface redesign. The
following highlights most of the changes/enhancements.
. The 'read' interface (employed by pgrep & pidof) saw
the biggest change. The 'open', 'next' and 'shut' guys
all went bye-bye, replaced by a single 'get' function.
. The items specified at 'new' time no longer serve as
the maximum. In fact, items & numitems are now treated
as optional, should callers prefer to wait until later
when the 'reset' function would then become mandatory.
. Even at 'reset' time, the stacks are not tied to any
sort of maximum. They will grow dynamically as needed.
. The order of some parameters was changed to parallel
that found in our other APIs. Specifically, when items
& numitems are needed they're specified in that order.
. A user will no longer be prevented from concurrently
employing any accessor functions. In other words, that
'get' (old 'read') won't preclude 'reap' and 'select'.
. A duplicate enumerator was found dealing with locked
resident pages. So, the name VM_LOCK was eliminated in
favor of VM_RSS_LOCKED, which is way more descriptive.
. The struct address returned to callers following any
reap() or select() is now more sharable as pids_fetch.
. Some input parameter names were changed to make them
more descriptive of the intended purpose/requirements.
------------------------------------------------------
Internally, there were numerous implementation changes
made that did not directly impact any potential users.
. That #define FPRINT_STACKS was eliminated along with
the associated supporting function and its invocation.
. Addresses returned following 'reap' or 'select' will
now be NULL delimited, so one has the option of stacks
access via the total count or this new NULL fencepost.
. Input params were simplified and generalized in both
oldproc_open() & close() to enable more than 1 PROCTAB
to be open simultaneously, which was required for get.
. The PROCPS_PIDS_logical_end enum was relocated after
the Item_table making the need to keep it synchronized
more apparent (if the table expands it's right there).
. The 'Public function' section of the source file was
subdivided into 1) the three basic required functions;
and 2) functions that can sometimes vary between APIs.
Signed-off-by: Jim Warner <james.warner@comcast.net>
2016-05-14 10:30:00 +05:30
|
|
|
enum pids_fetch_type {
|
|
|
|
PROCPS_FETCH_TASKS_ONLY,
|
|
|
|
PROCPS_FETCH_THREADS_TOO
|
|
|
|
};
|
|
|
|
|
2016-04-18 10:30:00 +05:30
|
|
|
enum pids_select_type {
|
|
|
|
PROCPS_SELECT_PID = 0x1000,
|
|
|
|
PROCPS_SELECT_UID = 0x4000
|
2015-08-19 10:30:00 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
enum pids_sort_order {
|
2016-06-06 10:30:00 +05:30
|
|
|
PROCPS_PIDS_ASCEND = +1,
|
|
|
|
PROCPS_PIDS_DESCEND = -1
|
2015-08-19 10:30:00 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct pids_result {
|
|
|
|
enum pids_item item;
|
|
|
|
union {
|
2016-06-14 10:30:00 +05:30
|
|
|
signed char s_ch;
|
|
|
|
signed int s_int;
|
|
|
|
unsigned int u_int;
|
|
|
|
signed long sl_int;
|
|
|
|
unsigned long ul_int;
|
|
|
|
unsigned long long ull_int;
|
|
|
|
char *str;
|
|
|
|
char **strv;
|
2015-08-19 10:30:00 +05:30
|
|
|
} result;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct pids_stack {
|
|
|
|
struct pids_result *head;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct pids_counts {
|
|
|
|
int total;
|
|
|
|
int running, sleeping, stopped, zombied;
|
|
|
|
};
|
|
|
|
|
library: standardize portions of interface, <PIDS> api
This represents a rather major interface redesign. The
following highlights most of the changes/enhancements.
. The 'read' interface (employed by pgrep & pidof) saw
the biggest change. The 'open', 'next' and 'shut' guys
all went bye-bye, replaced by a single 'get' function.
. The items specified at 'new' time no longer serve as
the maximum. In fact, items & numitems are now treated
as optional, should callers prefer to wait until later
when the 'reset' function would then become mandatory.
. Even at 'reset' time, the stacks are not tied to any
sort of maximum. They will grow dynamically as needed.
. The order of some parameters was changed to parallel
that found in our other APIs. Specifically, when items
& numitems are needed they're specified in that order.
. A user will no longer be prevented from concurrently
employing any accessor functions. In other words, that
'get' (old 'read') won't preclude 'reap' and 'select'.
. A duplicate enumerator was found dealing with locked
resident pages. So, the name VM_LOCK was eliminated in
favor of VM_RSS_LOCKED, which is way more descriptive.
. The struct address returned to callers following any
reap() or select() is now more sharable as pids_fetch.
. Some input parameter names were changed to make them
more descriptive of the intended purpose/requirements.
------------------------------------------------------
Internally, there were numerous implementation changes
made that did not directly impact any potential users.
. That #define FPRINT_STACKS was eliminated along with
the associated supporting function and its invocation.
. Addresses returned following 'reap' or 'select' will
now be NULL delimited, so one has the option of stacks
access via the total count or this new NULL fencepost.
. Input params were simplified and generalized in both
oldproc_open() & close() to enable more than 1 PROCTAB
to be open simultaneously, which was required for get.
. The PROCPS_PIDS_logical_end enum was relocated after
the Item_table making the need to keep it synchronized
more apparent (if the table expands it's right there).
. The 'Public function' section of the source file was
subdivided into 1) the three basic required functions;
and 2) functions that can sometimes vary between APIs.
Signed-off-by: Jim Warner <james.warner@comcast.net>
2016-05-14 10:30:00 +05:30
|
|
|
struct pids_fetch {
|
2015-08-20 10:30:00 +05:30
|
|
|
struct pids_stack **stacks;
|
2015-08-19 10:30:00 +05:30
|
|
|
struct pids_counts counts;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2016-06-18 10:30:00 +05:30
|
|
|
#define PROCPS_PIDS_VAL( relative_enum, type, stack ) \
|
|
|
|
stack -> head [ relative_enum ] . result . type
|
2015-08-26 10:30:00 +05:30
|
|
|
|
|
|
|
|
2016-06-14 10:30:00 +05:30
|
|
|
struct procps_pidsinfo;
|
|
|
|
|
library: standardize portions of interface, <PIDS> api
This represents a rather major interface redesign. The
following highlights most of the changes/enhancements.
. The 'read' interface (employed by pgrep & pidof) saw
the biggest change. The 'open', 'next' and 'shut' guys
all went bye-bye, replaced by a single 'get' function.
. The items specified at 'new' time no longer serve as
the maximum. In fact, items & numitems are now treated
as optional, should callers prefer to wait until later
when the 'reset' function would then become mandatory.
. Even at 'reset' time, the stacks are not tied to any
sort of maximum. They will grow dynamically as needed.
. The order of some parameters was changed to parallel
that found in our other APIs. Specifically, when items
& numitems are needed they're specified in that order.
. A user will no longer be prevented from concurrently
employing any accessor functions. In other words, that
'get' (old 'read') won't preclude 'reap' and 'select'.
. A duplicate enumerator was found dealing with locked
resident pages. So, the name VM_LOCK was eliminated in
favor of VM_RSS_LOCKED, which is way more descriptive.
. The struct address returned to callers following any
reap() or select() is now more sharable as pids_fetch.
. Some input parameter names were changed to make them
more descriptive of the intended purpose/requirements.
------------------------------------------------------
Internally, there were numerous implementation changes
made that did not directly impact any potential users.
. That #define FPRINT_STACKS was eliminated along with
the associated supporting function and its invocation.
. Addresses returned following 'reap' or 'select' will
now be NULL delimited, so one has the option of stacks
access via the total count or this new NULL fencepost.
. Input params were simplified and generalized in both
oldproc_open() & close() to enable more than 1 PROCTAB
to be open simultaneously, which was required for get.
. The PROCPS_PIDS_logical_end enum was relocated after
the Item_table making the need to keep it synchronized
more apparent (if the table expands it's right there).
. The 'Public function' section of the source file was
subdivided into 1) the three basic required functions;
and 2) functions that can sometimes vary between APIs.
Signed-off-by: Jim Warner <james.warner@comcast.net>
2016-05-14 10:30:00 +05:30
|
|
|
int procps_pids_new (struct procps_pidsinfo **info, enum pids_item *items, int numitems);
|
|
|
|
int procps_pids_ref (struct procps_pidsinfo *info);
|
|
|
|
int procps_pids_unref (struct procps_pidsinfo **info);
|
|
|
|
|
2015-09-11 10:30:00 +05:30
|
|
|
struct pids_stack *fatal_proc_unmounted (
|
|
|
|
struct procps_pidsinfo *info,
|
|
|
|
int return_self);
|
|
|
|
|
library: standardize portions of interface, <PIDS> api
This represents a rather major interface redesign. The
following highlights most of the changes/enhancements.
. The 'read' interface (employed by pgrep & pidof) saw
the biggest change. The 'open', 'next' and 'shut' guys
all went bye-bye, replaced by a single 'get' function.
. The items specified at 'new' time no longer serve as
the maximum. In fact, items & numitems are now treated
as optional, should callers prefer to wait until later
when the 'reset' function would then become mandatory.
. Even at 'reset' time, the stacks are not tied to any
sort of maximum. They will grow dynamically as needed.
. The order of some parameters was changed to parallel
that found in our other APIs. Specifically, when items
& numitems are needed they're specified in that order.
. A user will no longer be prevented from concurrently
employing any accessor functions. In other words, that
'get' (old 'read') won't preclude 'reap' and 'select'.
. A duplicate enumerator was found dealing with locked
resident pages. So, the name VM_LOCK was eliminated in
favor of VM_RSS_LOCKED, which is way more descriptive.
. The struct address returned to callers following any
reap() or select() is now more sharable as pids_fetch.
. Some input parameter names were changed to make them
more descriptive of the intended purpose/requirements.
------------------------------------------------------
Internally, there were numerous implementation changes
made that did not directly impact any potential users.
. That #define FPRINT_STACKS was eliminated along with
the associated supporting function and its invocation.
. Addresses returned following 'reap' or 'select' will
now be NULL delimited, so one has the option of stacks
access via the total count or this new NULL fencepost.
. Input params were simplified and generalized in both
oldproc_open() & close() to enable more than 1 PROCTAB
to be open simultaneously, which was required for get.
. The PROCPS_PIDS_logical_end enum was relocated after
the Item_table making the need to keep it synchronized
more apparent (if the table expands it's right there).
. The 'Public function' section of the source file was
subdivided into 1) the three basic required functions;
and 2) functions that can sometimes vary between APIs.
Signed-off-by: Jim Warner <james.warner@comcast.net>
2016-05-14 10:30:00 +05:30
|
|
|
struct pids_stack *procps_pids_get (
|
2015-08-26 10:30:00 +05:30
|
|
|
struct procps_pidsinfo *info,
|
library: standardize portions of interface, <PIDS> api
This represents a rather major interface redesign. The
following highlights most of the changes/enhancements.
. The 'read' interface (employed by pgrep & pidof) saw
the biggest change. The 'open', 'next' and 'shut' guys
all went bye-bye, replaced by a single 'get' function.
. The items specified at 'new' time no longer serve as
the maximum. In fact, items & numitems are now treated
as optional, should callers prefer to wait until later
when the 'reset' function would then become mandatory.
. Even at 'reset' time, the stacks are not tied to any
sort of maximum. They will grow dynamically as needed.
. The order of some parameters was changed to parallel
that found in our other APIs. Specifically, when items
& numitems are needed they're specified in that order.
. A user will no longer be prevented from concurrently
employing any accessor functions. In other words, that
'get' (old 'read') won't preclude 'reap' and 'select'.
. A duplicate enumerator was found dealing with locked
resident pages. So, the name VM_LOCK was eliminated in
favor of VM_RSS_LOCKED, which is way more descriptive.
. The struct address returned to callers following any
reap() or select() is now more sharable as pids_fetch.
. Some input parameter names were changed to make them
more descriptive of the intended purpose/requirements.
------------------------------------------------------
Internally, there were numerous implementation changes
made that did not directly impact any potential users.
. That #define FPRINT_STACKS was eliminated along with
the associated supporting function and its invocation.
. Addresses returned following 'reap' or 'select' will
now be NULL delimited, so one has the option of stacks
access via the total count or this new NULL fencepost.
. Input params were simplified and generalized in both
oldproc_open() & close() to enable more than 1 PROCTAB
to be open simultaneously, which was required for get.
. The PROCPS_PIDS_logical_end enum was relocated after
the Item_table making the need to keep it synchronized
more apparent (if the table expands it's right there).
. The 'Public function' section of the source file was
subdivided into 1) the three basic required functions;
and 2) functions that can sometimes vary between APIs.
Signed-off-by: Jim Warner <james.warner@comcast.net>
2016-05-14 10:30:00 +05:30
|
|
|
enum pids_fetch_type which);
|
2015-08-26 10:30:00 +05:30
|
|
|
|
library: standardize portions of interface, <PIDS> api
This represents a rather major interface redesign. The
following highlights most of the changes/enhancements.
. The 'read' interface (employed by pgrep & pidof) saw
the biggest change. The 'open', 'next' and 'shut' guys
all went bye-bye, replaced by a single 'get' function.
. The items specified at 'new' time no longer serve as
the maximum. In fact, items & numitems are now treated
as optional, should callers prefer to wait until later
when the 'reset' function would then become mandatory.
. Even at 'reset' time, the stacks are not tied to any
sort of maximum. They will grow dynamically as needed.
. The order of some parameters was changed to parallel
that found in our other APIs. Specifically, when items
& numitems are needed they're specified in that order.
. A user will no longer be prevented from concurrently
employing any accessor functions. In other words, that
'get' (old 'read') won't preclude 'reap' and 'select'.
. A duplicate enumerator was found dealing with locked
resident pages. So, the name VM_LOCK was eliminated in
favor of VM_RSS_LOCKED, which is way more descriptive.
. The struct address returned to callers following any
reap() or select() is now more sharable as pids_fetch.
. Some input parameter names were changed to make them
more descriptive of the intended purpose/requirements.
------------------------------------------------------
Internally, there were numerous implementation changes
made that did not directly impact any potential users.
. That #define FPRINT_STACKS was eliminated along with
the associated supporting function and its invocation.
. Addresses returned following 'reap' or 'select' will
now be NULL delimited, so one has the option of stacks
access via the total count or this new NULL fencepost.
. Input params were simplified and generalized in both
oldproc_open() & close() to enable more than 1 PROCTAB
to be open simultaneously, which was required for get.
. The PROCPS_PIDS_logical_end enum was relocated after
the Item_table making the need to keep it synchronized
more apparent (if the table expands it's right there).
. The 'Public function' section of the source file was
subdivided into 1) the three basic required functions;
and 2) functions that can sometimes vary between APIs.
Signed-off-by: Jim Warner <james.warner@comcast.net>
2016-05-14 10:30:00 +05:30
|
|
|
struct pids_fetch *procps_pids_reap (
|
2015-08-19 10:30:00 +05:30
|
|
|
struct procps_pidsinfo *info,
|
library: standardize portions of interface, <PIDS> api
This represents a rather major interface redesign. The
following highlights most of the changes/enhancements.
. The 'read' interface (employed by pgrep & pidof) saw
the biggest change. The 'open', 'next' and 'shut' guys
all went bye-bye, replaced by a single 'get' function.
. The items specified at 'new' time no longer serve as
the maximum. In fact, items & numitems are now treated
as optional, should callers prefer to wait until later
when the 'reset' function would then become mandatory.
. Even at 'reset' time, the stacks are not tied to any
sort of maximum. They will grow dynamically as needed.
. The order of some parameters was changed to parallel
that found in our other APIs. Specifically, when items
& numitems are needed they're specified in that order.
. A user will no longer be prevented from concurrently
employing any accessor functions. In other words, that
'get' (old 'read') won't preclude 'reap' and 'select'.
. A duplicate enumerator was found dealing with locked
resident pages. So, the name VM_LOCK was eliminated in
favor of VM_RSS_LOCKED, which is way more descriptive.
. The struct address returned to callers following any
reap() or select() is now more sharable as pids_fetch.
. Some input parameter names were changed to make them
more descriptive of the intended purpose/requirements.
------------------------------------------------------
Internally, there were numerous implementation changes
made that did not directly impact any potential users.
. That #define FPRINT_STACKS was eliminated along with
the associated supporting function and its invocation.
. Addresses returned following 'reap' or 'select' will
now be NULL delimited, so one has the option of stacks
access via the total count or this new NULL fencepost.
. Input params were simplified and generalized in both
oldproc_open() & close() to enable more than 1 PROCTAB
to be open simultaneously, which was required for get.
. The PROCPS_PIDS_logical_end enum was relocated after
the Item_table making the need to keep it synchronized
more apparent (if the table expands it's right there).
. The 'Public function' section of the source file was
subdivided into 1) the three basic required functions;
and 2) functions that can sometimes vary between APIs.
Signed-off-by: Jim Warner <james.warner@comcast.net>
2016-05-14 10:30:00 +05:30
|
|
|
enum pids_fetch_type which);
|
2015-08-19 10:30:00 +05:30
|
|
|
|
|
|
|
int procps_pids_reset (
|
|
|
|
struct procps_pidsinfo *info,
|
library: standardize portions of interface, <PIDS> api
This represents a rather major interface redesign. The
following highlights most of the changes/enhancements.
. The 'read' interface (employed by pgrep & pidof) saw
the biggest change. The 'open', 'next' and 'shut' guys
all went bye-bye, replaced by a single 'get' function.
. The items specified at 'new' time no longer serve as
the maximum. In fact, items & numitems are now treated
as optional, should callers prefer to wait until later
when the 'reset' function would then become mandatory.
. Even at 'reset' time, the stacks are not tied to any
sort of maximum. They will grow dynamically as needed.
. The order of some parameters was changed to parallel
that found in our other APIs. Specifically, when items
& numitems are needed they're specified in that order.
. A user will no longer be prevented from concurrently
employing any accessor functions. In other words, that
'get' (old 'read') won't preclude 'reap' and 'select'.
. A duplicate enumerator was found dealing with locked
resident pages. So, the name VM_LOCK was eliminated in
favor of VM_RSS_LOCKED, which is way more descriptive.
. The struct address returned to callers following any
reap() or select() is now more sharable as pids_fetch.
. Some input parameter names were changed to make them
more descriptive of the intended purpose/requirements.
------------------------------------------------------
Internally, there were numerous implementation changes
made that did not directly impact any potential users.
. That #define FPRINT_STACKS was eliminated along with
the associated supporting function and its invocation.
. Addresses returned following 'reap' or 'select' will
now be NULL delimited, so one has the option of stacks
access via the total count or this new NULL fencepost.
. Input params were simplified and generalized in both
oldproc_open() & close() to enable more than 1 PROCTAB
to be open simultaneously, which was required for get.
. The PROCPS_PIDS_logical_end enum was relocated after
the Item_table making the need to keep it synchronized
more apparent (if the table expands it's right there).
. The 'Public function' section of the source file was
subdivided into 1) the three basic required functions;
and 2) functions that can sometimes vary between APIs.
Signed-off-by: Jim Warner <james.warner@comcast.net>
2016-05-14 10:30:00 +05:30
|
|
|
enum pids_item *newitems,
|
|
|
|
int newnumitems);
|
2015-08-19 10:30:00 +05:30
|
|
|
|
library: standardize portions of interface, <PIDS> api
This represents a rather major interface redesign. The
following highlights most of the changes/enhancements.
. The 'read' interface (employed by pgrep & pidof) saw
the biggest change. The 'open', 'next' and 'shut' guys
all went bye-bye, replaced by a single 'get' function.
. The items specified at 'new' time no longer serve as
the maximum. In fact, items & numitems are now treated
as optional, should callers prefer to wait until later
when the 'reset' function would then become mandatory.
. Even at 'reset' time, the stacks are not tied to any
sort of maximum. They will grow dynamically as needed.
. The order of some parameters was changed to parallel
that found in our other APIs. Specifically, when items
& numitems are needed they're specified in that order.
. A user will no longer be prevented from concurrently
employing any accessor functions. In other words, that
'get' (old 'read') won't preclude 'reap' and 'select'.
. A duplicate enumerator was found dealing with locked
resident pages. So, the name VM_LOCK was eliminated in
favor of VM_RSS_LOCKED, which is way more descriptive.
. The struct address returned to callers following any
reap() or select() is now more sharable as pids_fetch.
. Some input parameter names were changed to make them
more descriptive of the intended purpose/requirements.
------------------------------------------------------
Internally, there were numerous implementation changes
made that did not directly impact any potential users.
. That #define FPRINT_STACKS was eliminated along with
the associated supporting function and its invocation.
. Addresses returned following 'reap' or 'select' will
now be NULL delimited, so one has the option of stacks
access via the total count or this new NULL fencepost.
. Input params were simplified and generalized in both
oldproc_open() & close() to enable more than 1 PROCTAB
to be open simultaneously, which was required for get.
. The PROCPS_PIDS_logical_end enum was relocated after
the Item_table making the need to keep it synchronized
more apparent (if the table expands it's right there).
. The 'Public function' section of the source file was
subdivided into 1) the three basic required functions;
and 2) functions that can sometimes vary between APIs.
Signed-off-by: Jim Warner <james.warner@comcast.net>
2016-05-14 10:30:00 +05:30
|
|
|
struct pids_fetch *procps_pids_select (
|
2015-10-01 10:30:00 +05:30
|
|
|
struct procps_pidsinfo *info,
|
|
|
|
unsigned *these,
|
library: standardize portions of interface, <PIDS> api
This represents a rather major interface redesign. The
following highlights most of the changes/enhancements.
. The 'read' interface (employed by pgrep & pidof) saw
the biggest change. The 'open', 'next' and 'shut' guys
all went bye-bye, replaced by a single 'get' function.
. The items specified at 'new' time no longer serve as
the maximum. In fact, items & numitems are now treated
as optional, should callers prefer to wait until later
when the 'reset' function would then become mandatory.
. Even at 'reset' time, the stacks are not tied to any
sort of maximum. They will grow dynamically as needed.
. The order of some parameters was changed to parallel
that found in our other APIs. Specifically, when items
& numitems are needed they're specified in that order.
. A user will no longer be prevented from concurrently
employing any accessor functions. In other words, that
'get' (old 'read') won't preclude 'reap' and 'select'.
. A duplicate enumerator was found dealing with locked
resident pages. So, the name VM_LOCK was eliminated in
favor of VM_RSS_LOCKED, which is way more descriptive.
. The struct address returned to callers following any
reap() or select() is now more sharable as pids_fetch.
. Some input parameter names were changed to make them
more descriptive of the intended purpose/requirements.
------------------------------------------------------
Internally, there were numerous implementation changes
made that did not directly impact any potential users.
. That #define FPRINT_STACKS was eliminated along with
the associated supporting function and its invocation.
. Addresses returned following 'reap' or 'select' will
now be NULL delimited, so one has the option of stacks
access via the total count or this new NULL fencepost.
. Input params were simplified and generalized in both
oldproc_open() & close() to enable more than 1 PROCTAB
to be open simultaneously, which was required for get.
. The PROCPS_PIDS_logical_end enum was relocated after
the Item_table making the need to keep it synchronized
more apparent (if the table expands it's right there).
. The 'Public function' section of the source file was
subdivided into 1) the three basic required functions;
and 2) functions that can sometimes vary between APIs.
Signed-off-by: Jim Warner <james.warner@comcast.net>
2016-05-14 10:30:00 +05:30
|
|
|
int numthese,
|
2016-04-18 10:30:00 +05:30
|
|
|
enum pids_select_type which);
|
2015-10-01 10:30:00 +05:30
|
|
|
|
2015-10-11 10:30:00 +05:30
|
|
|
struct pids_stack **procps_pids_sort (
|
2015-08-19 10:30:00 +05:30
|
|
|
struct procps_pidsinfo *info,
|
2015-08-20 10:30:00 +05:30
|
|
|
struct pids_stack *stacks[],
|
2015-08-19 10:30:00 +05:30
|
|
|
int numstacked,
|
library: standardize portions of interface, <PIDS> api
This represents a rather major interface redesign. The
following highlights most of the changes/enhancements.
. The 'read' interface (employed by pgrep & pidof) saw
the biggest change. The 'open', 'next' and 'shut' guys
all went bye-bye, replaced by a single 'get' function.
. The items specified at 'new' time no longer serve as
the maximum. In fact, items & numitems are now treated
as optional, should callers prefer to wait until later
when the 'reset' function would then become mandatory.
. Even at 'reset' time, the stacks are not tied to any
sort of maximum. They will grow dynamically as needed.
. The order of some parameters was changed to parallel
that found in our other APIs. Specifically, when items
& numitems are needed they're specified in that order.
. A user will no longer be prevented from concurrently
employing any accessor functions. In other words, that
'get' (old 'read') won't preclude 'reap' and 'select'.
. A duplicate enumerator was found dealing with locked
resident pages. So, the name VM_LOCK was eliminated in
favor of VM_RSS_LOCKED, which is way more descriptive.
. The struct address returned to callers following any
reap() or select() is now more sharable as pids_fetch.
. Some input parameter names were changed to make them
more descriptive of the intended purpose/requirements.
------------------------------------------------------
Internally, there were numerous implementation changes
made that did not directly impact any potential users.
. That #define FPRINT_STACKS was eliminated along with
the associated supporting function and its invocation.
. Addresses returned following 'reap' or 'select' will
now be NULL delimited, so one has the option of stacks
access via the total count or this new NULL fencepost.
. Input params were simplified and generalized in both
oldproc_open() & close() to enable more than 1 PROCTAB
to be open simultaneously, which was required for get.
. The PROCPS_PIDS_logical_end enum was relocated after
the Item_table making the need to keep it synchronized
more apparent (if the table expands it's right there).
. The 'Public function' section of the source file was
subdivided into 1) the three basic required functions;
and 2) functions that can sometimes vary between APIs.
Signed-off-by: Jim Warner <james.warner@comcast.net>
2016-05-14 10:30:00 +05:30
|
|
|
enum pids_item sortitem,
|
2015-08-19 10:30:00 +05:30
|
|
|
enum pids_sort_order order);
|
|
|
|
|
|
|
|
__END_DECLS
|
|
|
|
#endif /* _PROC_PIDS_H */
|