top: more useless cosemetic changes (chiefly comments)
All of these changes are self-explanatory, so I'll not provide any more comments thus avoiding further shame. [ everything's perfectly justified and right margins ] [ are filled entirely, but of course it must be luck ] Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
parent
e319650278
commit
072a850761
38
top/top.c
38
top/top.c
@ -5728,9 +5728,15 @@ static void keys_xtra (int ch) {
|
||||
/*###### Cpu Display Secondary support (summary_show helpers) ##########*/
|
||||
|
||||
/*
|
||||
* Cpu *Helper* function to combine and or show the state
|
||||
* percentages for 1 cpu or 2 adjacent cpus (one single line). */
|
||||
static inline int cpu_prt (const char *str, int nobuf) {
|
||||
* note how alphabetical order is maintained within carefully chosen |
|
||||
* function names such as: (s)cpu_see, (t)cpu_tics, and (u)cpu_unify |
|
||||
* with each name exactly 1 letter more than the preceeding function |
|
||||
* ( surely, this must make us run much more efficiently. amirite? ) | */
|
||||
|
||||
/*
|
||||
* Cpu *Helper* function to show the percentages for one or two cpus |
|
||||
* as a single line. We return the number of lines actually printed. | */
|
||||
static inline int cpu_see (const char *str, int nobuf) {
|
||||
static char row[ROWMINSIZ];
|
||||
static int tog;
|
||||
char *p;
|
||||
@ -5748,17 +5754,18 @@ static inline int cpu_prt (const char *str, int nobuf) {
|
||||
row[0] = '\0';
|
||||
tog = 0;
|
||||
return 1;
|
||||
} // end: cpu_prt
|
||||
} // end: cpu_see
|
||||
|
||||
|
||||
/*
|
||||
* State display *Helper* function to calc and display the state
|
||||
* percentages for a single cpu. In this way, we can support
|
||||
* the following environments without the usual code bloat.
|
||||
* 1) single cpu machines
|
||||
* 2) modest smp boxes with room for each cpu's percentages
|
||||
* 3) massive smp guys leaving little or no room for process
|
||||
* display and thus requiring the cpu summary toggle */
|
||||
* State display *Helper* function to calculate plus display (maybe) |
|
||||
* the percentages for a single cpu. In this way, we'll support the |
|
||||
* following environments without (hopefully) that usual code bloat: |
|
||||
* 1) single cpu platforms (no matter the paucity of these types) |
|
||||
* 2) modest smp boxes with ample room for each cpu's percentages |
|
||||
* 3) massive smp guys leaving little or no room for that process |
|
||||
* display and thus requiring the '1', '4', or '!' cpu toggles |
|
||||
* ( we return the number of lines printed, as reported by cpu_see ) | */
|
||||
static int cpu_tics (CPU_t *cpu, const char *pfx, int nobuf) {
|
||||
/* we'll trim to zero if we get negative time ticks,
|
||||
which has happened with some SMP kernels (pre-2.4?)
|
||||
@ -5808,10 +5815,10 @@ static int cpu_tics (CPU_t *cpu, const char *pfx, int nobuf) {
|
||||
snprintf(syst, sizeof(syst), gtab[ix].syst, (int)((pct_syst * Graph_adj) + .4), gtab[ix].type);
|
||||
#endif
|
||||
snprintf(dual, sizeof(dual), "%s%s", user, syst);
|
||||
return cpu_prt(fmtmk("%s ~3%#5.1f~2/%-#5.1f~3 %3.0f[~1%-*s]~1"
|
||||
return cpu_see(fmtmk("%s ~3%#5.1f~2/%-#5.1f~3 %3.0f[~1%-*s]~1"
|
||||
, pfx, pct_user, pct_syst, pct_user + pct_syst, Graph_len +4, dual), nobuf);
|
||||
} else {
|
||||
return cpu_prt(fmtmk(Cpu_States_fmts, pfx
|
||||
return cpu_see(fmtmk(Cpu_States_fmts, pfx
|
||||
, (float)u_frme * scale, (float)s_frme * scale
|
||||
, (float)n_frme * scale, (float)i_frme * scale
|
||||
, (float)w_frme * scale, (float)x_frme * scale
|
||||
@ -5822,8 +5829,9 @@ static int cpu_tics (CPU_t *cpu, const char *pfx, int nobuf) {
|
||||
|
||||
|
||||
/*
|
||||
* Cpu *Helper* function to combine adjacent cpu stats
|
||||
* in an effort to reduce total number of processors shown */
|
||||
* Cpu *Helper* function to combine additional cpu statistics in our |
|
||||
* efforts to reduce the total number of processors that'll be shown |
|
||||
* ( we return the number of lines printed, as reported by cpu_see ) | */
|
||||
static int cpu_unify (CPU_t *cpu, int nobuf) {
|
||||
static CPU_t accum;
|
||||
static int ix, beg;
|
||||
|
@ -802,7 +802,7 @@ typedef struct WIN_t {
|
||||
//atic void keys_window (int ch);
|
||||
//atic void keys_xtra (int ch);
|
||||
/*------ Cpu Display Secondary Support (summary_show helpers) ----------*/
|
||||
//atic inline int cpu_prt (const char *str, int nobuf);
|
||||
//atic inline int cpu_see (const char *str, int nobuf);
|
||||
//atic int cpu_tics (CPU_t *cpu, const char *pfx, int nobuf);
|
||||
//atic int cpu_unify (CPU_t *cpu, int nobuf);
|
||||
/*------ Main Screen routines ------------------------------------------*/
|
||||
|
Loading…
Reference in New Issue
Block a user