related: change for lost 'PROCPS_' enumerator prefixes

With this patch we've completed a progression toward a
standard approach to naming conventions which follows:

* Only functions will begin with that 'procps_' prefix
. ........................................... examples
. procps_vmstat_get ()
. procps_diskstats_select ()
- ----------------------------------------------------

* Exposed structures begin with the module/header name
. ........................................... examples
. struct pids_info
. struct stat_reaped
- ----------------------------------------------------

* Item enumerators begin like structs, but capitalized
. ........................................... examples
. VMSTAT_COMPACT_FAIL
. MEMINFO_DELTA_ACTIVE

[ slabinfo varies slightly due to some item variants ]
. SLABINFO_extra
. SLABS_SIZE_ACTIVE
. SLABNODE_OBJS_PER_SLAB
[ could cure with a prefix of SLABINFO, but too long ]
- ----------------------------------------------------

* Other enumerators work exactly like item enumerators
. ........................................... examples
. PIDS_SORT_ASCEND
. STAT_REAP_CPUS_AND_NODES
- ----------------------------------------------------

* Macros and constants begin just like the enumerators
. ........................................... examples
. #define SLABINFO_GET
. #define DISKSTATS_TYPE_DISK
- ----------------------------------------------------

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner
2016-07-21 00:00:00 -05:00
committed by Craig Small
parent c4d097c709
commit 612f36189e
15 changed files with 599 additions and 600 deletions

View File

@@ -282,12 +282,12 @@ static void simple_spew(void){
unsigned *pidlist = xcalloc(selection_list->n, sizeof(unsigned));
for (i = 0; i < selection_list->n; i++)
pidlist[i] = selection_list->u[selection_list->n-i-1].pid;
pidread = procps_pids_select(Pids_info, pidlist, selection_list->n, PROCPS_SELECT_PID);
pidread = procps_pids_select(Pids_info, pidlist, selection_list->n, PIDS_SELECT_PID);
free(pidlist);
} else {
enum pids_fetch_type which;
which = (thread_flags & (TF_loose_tasks|TF_show_task))
? PROCPS_FETCH_THREADS_TOO : PROCPS_FETCH_TASKS_ONLY;
? PIDS_FETCH_THREADS_TOO : PIDS_FETCH_TASKS_ONLY;
pidread = procps_pids_reap(Pids_info, which);
}
if (!pidread) {
@@ -313,9 +313,9 @@ static void simple_spew(void){
break;
case TF_show_proc|TF_show_task: // m and -m options
procps_pids_sort(Pids_info, pidread->stacks
, pidread->counts->total, PROCPS_PIDS_TIME_START, PROCPS_PIDS_ASCEND);
, pidread->counts->total, PIDS_TIME_START, PIDS_SORT_ASCEND);
procps_pids_sort(Pids_info, pidread->stacks
, pidread->counts->total, PROCPS_PIDS_ID_TGID, PROCPS_PIDS_ASCEND);
, pidread->counts->total, PIDS_ID_TGID, PIDS_SORT_ASCEND);
for (i = 0; i < pidread->counts->total; i++) {
buf = pidread->stacks[i];
next_proc:
@@ -343,7 +343,7 @@ static void prep_forest_sort(void){
incoming = search_format_array("ppid");
if(!incoming) { fprintf(stderr, _("could not find ppid\n")); exit(1); }
tmp_list = xmalloc(sizeof(sort_node));
tmp_list->reverse = PROCPS_PIDS_ASCEND;
tmp_list->reverse = PIDS_SORT_ASCEND;
tmp_list->typecode = '?'; /* what was this for? */
tmp_list->sr = incoming->sr;
tmp_list->next = sort_list;
@@ -353,7 +353,7 @@ static void prep_forest_sort(void){
incoming = search_format_array("start_time");
if(!incoming) { fprintf(stderr, _("could not find start_time\n")); exit(1); }
tmp_list = xmalloc(sizeof(sort_node));
tmp_list->reverse = PROCPS_PIDS_ASCEND;
tmp_list->reverse = PIDS_SORT_ASCEND;
tmp_list->typecode = '?'; /* what was this for? */
tmp_list->sr = incoming->sr;
tmp_list->next = sort_list;
@@ -445,7 +445,7 @@ static void fancy_spew(void){
int i, n = 0;
which = (thread_flags & TF_loose_tasks)
? PROCPS_FETCH_THREADS_TOO : PROCPS_FETCH_TASKS_ONLY;
? PIDS_FETCH_THREADS_TOO : PIDS_FETCH_TASKS_ONLY;
pidread = procps_pids_reap(Pids_info, which);
if (!pidread || !pidread->counts->total) {