summaryrefslogtreecommitdiffstats
path: root/htop.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2010-08-24 23:20:38 +0000
committerHisham Muhammad <hisham@gobolinux.org>2010-08-24 23:20:38 +0000
commit6486229308cf7acc7a4ba7dd5f755cdb969372ef (patch)
tree380c7bd90256bc93d8babf0eda6fecefcfa06d74 /htop.c
parentc166e172a8f46c710fbba5996f8f332f4c4984ce (diff)
add support for steal/guest CPU time measurement
simplify processor data accounting (add CPUData structure) remove Process_clone trick
Diffstat (limited to 'htop.c')
-rw-r--r--htop.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/htop.c b/htop.c
index cd560b52..0e7a84bd 100644
--- a/htop.c
+++ b/htop.c
@@ -83,13 +83,16 @@ static void showHelp(ProcessList* pl) {
addattrstr(CRT_colors[CPU_KERNEL], "kernel"); addstr("/");
addattrstr(CRT_colors[CPU_IRQ], "irq"); addstr("/");
addattrstr(CRT_colors[CPU_SOFTIRQ], "soft-irq"); addstr("/");
- addattrstr(CRT_colors[CPU_IOWAIT], "io-wait");
+ addattrstr(CRT_colors[CPU_IOWAIT], "io-wait"); addstr("/");
+ addattrstr(CRT_colors[CPU_STEAL], "steal"); addstr("/");
+ addattrstr(CRT_colors[CPU_GUEST], "guest");
addattrstr(CRT_colors[BAR_SHADOW], " used%");
} else {
addattrstr(CRT_colors[CPU_NICE], "low-priority"); addstr("/");
addattrstr(CRT_colors[CPU_NORMAL], "normal"); addstr("/");
- addattrstr(CRT_colors[CPU_KERNEL], "kernel");
- addattrstr(CRT_colors[BAR_SHADOW], " used%");
+ addattrstr(CRT_colors[CPU_KERNEL], "kernel"); addstr("/");
+ addattrstr(CRT_colors[CPU_STEAL], "virtualiz");
+ addattrstr(CRT_colors[BAR_SHADOW], " used%");
}
addattrstr(CRT_colors[BAR_BORDER], "]");
attrset(CRT_colors[DEFAULT_COLOR]);
@@ -98,13 +101,13 @@ static void showHelp(ProcessList* pl) {
addattrstr(CRT_colors[MEMORY_USED], "used"); addstr("/");
addattrstr(CRT_colors[MEMORY_BUFFERS], "buffers"); addstr("/");
addattrstr(CRT_colors[MEMORY_CACHE], "cache");
- addattrstr(CRT_colors[BAR_SHADOW], " used/total");
+ addattrstr(CRT_colors[BAR_SHADOW], " used/total");
addattrstr(CRT_colors[BAR_BORDER], "]");
attrset(CRT_colors[DEFAULT_COLOR]);
mvaddstr(5, 0, "Swap bar: ");
addattrstr(CRT_colors[BAR_BORDER], "[");
addattrstr(CRT_colors[SWAP], "used");
- addattrstr(CRT_colors[BAR_SHADOW], " used/total");
+ addattrstr(CRT_colors[BAR_SHADOW], " used/total");
addattrstr(CRT_colors[BAR_BORDER], "]");
attrset(CRT_colors[DEFAULT_COLOR]);
mvaddstr(6,0, "Type and layout of header meters are configurable in the setup screen.");
@@ -122,7 +125,7 @@ static void showHelp(ProcessList* pl) {
mvaddstr(16, 0, " ] F7: higher priority (root only) M: sort by MEM%");
mvaddstr(17, 0, " [ F8: lower priority (+ nice) T: sort by TIME");
#ifdef HAVE_PLPA
- if (pl->processorCount > 1)
+ if (pl->cpuCount > 1)
mvaddstr(18, 0, " a: set CPU affinity F4 I: invert sort order");
else
#endif
@@ -143,7 +146,7 @@ static void showHelp(ProcessList* pl) {
mvaddstr(17, 0, " - ] F8"); mvaddstr(17,40, " T");
mvaddstr(18,40, " F4 I");
#if HAVE_PLPA
- if (pl->processorCount > 1)
+ if (pl->cpuCount > 1)
mvaddstr(18, 0, " a:");
#endif
mvaddstr(19, 0, " F2 S"); mvaddstr(19,40, " F6 >");
@@ -685,12 +688,12 @@ int main(int argc, char** argv) {
#ifdef HAVE_PLPA
case 'a':
{
- if (pl->processorCount == 1)
+ if (pl->cpuCount == 1)
break;
unsigned long curr = Process_getAffinity((Process*) Panel_getSelected(panel));
- Panel* affinityPanel = AffinityPanel_new(pl->processorCount, curr);
+ Panel* affinityPanel = AffinityPanel_new(pl->cpuCount, curr);
const char* fuFunctions[] = {"Set ", "Cancel ", NULL};
void* set = pickFromVector(panel, affinityPanel, 15, headerHeight, fuFunctions, defaultBar);
@@ -782,6 +785,7 @@ int main(int argc, char** argv) {
case KEY_F(5):
refreshTimeout = 0;
pl->treeView = !pl->treeView;
+ ProcessList_expandTree(pl);
settings->changed = true;
break;
case 'H':

© 2014-2024 Faster IT GmbH | imprint | privacy policy