mirror of https://github.com/xzeldon/htop.git
First new feature of the git era! "c" key tags all children of a process.
This commit is contained in:
parent
cd692f27f4
commit
1c0e93c1bd
|
@ -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
|
||||
|
|
18
htop.c
18
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++) {
|
||||
|
|
Loading…
Reference in New Issue