mirror of
https://github.com/aristocratos/btop.git
synced 2024-06-30 03:51:11 +12:00
Changed spaces to tabs
This commit is contained in:
parent
482734766a
commit
d916e064d1
|
@ -1259,21 +1259,21 @@ namespace Proc {
|
||||||
int filter_found = 0;
|
int filter_found = 0;
|
||||||
|
|
||||||
detail_container detailed;
|
detail_container detailed;
|
||||||
static robin_hood::unordered_set<size_t> kernels_procs{};
|
static robin_hood::unordered_set<size_t> kernels_procs{};
|
||||||
constexpr size_t KTHREADD = 2;
|
constexpr size_t KTHREADD = 2;
|
||||||
|
|
||||||
// Clearing the cache is used in the event of a pid wrap around.
|
// Clearing the cache is used in the event of a pid wrap around.
|
||||||
// In that event processes that acquire old kernel pids would also be filtered out so we need to manually clean the cache every now and then.
|
// In that event processes that acquire old kernel pids would also be filtered out so we need to manually clean the cache every now and then.
|
||||||
static void clear_kernel_cache() {
|
static void clear_kernel_cache() {
|
||||||
static size_t latest_clear_time = 0;
|
static size_t latest_clear_time = 0;
|
||||||
|
|
||||||
if (latest_clear_time >= 256) {
|
if (latest_clear_time >= 256) {
|
||||||
kernels_procs.clear();
|
kernels_procs.clear();
|
||||||
latest_clear_time = 0;
|
latest_clear_time = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
latest_clear_time++;
|
latest_clear_time++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//* Generate process tree list
|
//* Generate process tree list
|
||||||
void _tree_gen(proc_info& cur_proc, vector<proc_info>& in_procs, vector<std::reference_wrapper<proc_info>>& out_procs, int cur_depth, const bool collapsed, const string& filter, bool found=false, const bool no_update=false, const bool should_filter=false) {
|
void _tree_gen(proc_info& cur_proc, vector<proc_info>& in_procs, vector<std::reference_wrapper<proc_info>>& out_procs, int cur_depth, const bool collapsed, const string& filter, bool found=false, const bool no_update=false, const bool should_filter=false) {
|
||||||
|
@ -1469,10 +1469,10 @@ namespace Proc {
|
||||||
else {
|
else {
|
||||||
should_filter = true;
|
should_filter = true;
|
||||||
|
|
||||||
// First make sure kernel proc cache is cleared.
|
// First make sure kernel proc cache is cleared.
|
||||||
if (should_filter_kernel) {
|
if (should_filter_kernel) {
|
||||||
clear_kernel_cache();
|
clear_kernel_cache();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto totalMem = Mem::get_totalMem();
|
auto totalMem = Mem::get_totalMem();
|
||||||
int totalMem_len = to_string(totalMem >> 10).size();
|
int totalMem_len = to_string(totalMem >> 10).size();
|
||||||
|
@ -1658,10 +1658,10 @@ namespace Proc {
|
||||||
pread.close();
|
pread.close();
|
||||||
|
|
||||||
if (should_filter_kernel && new_proc.ppid == KTHREADD) {
|
if (should_filter_kernel && new_proc.ppid == KTHREADD) {
|
||||||
kernels_procs.emplace(new_proc.pid);
|
kernels_procs.emplace(new_proc.pid);
|
||||||
current_procs.pop_back();
|
current_procs.pop_back();
|
||||||
found.pop_back();
|
found.pop_back();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x-offset < 24) continue;
|
if (x-offset < 24) continue;
|
||||||
|
|
Loading…
Reference in a new issue