mirror of
https://github.com/aristocratos/btop.git
synced 2024-10-31 21:01:03 +01:00
Add option to accumulate a child's resources in parent in tree-view
This commit is contained in:
parent
2c3ac4855d
commit
6027cedd42
@ -107,6 +107,8 @@ namespace Config {
|
|||||||
|
|
||||||
{"proc_filter_kernel", "#* (Linux) Filter processes tied to the Linux kernel(similar behavior to htop)."},
|
{"proc_filter_kernel", "#* (Linux) Filter processes tied to the Linux kernel(similar behavior to htop)."},
|
||||||
|
|
||||||
|
{"proc_aggregate", "#* In tree-view, always accumulate child process resources in the parent process."},
|
||||||
|
|
||||||
{"cpu_graph_upper", "#* Sets the CPU stat shown in upper half of the CPU graph, \"total\" is always available.\n"
|
{"cpu_graph_upper", "#* Sets the CPU stat shown in upper half of the CPU graph, \"total\" is always available.\n"
|
||||||
"#* Select from a list of detected attributes from the options menu."},
|
"#* Select from a list of detected attributes from the options menu."},
|
||||||
|
|
||||||
@ -268,6 +270,7 @@ namespace Config {
|
|||||||
{"lowcolor", false},
|
{"lowcolor", false},
|
||||||
{"show_detailed", false},
|
{"show_detailed", false},
|
||||||
{"proc_filtering", false},
|
{"proc_filtering", false},
|
||||||
|
{"proc_aggregate", false},
|
||||||
};
|
};
|
||||||
unordered_flat_map<std::string_view, bool> boolsTmp;
|
unordered_flat_map<std::string_view, bool> boolsTmp;
|
||||||
|
|
||||||
|
@ -589,6 +589,11 @@ namespace Menu {
|
|||||||
"Set true to show processes grouped by",
|
"Set true to show processes grouped by",
|
||||||
"parents with lines drawn between parent",
|
"parents with lines drawn between parent",
|
||||||
"and child process."},
|
"and child process."},
|
||||||
|
{"proc_aggregate",
|
||||||
|
"Aggregate child's resources in parent.",
|
||||||
|
"",
|
||||||
|
"In tree-view, include all child resources",
|
||||||
|
"with the parent even while expanded."},
|
||||||
{"proc_colors",
|
{"proc_colors",
|
||||||
"Enable colors in process view.",
|
"Enable colors in process view.",
|
||||||
"",
|
"",
|
||||||
|
@ -18,6 +18,7 @@ tab-size = 4
|
|||||||
|
|
||||||
#include <ranges>
|
#include <ranges>
|
||||||
|
|
||||||
|
#include "btop_config.hpp"
|
||||||
#include "btop_shared.hpp"
|
#include "btop_shared.hpp"
|
||||||
#include "btop_tools.hpp"
|
#include "btop_tools.hpp"
|
||||||
|
|
||||||
@ -156,6 +157,12 @@ namespace Proc {
|
|||||||
filter_found++;
|
filter_found++;
|
||||||
p.filtered = true;
|
p.filtered = true;
|
||||||
}
|
}
|
||||||
|
else if (Config::getB("proc_aggregate")) {
|
||||||
|
cur_proc.cpu_p += p.cpu_p;
|
||||||
|
cur_proc.cpu_c += p.cpu_c;
|
||||||
|
cur_proc.mem += p.mem;
|
||||||
|
cur_proc.threads += p.threads;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (collapsed or filtering) {
|
if (collapsed or filtering) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user