summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2014-01-14 00:22:52 -0200
committerHisham Muhammad <hisham@gobolinux.org>2014-01-14 00:23:41 -0200
commit1c0e93c1bd0f80b1475a02989c861fe7d86bcf4b (patch)
treea5c1d375d73940b242f1a5ed4686d0dde38beade
parentcd692f27f4b88ac5abd12531536fab1d94eb607c (diff)
First new feature of the git era! "c" key tags all children of a process.
-rw-r--r--ChangeLog1
-rw-r--r--htop.c18
2 files changed, 19 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 5efc3e52..e22d0bdc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
What's new in version 1.0.3
+* Tag all children ('c' key)
* Fixes in accounting of guest time when using virtualization
(thanks to Patrick Marlier)
* Performance improvements
diff --git a/htop.c b/htop.c
index 7471dcd4..359f21df 100644
--- a/htop.c
+++ b/htop.c
@@ -272,6 +272,17 @@ static const char* getMainPanelValue(Panel* panel, int i) {
return "";
}
+static void tagAllChildren(Panel* panel, Process* parent) {
+ parent->tag = true;
+ pid_t ppid = parent->pid;
+ for (int i = 0; i < Panel_size(panel); i++) {
+ Process* p = (Process*) Panel_get(panel, i);
+ if (!p->tag && p->ppid == ppid) {
+ tagAllChildren(panel, p);
+ }
+ }
+}
+
int main(int argc, char** argv) {
int delay = -1;
@@ -563,6 +574,13 @@ int main(int argc, char** argv) {
setSortKey(pl, TIME, panel, settings);
break;
}
+ case 'c':
+ {
+ Process* p = (Process*) Panel_getSelected(panel);
+ if (!p) break;
+ tagAllChildren(panel, p);
+ break;
+ }
case 'U':
{
for (int i = 0; i < Panel_size(panel); i++) {

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