mirror of
https://github.com/aristocratos/btop.git
synced 2024-09-29 16:51:40 +13:00
Added a check for filter kernel mode
This commit is contained in:
parent
8ed8d43f5a
commit
2b4000b857
1 changed files with 7 additions and 2 deletions
|
@ -16,7 +16,7 @@ indent = tab
|
||||||
tab-size = 4
|
tab-size = 4
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "robin_hood.h"
|
#include <robin_hood.h>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <ranges>
|
#include <ranges>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
@ -1274,6 +1274,7 @@ namespace Proc {
|
||||||
|
|
||||||
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) {
|
||||||
auto cur_pos = out_procs.size();
|
auto cur_pos = out_procs.size();
|
||||||
|
@ -1467,8 +1468,11 @@ namespace Proc {
|
||||||
//* ---------------------------------------------Collection start----------------------------------------------
|
//* ---------------------------------------------Collection start----------------------------------------------
|
||||||
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) {
|
||||||
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();
|
||||||
|
@ -1519,6 +1523,7 @@ namespace Proc {
|
||||||
if (should_filter_kernel && (pid == KTHREADD || kernels_procs.contains(pid))) {
|
if (should_filter_kernel && (pid == KTHREADD || kernels_procs.contains(pid))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
found.push_back(pid);
|
found.push_back(pid);
|
||||||
|
|
||||||
//? Check if pid already exists in current_procs
|
//? Check if pid already exists in current_procs
|
||||||
|
|
Loading…
Reference in a new issue